-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promise on navigator.serviceWorker that resolves when page is controlled #799
Comments
Well, I think .ready() resolves as soon as the active worker is set. This is before the activate event is even dispatched. The SW running the activate event is already set as registration.active. So I don't think we can conceivably wait for the activate event's waitUntil() to resolve to get the effect you were expecting. Also FWIW, the clients.claim() spec seems buggy at the moment. For example, it says Handle Service Worker Client Unload should be run for each client in parallel. This algorithm, however, does things like:
|
Oh, the navigation fetch should not complete until activate waitUntil resolves, though. So I think your test case should work. We explicitly do this waiting in firefox, but I think @matto might have told me chrome does not wait yet. The live version above does seem to work as you expect in firefox nightly. |
Sorry, I was confused. From a fresh uninstalled state I do see the behavior you describe. |
After thinking about this more, I realized that what I initially proposed, with the assumptions I was making, would lead to a deadlock. Let me rephrase this feature request: it would be useful if there were a promise exposed on Listening for |
FWIW, lacking formal support for such a promise in the platform, I'm adopting https://github.com/PolymerElements/platinum-sw/blob/fix-flaky-test/test/controlled-promise.js in some unit tests that need to wait until the page is controlled before they execute. |
@wanderview are there technical impediments for instead of resolving |
If I think changing the behavior of |
Agree with @jungkees. Reg .ready means you can use APIs that depend on an active worker, such as push & BG sync. |
@jakearchibald wouldn't it make more sense to resolve .ready on |
@jakearchibald , I agree but you can not use them because there is a small windows between activating and activated where you don't receive functional events (like @jeffposnick discovered). It only can when it is fully activated. So, as @wanderview suggest we should resolve |
I see this as being useful primarily for writing unit tests, when the "progressive enhancement/I don't care if there's a controller or not" aspects of service worker isn't relevant, and you really need to delay execution until there's a controller. If you're writing tests that already use promises (because they're using |
To repeat, this is in the spec today. And we implement it. |
Roger but please, consider the other option (resolving @wanderview just a clarification, are all functional events stalled until activation or only fetch events? |
All functional events. I recently got step 4 added here: The fetch event waiting for activate event to complete was previously in the spec. We delay for all functional events in gecko. I don't know what chrome does at the moment. |
I'm not sure what you mean by "can not use". Functional events are queued. The APIs are fully functional. Can you show me a failure case? I'm not against making |
This could be implemented as: const p = new Promise(r => {
if (navigator.serviceWorker.controller) return r();
navigator.serviceWorker.addEventListener('controllerchange', e => r());
}); I think we need more evidence that this is a common enough pattern to add to the platform. |
Can you show me some code that would be delayed in this way? |
The "gotcha"/failure came up in the context of writing a unit test, where the code to execute really had to wait until the page was controlled, or it wouldn't end up testing the right thing. I had originally written the test to wait on I now understand why the test was flaky, and am using a synthetic So that's the main use case I have in mind, and I think that it's a common enough pattern for anyone writing tests. Whether we ask everyone writing tests that depend on the page being controlled to roll their own |
Thank you @wanderview , that step is what I was missing!
@jakearchibald , my comment was added before knowing about the fact that functional events are delayed until activation. So, no problem here. @jeffposnick can you point to the specific test? If the spec says that events are delayed and it's well implemente, I'm not able to imagine the specific scenario where |
Personally I think some of the issues here stem from the name "ready" and sticking it on the ServiceWorkerContainer. The current .ready promise is really when is the oldest ServiceWorker ready to begin receiving (maybe queueing) functional events. It seems reasonable, though, for a page to think navigator.serviceWorker.ready is more about "when is my page's controlling service worker ready". Being on the ServiceWorkerContainer implies some relationship with the current page. |
@delapuente: The test I'm referring to that was flaky when waiting on It's no longer flaky since switching over to explicitly wait on the page being controlled: https://github.com/PolymerElements/platinum-sw/blob/fb5a32dd77a7ee9e4240a05e0d00a570b176fb25/test/platinum-sw-fetch/index.html#L38 It's testing behavior that relies on the service worker's |
@jeffposnick , was the problem that your test was timing out? How long was the time out? Because, per step 4 of https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#handle-functional-event-algorithm that test should pass as your So perhaps your test was revealing a bug in Chrome. |
@delapuente That page self registers, so the initial page is not controlled. If the test fetch happens before the clients.claim() finishes then there is no fetch event to be delayed. It really does need to wait until being controlled before starting the test. |
So that |
The page will have its controller only after |
Given how easy it is to do this already (#799 (comment)), I don't think we need a specific API for it. |
For people who're reading this now (through Google search), the Usage:
Excerpt from the source code at time of writing:
Although it is a very small letdown that there's no |
Actually this didn't' solve the issue. First time page loads and hard reloads prevent controller for becoming available. |
Thank you for this. I'm still testing but this seems to work for me. On the first page load it waits for the 'controlling' event and then on subsequent loads will look for the controller being set.
|
This change does not change the tests themselves but how we register service workers. Previously a page reload was needed in order to make get the service worker activated. This worked fine and passed all the chrome wpts, but not on firefox see here: https://github.com/web-platform-tests/wpt/runs/24793731783. This new change uses a different technique that is used by some tests in the wpt/service-workers/ directory. Specifically, changes to the registration include: - unregister all service workers before the tests start. - service workers, once activated, will use 'clients.claim()' so that clients loaded in the same scope do not need to be reloaded before their fetches will go through this service worker. (https://developer.mozilla.org/en-US/docs/Web/API/Clients/claim) - wait for the service worker to be activated AND wait for the service worker to be controlling the page (which seems to be a common problem: w3c/ServiceWorker#799 ) This reverts commit eba96feb09f5ed94a093d012956bae1dc72cb486. Reason for revert: Changed the way we register SW, see above. Original change's description: > Revert "Reland "Reland "Service worker web platform tests.""" > > This reverts commit 9bd67ed90e90d6a2c2134d26bb8bcc4cd9436b19. > > Reason for revert: Failing in some cases. > > Original change's description: > > Reland "Reland "Service worker web platform tests."" > > > > This reverts commit 93a580699ecf6d102a5853455b5faeceea4cd31e. > > > > Reason for revert: Removed the test case that times out, > > (the one that waits for the update url). > > > > Original change's description: > > > Revert "Reland "Service worker web platform tests."" > > > > > > This reverts commit 436f1b9f6153002fd41599d5d4ec8343cf930a43. > > > > > > Reason for revert: There are still timeouts in some tests > > > > > > Original change's description: > > > > Reland "Service worker web platform tests." > > > > > > > > This reverts commit 36a1c457dac0ecaa54c0553b28f67c0c61752494. > > > > > > > > Reason for revert: The test that looks for 'update-url.py' takes too long and therefore will require this test file to be part of slowTests > > > > > > > > Original change's description: > > > > > Revert "Service worker web platform tests." > > > > > > > > > > This reverts commit 63858f1b1ed058d07e73cebb0a98214aa2cfc715. > > > > > > > > > > Reason for revert: New test added; fails immediately on some bots. > > > > > > > > > > See > > > > > https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests/38089/overview > > > > > for the first failures. (And consistently in subsequent builds) > > > > > > > > > > Original change's description: > > > > > > Service worker web platform tests. > > > > > > > > > > > > This tests that when an auction is ran, service workers do not intercept requests with URLs that are meant to be private. > > > > > > > > > > > > > > > > > > Bug: 293383734 > > > > > > Change-Id: I06858f7cae4794a35c045fb8dad30d6316a26ead > > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459094 > > > > > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > > > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > > > > Reviewed-by: Orr Bernstein <orrb@google.com> > > > > > > Cr-Commit-Position: refs/heads/main@{#1294960} > > > > > > > > > > Bug: 293383734 > > > > > Change-Id: I3431f0e45e65767ff1529002d8a2d14657d0cb5a > > > > > No-Presubmit: true > > > > > No-Tree-Checks: true > > > > > No-Try: true > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5506634 > > > > > Auto-Submit: Ian Clelland <iclelland@chromium.org> > > > > > Owners-Override: Ian Clelland <iclelland@chromium.org> > > > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Cr-Commit-Position: refs/heads/main@{#1295015} > > > > > > > > Bug: 293383734 > > > > Change-Id: I762dd50282f99617796df64d73a27d149cac0a86 > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5512083 > > > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > Reviewed-by: Orr Bernstein <orrb@google.com> > > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > > Cr-Commit-Position: refs/heads/main@{#1296948} > > > > > > Bug: 293383734 > > > Change-Id: I9b06c0453656aaa448d0030960a48fc264bcf867 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5515623 > > > Auto-Submit: Youssef Bourouphael <ybourouphael@google.com> > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Commit-Queue: mmenke <mmenke@chromium.org> > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Cr-Commit-Position: refs/heads/main@{#1297048} > > > > Bug: 293383734 > > Change-Id: I7ae169c2750432bb1cb9c1c340585dc27d8cd419 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5521778 > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > Reviewed-by: mmenke <mmenke@chromium.org> > > Reviewed-by: Orr Bernstein <orrb@google.com> > > Cr-Commit-Position: refs/heads/main@{#1298807} > > Bug: 293383734 > Change-Id: I182736b58e83dbe7fc2c5fc7e20a3e3f909772a2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526425 > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > Cr-Commit-Position: refs/heads/main@{#1298902} Bug: 293383734 Change-Id: Ia501a6d9d06e72038b14b656c95f465cef373ad4
This change does not change the tests themselves but how we register service workers. Previously a page reload was needed in order to make get the service worker activated. This worked fine and passed all the chrome wpts, but not on firefox see here: https://github.com/web-platform-tests/wpt/runs/24793731783. This new change uses a different technique that is used by some tests in the wpt/service-workers/ directory. Specifically, changes to the registration include: - unregister all service workers before the tests start. - service workers, once activated, will use 'clients.claim()' so that clients loaded in the same scope do not need to be reloaded before their fetches will go through this service worker. (https://developer.mozilla.org/en-US/docs/Web/API/Clients/claim) - wait for the service worker to be activated AND wait for the service worker to be controlling the page (which seems to be a common problem: w3c/ServiceWorker#799 ) This reverts commit eba96feb09f5ed94a093d012956bae1dc72cb486. Reason for revert: Changed the way we register SW, see above. Original change's description: > Revert "Reland "Reland "Service worker web platform tests.""" > > This reverts commit 9bd67ed90e90d6a2c2134d26bb8bcc4cd9436b19. > > Reason for revert: Failing in some cases. > > Original change's description: > > Reland "Reland "Service worker web platform tests."" > > > > This reverts commit 93a580699ecf6d102a5853455b5faeceea4cd31e. > > > > Reason for revert: Removed the test case that times out, > > (the one that waits for the update url). > > > > Original change's description: > > > Revert "Reland "Service worker web platform tests."" > > > > > > This reverts commit 436f1b9f6153002fd41599d5d4ec8343cf930a43. > > > > > > Reason for revert: There are still timeouts in some tests > > > > > > Original change's description: > > > > Reland "Service worker web platform tests." > > > > > > > > This reverts commit 36a1c457dac0ecaa54c0553b28f67c0c61752494. > > > > > > > > Reason for revert: The test that looks for 'update-url.py' takes too long and therefore will require this test file to be part of slowTests > > > > > > > > Original change's description: > > > > > Revert "Service worker web platform tests." > > > > > > > > > > This reverts commit 63858f1b1ed058d07e73cebb0a98214aa2cfc715. > > > > > > > > > > Reason for revert: New test added; fails immediately on some bots. > > > > > > > > > > See > > > > > https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests/38089/overview > > > > > for the first failures. (And consistently in subsequent builds) > > > > > > > > > > Original change's description: > > > > > > Service worker web platform tests. > > > > > > > > > > > > This tests that when an auction is ran, service workers do not intercept requests with URLs that are meant to be private. > > > > > > > > > > > > > > > > > > Bug: 293383734 > > > > > > Change-Id: I06858f7cae4794a35c045fb8dad30d6316a26ead > > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459094 > > > > > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > > > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > > > > Reviewed-by: Orr Bernstein <orrb@google.com> > > > > > > Cr-Commit-Position: refs/heads/main@{#1294960} > > > > > > > > > > Bug: 293383734 > > > > > Change-Id: I3431f0e45e65767ff1529002d8a2d14657d0cb5a > > > > > No-Presubmit: true > > > > > No-Tree-Checks: true > > > > > No-Try: true > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5506634 > > > > > Auto-Submit: Ian Clelland <iclelland@chromium.org> > > > > > Owners-Override: Ian Clelland <iclelland@chromium.org> > > > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Cr-Commit-Position: refs/heads/main@{#1295015} > > > > > > > > Bug: 293383734 > > > > Change-Id: I762dd50282f99617796df64d73a27d149cac0a86 > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5512083 > > > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > Reviewed-by: Orr Bernstein <orrb@google.com> > > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > > Cr-Commit-Position: refs/heads/main@{#1296948} > > > > > > Bug: 293383734 > > > Change-Id: I9b06c0453656aaa448d0030960a48fc264bcf867 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5515623 > > > Auto-Submit: Youssef Bourouphael <ybourouphael@google.com> > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Commit-Queue: mmenke <mmenke@chromium.org> > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Cr-Commit-Position: refs/heads/main@{#1297048} > > > > Bug: 293383734 > > Change-Id: I7ae169c2750432bb1cb9c1c340585dc27d8cd419 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5521778 > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > Reviewed-by: mmenke <mmenke@chromium.org> > > Reviewed-by: Orr Bernstein <orrb@google.com> > > Cr-Commit-Position: refs/heads/main@{#1298807} > > Bug: 293383734 > Change-Id: I182736b58e83dbe7fc2c5fc7e20a3e3f909772a2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526425 > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > Cr-Commit-Position: refs/heads/main@{#1298902} Bug: 293383734 Change-Id: Ia501a6d9d06e72038b14b656c95f465cef373ad4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5886697 Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> Reviewed-by: mmenke <mmenke@chromium.org> Reviewed-by: Orr Bernstein <orrb@google.com> Cr-Commit-Position: refs/heads/main@{#1362382}
This change does not change the tests themselves but how we register service workers. Previously a page reload was needed in order to make get the service worker activated. This worked fine and passed all the chrome wpts, but not on firefox see here: https://github.com/web-platform-tests/wpt/runs/24793731783. This new change uses a different technique that is used by some tests in the wpt/service-workers/ directory. Specifically, changes to the registration include: - unregister all service workers before the tests start. - service workers, once activated, will use 'clients.claim()' so that clients loaded in the same scope do not need to be reloaded before their fetches will go through this service worker. (https://developer.mozilla.org/en-US/docs/Web/API/Clients/claim) - wait for the service worker to be activated AND wait for the service worker to be controlling the page (which seems to be a common problem: w3c/ServiceWorker#799 ) This reverts commit eba96feb09f5ed94a093d012956bae1dc72cb486. Reason for revert: Changed the way we register SW, see above. Original change's description: > Revert "Reland "Reland "Service worker web platform tests.""" > > This reverts commit 9bd67ed90e90d6a2c2134d26bb8bcc4cd9436b19. > > Reason for revert: Failing in some cases. > > Original change's description: > > Reland "Reland "Service worker web platform tests."" > > > > This reverts commit 93a580699ecf6d102a5853455b5faeceea4cd31e. > > > > Reason for revert: Removed the test case that times out, > > (the one that waits for the update url). > > > > Original change's description: > > > Revert "Reland "Service worker web platform tests."" > > > > > > This reverts commit 436f1b9f6153002fd41599d5d4ec8343cf930a43. > > > > > > Reason for revert: There are still timeouts in some tests > > > > > > Original change's description: > > > > Reland "Service worker web platform tests." > > > > > > > > This reverts commit 36a1c457dac0ecaa54c0553b28f67c0c61752494. > > > > > > > > Reason for revert: The test that looks for 'update-url.py' takes too long and therefore will require this test file to be part of slowTests > > > > > > > > Original change's description: > > > > > Revert "Service worker web platform tests." > > > > > > > > > > This reverts commit 63858f1b1ed058d07e73cebb0a98214aa2cfc715. > > > > > > > > > > Reason for revert: New test added; fails immediately on some bots. > > > > > > > > > > See > > > > > https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests/38089/overview > > > > > for the first failures. (And consistently in subsequent builds) > > > > > > > > > > Original change's description: > > > > > > Service worker web platform tests. > > > > > > > > > > > > This tests that when an auction is ran, service workers do not intercept requests with URLs that are meant to be private. > > > > > > > > > > > > > > > > > > Bug: 293383734 > > > > > > Change-Id: I06858f7cae4794a35c045fb8dad30d6316a26ead > > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459094 > > > > > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > > > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > > > > Reviewed-by: Orr Bernstein <orrb@google.com> > > > > > > Cr-Commit-Position: refs/heads/main@{#1294960} > > > > > > > > > > Bug: 293383734 > > > > > Change-Id: I3431f0e45e65767ff1529002d8a2d14657d0cb5a > > > > > No-Presubmit: true > > > > > No-Tree-Checks: true > > > > > No-Try: true > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5506634 > > > > > Auto-Submit: Ian Clelland <iclelland@chromium.org> > > > > > Owners-Override: Ian Clelland <iclelland@chromium.org> > > > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Cr-Commit-Position: refs/heads/main@{#1295015} > > > > > > > > Bug: 293383734 > > > > Change-Id: I762dd50282f99617796df64d73a27d149cac0a86 > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5512083 > > > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > Reviewed-by: Orr Bernstein <orrb@google.com> > > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > > Cr-Commit-Position: refs/heads/main@{#1296948} > > > > > > Bug: 293383734 > > > Change-Id: I9b06c0453656aaa448d0030960a48fc264bcf867 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5515623 > > > Auto-Submit: Youssef Bourouphael <ybourouphael@google.com> > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Commit-Queue: mmenke <mmenke@chromium.org> > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Cr-Commit-Position: refs/heads/main@{#1297048} > > > > Bug: 293383734 > > Change-Id: I7ae169c2750432bb1cb9c1c340585dc27d8cd419 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5521778 > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > Reviewed-by: mmenke <mmenke@chromium.org> > > Reviewed-by: Orr Bernstein <orrb@google.com> > > Cr-Commit-Position: refs/heads/main@{#1298807} > > Bug: 293383734 > Change-Id: I182736b58e83dbe7fc2c5fc7e20a3e3f909772a2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526425 > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > Cr-Commit-Position: refs/heads/main@{#1298902} Bug: 293383734 Change-Id: Ia501a6d9d06e72038b14b656c95f465cef373ad4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5886697 Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> Reviewed-by: mmenke <mmenke@chromium.org> Reviewed-by: Orr Bernstein <orrb@google.com> Cr-Commit-Position: refs/heads/main@{#1362382}
…eb platform tests.""", a=testonly Automatic update from web-platform-tests Reland "Reland "Reland "Service worker web platform tests.""" This change does not change the tests themselves but how we register service workers. Previously a page reload was needed in order to make get the service worker activated. This worked fine and passed all the chrome wpts, but not on firefox see here: https://github.com/web-platform-tests/wpt/runs/24793731783. This new change uses a different technique that is used by some tests in the wpt/service-workers/ directory. Specifically, changes to the registration include: - unregister all service workers before the tests start. - service workers, once activated, will use 'clients.claim()' so that clients loaded in the same scope do not need to be reloaded before their fetches will go through this service worker. (https://developer.mozilla.org/en-US/docs/Web/API/Clients/claim) - wait for the service worker to be activated AND wait for the service worker to be controlling the page (which seems to be a common problem: w3c/ServiceWorker#799 ) This reverts commit eba96feb09f5ed94a093d012956bae1dc72cb486. Reason for revert: Changed the way we register SW, see above. Original change's description: > Revert "Reland "Reland "Service worker web platform tests.""" > > This reverts commit 9bd67ed90e90d6a2c2134d26bb8bcc4cd9436b19. > > Reason for revert: Failing in some cases. > > Original change's description: > > Reland "Reland "Service worker web platform tests."" > > > > This reverts commit 93a580699ecf6d102a5853455b5faeceea4cd31e. > > > > Reason for revert: Removed the test case that times out, > > (the one that waits for the update url). > > > > Original change's description: > > > Revert "Reland "Service worker web platform tests."" > > > > > > This reverts commit 436f1b9f6153002fd41599d5d4ec8343cf930a43. > > > > > > Reason for revert: There are still timeouts in some tests > > > > > > Original change's description: > > > > Reland "Service worker web platform tests." > > > > > > > > This reverts commit 36a1c457dac0ecaa54c0553b28f67c0c61752494. > > > > > > > > Reason for revert: The test that looks for 'update-url.py' takes too long and therefore will require this test file to be part of slowTests > > > > > > > > Original change's description: > > > > > Revert "Service worker web platform tests." > > > > > > > > > > This reverts commit 63858f1b1ed058d07e73cebb0a98214aa2cfc715. > > > > > > > > > > Reason for revert: New test added; fails immediately on some bots. > > > > > > > > > > See > > > > > https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests/38089/overview > > > > > for the first failures. (And consistently in subsequent builds) > > > > > > > > > > Original change's description: > > > > > > Service worker web platform tests. > > > > > > > > > > > > This tests that when an auction is ran, service workers do not intercept requests with URLs that are meant to be private. > > > > > > > > > > > > > > > > > > Bug: 293383734 > > > > > > Change-Id: I06858f7cae4794a35c045fb8dad30d6316a26ead > > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459094 > > > > > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > > > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > > > > Reviewed-by: Orr Bernstein <orrb@google.com> > > > > > > Cr-Commit-Position: refs/heads/main@{#1294960} > > > > > > > > > > Bug: 293383734 > > > > > Change-Id: I3431f0e45e65767ff1529002d8a2d14657d0cb5a > > > > > No-Presubmit: true > > > > > No-Tree-Checks: true > > > > > No-Try: true > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5506634 > > > > > Auto-Submit: Ian Clelland <iclelland@chromium.org> > > > > > Owners-Override: Ian Clelland <iclelland@chromium.org> > > > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Cr-Commit-Position: refs/heads/main@{#1295015} > > > > > > > > Bug: 293383734 > > > > Change-Id: I762dd50282f99617796df64d73a27d149cac0a86 > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5512083 > > > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > Reviewed-by: Orr Bernstein <orrb@google.com> > > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > > Cr-Commit-Position: refs/heads/main@{#1296948} > > > > > > Bug: 293383734 > > > Change-Id: I9b06c0453656aaa448d0030960a48fc264bcf867 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5515623 > > > Auto-Submit: Youssef Bourouphael <ybourouphael@google.com> > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Commit-Queue: mmenke <mmenke@chromium.org> > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Cr-Commit-Position: refs/heads/main@{#1297048} > > > > Bug: 293383734 > > Change-Id: I7ae169c2750432bb1cb9c1c340585dc27d8cd419 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5521778 > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > Reviewed-by: mmenke <mmenke@chromium.org> > > Reviewed-by: Orr Bernstein <orrb@google.com> > > Cr-Commit-Position: refs/heads/main@{#1298807} > > Bug: 293383734 > Change-Id: I182736b58e83dbe7fc2c5fc7e20a3e3f909772a2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526425 > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > Cr-Commit-Position: refs/heads/main@{#1298902} Bug: 293383734 Change-Id: Ia501a6d9d06e72038b14b656c95f465cef373ad4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5886697 Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> Reviewed-by: mmenke <mmenke@chromium.org> Reviewed-by: Orr Bernstein <orrb@google.com> Cr-Commit-Position: refs/heads/main@{#1362382} -- wpt-commits: 840c572f14cce3073596ae471decbf9b3d56b4f9 wpt-pr: 48395
…eb platform tests.""", a=testonly Automatic update from web-platform-tests Reland "Reland "Reland "Service worker web platform tests.""" This change does not change the tests themselves but how we register service workers. Previously a page reload was needed in order to make get the service worker activated. This worked fine and passed all the chrome wpts, but not on firefox see here: https://github.com/web-platform-tests/wpt/runs/24793731783. This new change uses a different technique that is used by some tests in the wpt/service-workers/ directory. Specifically, changes to the registration include: - unregister all service workers before the tests start. - service workers, once activated, will use 'clients.claim()' so that clients loaded in the same scope do not need to be reloaded before their fetches will go through this service worker. (https://developer.mozilla.org/en-US/docs/Web/API/Clients/claim) - wait for the service worker to be activated AND wait for the service worker to be controlling the page (which seems to be a common problem: w3c/ServiceWorker#799 ) This reverts commit eba96feb09f5ed94a093d012956bae1dc72cb486. Reason for revert: Changed the way we register SW, see above. Original change's description: > Revert "Reland "Reland "Service worker web platform tests.""" > > This reverts commit 9bd67ed90e90d6a2c2134d26bb8bcc4cd9436b19. > > Reason for revert: Failing in some cases. > > Original change's description: > > Reland "Reland "Service worker web platform tests."" > > > > This reverts commit 93a580699ecf6d102a5853455b5faeceea4cd31e. > > > > Reason for revert: Removed the test case that times out, > > (the one that waits for the update url). > > > > Original change's description: > > > Revert "Reland "Service worker web platform tests."" > > > > > > This reverts commit 436f1b9f6153002fd41599d5d4ec8343cf930a43. > > > > > > Reason for revert: There are still timeouts in some tests > > > > > > Original change's description: > > > > Reland "Service worker web platform tests." > > > > > > > > This reverts commit 36a1c457dac0ecaa54c0553b28f67c0c61752494. > > > > > > > > Reason for revert: The test that looks for 'update-url.py' takes too long and therefore will require this test file to be part of slowTests > > > > > > > > Original change's description: > > > > > Revert "Service worker web platform tests." > > > > > > > > > > This reverts commit 63858f1b1ed058d07e73cebb0a98214aa2cfc715. > > > > > > > > > > Reason for revert: New test added; fails immediately on some bots. > > > > > > > > > > See > > > > > https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests/38089/overview > > > > > for the first failures. (And consistently in subsequent builds) > > > > > > > > > > Original change's description: > > > > > > Service worker web platform tests. > > > > > > > > > > > > This tests that when an auction is ran, service workers do not intercept requests with URLs that are meant to be private. > > > > > > > > > > > > > > > > > > Bug: 293383734 > > > > > > Change-Id: I06858f7cae4794a35c045fb8dad30d6316a26ead > > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459094 > > > > > > Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> > > > > > > Reviewed-by: mmenke <mmenkechromium.org> > > > > > > Reviewed-by: Orr Bernstein <orrbgoogle.com> > > > > > > Cr-Commit-Position: refs/heads/main{#1294960} > > > > > > > > > > Bug: 293383734 > > > > > Change-Id: I3431f0e45e65767ff1529002d8a2d14657d0cb5a > > > > > No-Presubmit: true > > > > > No-Tree-Checks: true > > > > > No-Try: true > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5506634 > > > > > Auto-Submit: Ian Clelland <iclellandchromium.org> > > > > > Owners-Override: Ian Clelland <iclellandchromium.org> > > > > > Commit-Queue: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > > > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > > > Cr-Commit-Position: refs/heads/main{#1295015} > > > > > > > > Bug: 293383734 > > > > Change-Id: I762dd50282f99617796df64d73a27d149cac0a86 > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5512083 > > > > Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> > > > > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > > Reviewed-by: Orr Bernstein <orrbgoogle.com> > > > > Reviewed-by: mmenke <mmenkechromium.org> > > > > Cr-Commit-Position: refs/heads/main{#1296948} > > > > > > Bug: 293383734 > > > Change-Id: I9b06c0453656aaa448d0030960a48fc264bcf867 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5515623 > > > Auto-Submit: Youssef Bourouphael <ybourouphaelgoogle.com> > > > Commit-Queue: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > Commit-Queue: mmenke <mmenkechromium.org> > > > Reviewed-by: mmenke <mmenkechromium.org> > > > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > Cr-Commit-Position: refs/heads/main{#1297048} > > > > Bug: 293383734 > > Change-Id: I7ae169c2750432bb1cb9c1c340585dc27d8cd419 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5521778 > > Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> > > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > Reviewed-by: mmenke <mmenkechromium.org> > > Reviewed-by: Orr Bernstein <orrbgoogle.com> > > Cr-Commit-Position: refs/heads/main{#1298807} > > Bug: 293383734 > Change-Id: I182736b58e83dbe7fc2c5fc7e20a3e3f909772a2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526425 > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> > Cr-Commit-Position: refs/heads/main{#1298902} Bug: 293383734 Change-Id: Ia501a6d9d06e72038b14b656c95f465cef373ad4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5886697 Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> Reviewed-by: mmenke <mmenkechromium.org> Reviewed-by: Orr Bernstein <orrbgoogle.com> Cr-Commit-Position: refs/heads/main{#1362382} -- wpt-commits: 840c572f14cce3073596ae471decbf9b3d56b4f9 wpt-pr: 48395 UltraBlame original commit: b94874d93c265d012764bfe9477083901c19bf05
…eb platform tests.""", a=testonly Automatic update from web-platform-tests Reland "Reland "Reland "Service worker web platform tests.""" This change does not change the tests themselves but how we register service workers. Previously a page reload was needed in order to make get the service worker activated. This worked fine and passed all the chrome wpts, but not on firefox see here: https://github.com/web-platform-tests/wpt/runs/24793731783. This new change uses a different technique that is used by some tests in the wpt/service-workers/ directory. Specifically, changes to the registration include: - unregister all service workers before the tests start. - service workers, once activated, will use 'clients.claim()' so that clients loaded in the same scope do not need to be reloaded before their fetches will go through this service worker. (https://developer.mozilla.org/en-US/docs/Web/API/Clients/claim) - wait for the service worker to be activated AND wait for the service worker to be controlling the page (which seems to be a common problem: w3c/ServiceWorker#799 ) This reverts commit eba96feb09f5ed94a093d012956bae1dc72cb486. Reason for revert: Changed the way we register SW, see above. Original change's description: > Revert "Reland "Reland "Service worker web platform tests.""" > > This reverts commit 9bd67ed90e90d6a2c2134d26bb8bcc4cd9436b19. > > Reason for revert: Failing in some cases. > > Original change's description: > > Reland "Reland "Service worker web platform tests."" > > > > This reverts commit 93a580699ecf6d102a5853455b5faeceea4cd31e. > > > > Reason for revert: Removed the test case that times out, > > (the one that waits for the update url). > > > > Original change's description: > > > Revert "Reland "Service worker web platform tests."" > > > > > > This reverts commit 436f1b9f6153002fd41599d5d4ec8343cf930a43. > > > > > > Reason for revert: There are still timeouts in some tests > > > > > > Original change's description: > > > > Reland "Service worker web platform tests." > > > > > > > > This reverts commit 36a1c457dac0ecaa54c0553b28f67c0c61752494. > > > > > > > > Reason for revert: The test that looks for 'update-url.py' takes too long and therefore will require this test file to be part of slowTests > > > > > > > > Original change's description: > > > > > Revert "Service worker web platform tests." > > > > > > > > > > This reverts commit 63858f1b1ed058d07e73cebb0a98214aa2cfc715. > > > > > > > > > > Reason for revert: New test added; fails immediately on some bots. > > > > > > > > > > See > > > > > https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests/38089/overview > > > > > for the first failures. (And consistently in subsequent builds) > > > > > > > > > > Original change's description: > > > > > > Service worker web platform tests. > > > > > > > > > > > > This tests that when an auction is ran, service workers do not intercept requests with URLs that are meant to be private. > > > > > > > > > > > > > > > > > > Bug: 293383734 > > > > > > Change-Id: I06858f7cae4794a35c045fb8dad30d6316a26ead > > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459094 > > > > > > Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> > > > > > > Reviewed-by: mmenke <mmenkechromium.org> > > > > > > Reviewed-by: Orr Bernstein <orrbgoogle.com> > > > > > > Cr-Commit-Position: refs/heads/main{#1294960} > > > > > > > > > > Bug: 293383734 > > > > > Change-Id: I3431f0e45e65767ff1529002d8a2d14657d0cb5a > > > > > No-Presubmit: true > > > > > No-Tree-Checks: true > > > > > No-Try: true > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5506634 > > > > > Auto-Submit: Ian Clelland <iclellandchromium.org> > > > > > Owners-Override: Ian Clelland <iclellandchromium.org> > > > > > Commit-Queue: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > > > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > > > Cr-Commit-Position: refs/heads/main{#1295015} > > > > > > > > Bug: 293383734 > > > > Change-Id: I762dd50282f99617796df64d73a27d149cac0a86 > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5512083 > > > > Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> > > > > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > > Reviewed-by: Orr Bernstein <orrbgoogle.com> > > > > Reviewed-by: mmenke <mmenkechromium.org> > > > > Cr-Commit-Position: refs/heads/main{#1296948} > > > > > > Bug: 293383734 > > > Change-Id: I9b06c0453656aaa448d0030960a48fc264bcf867 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5515623 > > > Auto-Submit: Youssef Bourouphael <ybourouphaelgoogle.com> > > > Commit-Queue: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > Commit-Queue: mmenke <mmenkechromium.org> > > > Reviewed-by: mmenke <mmenkechromium.org> > > > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > Cr-Commit-Position: refs/heads/main{#1297048} > > > > Bug: 293383734 > > Change-Id: I7ae169c2750432bb1cb9c1c340585dc27d8cd419 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5521778 > > Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> > > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > Reviewed-by: mmenke <mmenkechromium.org> > > Reviewed-by: Orr Bernstein <orrbgoogle.com> > > Cr-Commit-Position: refs/heads/main{#1298807} > > Bug: 293383734 > Change-Id: I182736b58e83dbe7fc2c5fc7e20a3e3f909772a2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526425 > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> > Cr-Commit-Position: refs/heads/main{#1298902} Bug: 293383734 Change-Id: Ia501a6d9d06e72038b14b656c95f465cef373ad4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5886697 Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> Reviewed-by: mmenke <mmenkechromium.org> Reviewed-by: Orr Bernstein <orrbgoogle.com> Cr-Commit-Position: refs/heads/main{#1362382} -- wpt-commits: 840c572f14cce3073596ae471decbf9b3d56b4f9 wpt-pr: 48395 UltraBlame original commit: b94874d93c265d012764bfe9477083901c19bf05
…eb platform tests.""", a=testonly Automatic update from web-platform-tests Reland "Reland "Reland "Service worker web platform tests.""" This change does not change the tests themselves but how we register service workers. Previously a page reload was needed in order to make get the service worker activated. This worked fine and passed all the chrome wpts, but not on firefox see here: https://github.com/web-platform-tests/wpt/runs/24793731783. This new change uses a different technique that is used by some tests in the wpt/service-workers/ directory. Specifically, changes to the registration include: - unregister all service workers before the tests start. - service workers, once activated, will use 'clients.claim()' so that clients loaded in the same scope do not need to be reloaded before their fetches will go through this service worker. (https://developer.mozilla.org/en-US/docs/Web/API/Clients/claim) - wait for the service worker to be activated AND wait for the service worker to be controlling the page (which seems to be a common problem: w3c/ServiceWorker#799 ) This reverts commit eba96feb09f5ed94a093d012956bae1dc72cb486. Reason for revert: Changed the way we register SW, see above. Original change's description: > Revert "Reland "Reland "Service worker web platform tests.""" > > This reverts commit 9bd67ed90e90d6a2c2134d26bb8bcc4cd9436b19. > > Reason for revert: Failing in some cases. > > Original change's description: > > Reland "Reland "Service worker web platform tests."" > > > > This reverts commit 93a580699ecf6d102a5853455b5faeceea4cd31e. > > > > Reason for revert: Removed the test case that times out, > > (the one that waits for the update url). > > > > Original change's description: > > > Revert "Reland "Service worker web platform tests."" > > > > > > This reverts commit 436f1b9f6153002fd41599d5d4ec8343cf930a43. > > > > > > Reason for revert: There are still timeouts in some tests > > > > > > Original change's description: > > > > Reland "Service worker web platform tests." > > > > > > > > This reverts commit 36a1c457dac0ecaa54c0553b28f67c0c61752494. > > > > > > > > Reason for revert: The test that looks for 'update-url.py' takes too long and therefore will require this test file to be part of slowTests > > > > > > > > Original change's description: > > > > > Revert "Service worker web platform tests." > > > > > > > > > > This reverts commit 63858f1b1ed058d07e73cebb0a98214aa2cfc715. > > > > > > > > > > Reason for revert: New test added; fails immediately on some bots. > > > > > > > > > > See > > > > > https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests/38089/overview > > > > > for the first failures. (And consistently in subsequent builds) > > > > > > > > > > Original change's description: > > > > > > Service worker web platform tests. > > > > > > > > > > > > This tests that when an auction is ran, service workers do not intercept requests with URLs that are meant to be private. > > > > > > > > > > > > > > > > > > Bug: 293383734 > > > > > > Change-Id: I06858f7cae4794a35c045fb8dad30d6316a26ead > > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459094 > > > > > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > > > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > > > > Reviewed-by: Orr Bernstein <orrb@google.com> > > > > > > Cr-Commit-Position: refs/heads/main@{#1294960} > > > > > > > > > > Bug: 293383734 > > > > > Change-Id: I3431f0e45e65767ff1529002d8a2d14657d0cb5a > > > > > No-Presubmit: true > > > > > No-Tree-Checks: true > > > > > No-Try: true > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5506634 > > > > > Auto-Submit: Ian Clelland <iclelland@chromium.org> > > > > > Owners-Override: Ian Clelland <iclelland@chromium.org> > > > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Cr-Commit-Position: refs/heads/main@{#1295015} > > > > > > > > Bug: 293383734 > > > > Change-Id: I762dd50282f99617796df64d73a27d149cac0a86 > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5512083 > > > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > Reviewed-by: Orr Bernstein <orrb@google.com> > > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > > Cr-Commit-Position: refs/heads/main@{#1296948} > > > > > > Bug: 293383734 > > > Change-Id: I9b06c0453656aaa448d0030960a48fc264bcf867 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5515623 > > > Auto-Submit: Youssef Bourouphael <ybourouphael@google.com> > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Commit-Queue: mmenke <mmenke@chromium.org> > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Cr-Commit-Position: refs/heads/main@{#1297048} > > > > Bug: 293383734 > > Change-Id: I7ae169c2750432bb1cb9c1c340585dc27d8cd419 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5521778 > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > Reviewed-by: mmenke <mmenke@chromium.org> > > Reviewed-by: Orr Bernstein <orrb@google.com> > > Cr-Commit-Position: refs/heads/main@{#1298807} > > Bug: 293383734 > Change-Id: I182736b58e83dbe7fc2c5fc7e20a3e3f909772a2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526425 > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > Cr-Commit-Position: refs/heads/main@{#1298902} Bug: 293383734 Change-Id: Ia501a6d9d06e72038b14b656c95f465cef373ad4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5886697 Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> Reviewed-by: mmenke <mmenke@chromium.org> Reviewed-by: Orr Bernstein <orrb@google.com> Cr-Commit-Position: refs/heads/main@{#1362382} -- wpt-commits: 840c572f14cce3073596ae471decbf9b3d56b4f9 wpt-pr: 48395
…eb platform tests.""", a=testonly Automatic update from web-platform-tests Reland "Reland "Reland "Service worker web platform tests.""" This change does not change the tests themselves but how we register service workers. Previously a page reload was needed in order to make get the service worker activated. This worked fine and passed all the chrome wpts, but not on firefox see here: https://github.com/web-platform-tests/wpt/runs/24793731783. This new change uses a different technique that is used by some tests in the wpt/service-workers/ directory. Specifically, changes to the registration include: - unregister all service workers before the tests start. - service workers, once activated, will use 'clients.claim()' so that clients loaded in the same scope do not need to be reloaded before their fetches will go through this service worker. (https://developer.mozilla.org/en-US/docs/Web/API/Clients/claim) - wait for the service worker to be activated AND wait for the service worker to be controlling the page (which seems to be a common problem: w3c/ServiceWorker#799 ) This reverts commit eba96feb09f5ed94a093d012956bae1dc72cb486. Reason for revert: Changed the way we register SW, see above. Original change's description: > Revert "Reland "Reland "Service worker web platform tests.""" > > This reverts commit 9bd67ed90e90d6a2c2134d26bb8bcc4cd9436b19. > > Reason for revert: Failing in some cases. > > Original change's description: > > Reland "Reland "Service worker web platform tests."" > > > > This reverts commit 93a580699ecf6d102a5853455b5faeceea4cd31e. > > > > Reason for revert: Removed the test case that times out, > > (the one that waits for the update url). > > > > Original change's description: > > > Revert "Reland "Service worker web platform tests."" > > > > > > This reverts commit 436f1b9f6153002fd41599d5d4ec8343cf930a43. > > > > > > Reason for revert: There are still timeouts in some tests > > > > > > Original change's description: > > > > Reland "Service worker web platform tests." > > > > > > > > This reverts commit 36a1c457dac0ecaa54c0553b28f67c0c61752494. > > > > > > > > Reason for revert: The test that looks for 'update-url.py' takes too long and therefore will require this test file to be part of slowTests > > > > > > > > Original change's description: > > > > > Revert "Service worker web platform tests." > > > > > > > > > > This reverts commit 63858f1b1ed058d07e73cebb0a98214aa2cfc715. > > > > > > > > > > Reason for revert: New test added; fails immediately on some bots. > > > > > > > > > > See > > > > > https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests/38089/overview > > > > > for the first failures. (And consistently in subsequent builds) > > > > > > > > > > Original change's description: > > > > > > Service worker web platform tests. > > > > > > > > > > > > This tests that when an auction is ran, service workers do not intercept requests with URLs that are meant to be private. > > > > > > > > > > > > > > > > > > Bug: 293383734 > > > > > > Change-Id: I06858f7cae4794a35c045fb8dad30d6316a26ead > > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459094 > > > > > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > > > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > > > > Reviewed-by: Orr Bernstein <orrb@google.com> > > > > > > Cr-Commit-Position: refs/heads/main@{#1294960} > > > > > > > > > > Bug: 293383734 > > > > > Change-Id: I3431f0e45e65767ff1529002d8a2d14657d0cb5a > > > > > No-Presubmit: true > > > > > No-Tree-Checks: true > > > > > No-Try: true > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5506634 > > > > > Auto-Submit: Ian Clelland <iclelland@chromium.org> > > > > > Owners-Override: Ian Clelland <iclelland@chromium.org> > > > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > > Cr-Commit-Position: refs/heads/main@{#1295015} > > > > > > > > Bug: 293383734 > > > > Change-Id: I762dd50282f99617796df64d73a27d149cac0a86 > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5512083 > > > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > > Reviewed-by: Orr Bernstein <orrb@google.com> > > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > > Cr-Commit-Position: refs/heads/main@{#1296948} > > > > > > Bug: 293383734 > > > Change-Id: I9b06c0453656aaa448d0030960a48fc264bcf867 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5515623 > > > Auto-Submit: Youssef Bourouphael <ybourouphael@google.com> > > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Commit-Queue: mmenke <mmenke@chromium.org> > > > Reviewed-by: mmenke <mmenke@chromium.org> > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Cr-Commit-Position: refs/heads/main@{#1297048} > > > > Bug: 293383734 > > Change-Id: I7ae169c2750432bb1cb9c1c340585dc27d8cd419 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5521778 > > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > Reviewed-by: mmenke <mmenke@chromium.org> > > Reviewed-by: Orr Bernstein <orrb@google.com> > > Cr-Commit-Position: refs/heads/main@{#1298807} > > Bug: 293383734 > Change-Id: I182736b58e83dbe7fc2c5fc7e20a3e3f909772a2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526425 > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> > Cr-Commit-Position: refs/heads/main@{#1298902} Bug: 293383734 Change-Id: Ia501a6d9d06e72038b14b656c95f465cef373ad4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5886697 Commit-Queue: Youssef Bourouphael <ybourouphael@google.com> Reviewed-by: mmenke <mmenke@chromium.org> Reviewed-by: Orr Bernstein <orrb@google.com> Cr-Commit-Position: refs/heads/main@{#1362382} -- wpt-commits: 840c572f14cce3073596ae471decbf9b3d56b4f9 wpt-pr: 48395
…eb platform tests.""", a=testonly Automatic update from web-platform-tests Reland "Reland "Reland "Service worker web platform tests.""" This change does not change the tests themselves but how we register service workers. Previously a page reload was needed in order to make get the service worker activated. This worked fine and passed all the chrome wpts, but not on firefox see here: https://github.com/web-platform-tests/wpt/runs/24793731783. This new change uses a different technique that is used by some tests in the wpt/service-workers/ directory. Specifically, changes to the registration include: - unregister all service workers before the tests start. - service workers, once activated, will use 'clients.claim()' so that clients loaded in the same scope do not need to be reloaded before their fetches will go through this service worker. (https://developer.mozilla.org/en-US/docs/Web/API/Clients/claim) - wait for the service worker to be activated AND wait for the service worker to be controlling the page (which seems to be a common problem: w3c/ServiceWorker#799 ) This reverts commit eba96feb09f5ed94a093d012956bae1dc72cb486. Reason for revert: Changed the way we register SW, see above. Original change's description: > Revert "Reland "Reland "Service worker web platform tests.""" > > This reverts commit 9bd67ed90e90d6a2c2134d26bb8bcc4cd9436b19. > > Reason for revert: Failing in some cases. > > Original change's description: > > Reland "Reland "Service worker web platform tests."" > > > > This reverts commit 93a580699ecf6d102a5853455b5faeceea4cd31e. > > > > Reason for revert: Removed the test case that times out, > > (the one that waits for the update url). > > > > Original change's description: > > > Revert "Reland "Service worker web platform tests."" > > > > > > This reverts commit 436f1b9f6153002fd41599d5d4ec8343cf930a43. > > > > > > Reason for revert: There are still timeouts in some tests > > > > > > Original change's description: > > > > Reland "Service worker web platform tests." > > > > > > > > This reverts commit 36a1c457dac0ecaa54c0553b28f67c0c61752494. > > > > > > > > Reason for revert: The test that looks for 'update-url.py' takes too long and therefore will require this test file to be part of slowTests > > > > > > > > Original change's description: > > > > > Revert "Service worker web platform tests." > > > > > > > > > > This reverts commit 63858f1b1ed058d07e73cebb0a98214aa2cfc715. > > > > > > > > > > Reason for revert: New test added; fails immediately on some bots. > > > > > > > > > > See > > > > > https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests/38089/overview > > > > > for the first failures. (And consistently in subsequent builds) > > > > > > > > > > Original change's description: > > > > > > Service worker web platform tests. > > > > > > > > > > > > This tests that when an auction is ran, service workers do not intercept requests with URLs that are meant to be private. > > > > > > > > > > > > > > > > > > Bug: 293383734 > > > > > > Change-Id: I06858f7cae4794a35c045fb8dad30d6316a26ead > > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459094 > > > > > > Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> > > > > > > Reviewed-by: mmenke <mmenkechromium.org> > > > > > > Reviewed-by: Orr Bernstein <orrbgoogle.com> > > > > > > Cr-Commit-Position: refs/heads/main{#1294960} > > > > > > > > > > Bug: 293383734 > > > > > Change-Id: I3431f0e45e65767ff1529002d8a2d14657d0cb5a > > > > > No-Presubmit: true > > > > > No-Tree-Checks: true > > > > > No-Try: true > > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5506634 > > > > > Auto-Submit: Ian Clelland <iclellandchromium.org> > > > > > Owners-Override: Ian Clelland <iclellandchromium.org> > > > > > Commit-Queue: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > > > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > > > Cr-Commit-Position: refs/heads/main{#1295015} > > > > > > > > Bug: 293383734 > > > > Change-Id: I762dd50282f99617796df64d73a27d149cac0a86 > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5512083 > > > > Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> > > > > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > > Reviewed-by: Orr Bernstein <orrbgoogle.com> > > > > Reviewed-by: mmenke <mmenkechromium.org> > > > > Cr-Commit-Position: refs/heads/main{#1296948} > > > > > > Bug: 293383734 > > > Change-Id: I9b06c0453656aaa448d0030960a48fc264bcf867 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5515623 > > > Auto-Submit: Youssef Bourouphael <ybourouphaelgoogle.com> > > > Commit-Queue: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > Commit-Queue: mmenke <mmenkechromium.org> > > > Reviewed-by: mmenke <mmenkechromium.org> > > > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > > Cr-Commit-Position: refs/heads/main{#1297048} > > > > Bug: 293383734 > > Change-Id: I7ae169c2750432bb1cb9c1c340585dc27d8cd419 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5521778 > > Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> > > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > > Reviewed-by: mmenke <mmenkechromium.org> > > Reviewed-by: Orr Bernstein <orrbgoogle.com> > > Cr-Commit-Position: refs/heads/main{#1298807} > > Bug: 293383734 > Change-Id: I182736b58e83dbe7fc2c5fc7e20a3e3f909772a2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526425 > Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> > Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> > Cr-Commit-Position: refs/heads/main{#1298902} Bug: 293383734 Change-Id: Ia501a6d9d06e72038b14b656c95f465cef373ad4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5886697 Commit-Queue: Youssef Bourouphael <ybourouphaelgoogle.com> Reviewed-by: mmenke <mmenkechromium.org> Reviewed-by: Orr Bernstein <orrbgoogle.com> Cr-Commit-Position: refs/heads/main{#1362382} -- wpt-commits: 840c572f14cce3073596ae471decbf9b3d56b4f9 wpt-pr: 48395 UltraBlame original commit: b94874d93c265d012764bfe9477083901c19bf05
In the following sample code (live version), I ended up making a wrong assumption that might catch other developers by surprise:
Excerpt from
index.html
:sw.js
:The assumption I had was that, by virtue of waiting on
clients.claim()
inside the SW'sactivate
handler, the page will end up being controlled once.ready
resolves. However, that's apparently a bad assumption, because the spec forclients.claim()
states that the promise doesn't wait before resolving.Is there any appetite for changing the behavior of
clients.claim()
so that the promise it returned waits until all the controller changes have taken place before it resolves? That would allowevent.waitUntil(self.clients.claim())
within anactivate
handler to have the effect that I assumed it had, and it would by extension make the.ready
promise more useful.The text was updated successfully, but these errors were encountered: