Skip to content

test: migrate PWA browser-scoped handler test to mocks - #2756

Merged
Lightning00Blade merged 2 commits into
ChromeDevTools:mainfrom
lisa0314:test/2639-pwa-browser-scope-mocks
Sep 30, 2026
Merged

Lightning00Blade merged 2 commits into
ChromeDevTools:mainfrom
lisa0314:test/2639-pwa-browser-scope-mocks

Conversation

@lisa0314

@lisa0314 lisa0314 commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Refs #2639.

Summary

  • Migrate the existing PWA browser-scoped handler test to createHandlerMocks() and createMockPuppeteerPage(). It previously launched Chrome even though all four PWA operations were already stubbed.
  • Assert that no selected page is requested, each PWA operation receives the exact arguments, and the handlers produce the expected response lines and page-list refresh calls.
  • Keep all four real-browser PWA integration tests unchanged, including installation/state/uninstallation, standalone launch, explicit launch URL, and selection recovery after uninstall.

No production code or shared mock helpers are changed.

Testing

  • Build and npm run check-format: passed; git diff --check: passed.
  • PWA test file: 5/5 passed on both this change and clean main 8939965, using Chrome 152.0.7977.83 on macOS with Node 24.18.0.
  • With PUPPETEER_EXECUTABLE_PATH=/nonexistent/pwa-unit-tests/chrome, the migrated test passes; the original test on the same main fails because it tries to launch Chrome.
  • Mutation checks: adding a selected-page lookup or passing an incorrect manifest ID makes the migrated test fail; both mutations were reverted and the test passes again.
  • Full npm run test on both this change and a clean same-main worktree: 1056 passed, 4 failed, 3 skipped each. Both fail the previous-navigation network snapshot and oversized screenshot tests. Both also have extension-related failures, but the failing extension lifecycle/content-script case differs. A focused rerun of all three extension cases implicated across the two runs passes 3/3 on both worktrees. These are not green full-suite runs.

Rebase verification (2026-09-29)

  • Rebasing onto main 47c5b37 preserves a single test-only commit in tests/tools/pwa.test.ts.
  • PUPPETEER_EXECUTABLE_PATH=/Applications/Google Chrome.app/Contents/MacOS/Google Chrome npm run test tests/tools/pwa.test.ts: 6/6 passed; npm run check-format and git diff --check: passed.
  • The full-suite results above are from earlier bases; the full suite was not rerun on 47c5b37.

@lisa0314
lisa0314 force-pushed the test/2639-pwa-browser-scope-mocks branch from 0d7fe62 to 9a74196 Compare September 29, 2026 02:48
Comment thread tests/tools/pwa.test.ts Outdated
@Lightning00Blade
Lightning00Blade added this pull request to the merge queue Sep 30, 2026
Merged via the queue into ChromeDevTools:main with commit d80882c Sep 30, 2026
28 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants