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
[WIP] Revert "Infra: remove old service worker code from testharness.js" #22086
Conversation
What's the plan with this one? |
This reverts commit d7032c0.
Fantastic question. I was 100% sure that I had run a trigger run on Chrome with this, but it seems like I didn't. So I'm starting with that, and if it shows the same (well, the inverse) results as #21162 (comment) I'm going to investigate those further on the Chromium side (maybe pull in the worker folks to ask). |
7b1dd67
to
0d1ba1e
Compare
https://wpt.fyi/results/?diff&filter=ADC&run_id=455690005&run_id=480270002 should be the diff. Some flakes, as expected, but the cc @nhiroki who I believe is on the Chromium service worker team. Hiroki - this PR is about some old Chrome-specific code that was in testharness.js, which mentioned a problem with 'Blink setting MessageEvent.source to null for messages sent via ServiceWorker.postMessage()'. That code was removed in #21162 but I noticed a few possible regressions in service-worker tests in Chromium, and was trying to figure out if the code was therefore still needed. Do you have any context here, or understand the comment in the removed code? |
This should already be supported in Blink (https://crbug.com/543198). I guess that the original PR needs more work. In the original code,
Looks like some tests still depend on the transferre port instead of the |
@stephenmcgruer @annevk I'll make a patch to fix this (chromium issue). |
[edited] I understand the root cause. The failing tests use an inner frame's service worker object's In addition, we could remove the leftover in if (event.ports && event.ports[0]) {
// If a MessageChannel was passed, then use it to
// send results back to the main window. This
// allows the tests to work even if the browser
// does not fully support MessageEvent.source in
// ServiceWorkers yet.
this_obj._add_message_port(event.ports[0]);
event.ports[0].start();
} else {
// If there is no MessageChannel, then attempt to
// use the MessageEvent.source to send results
// back to the main window.
this_obj._add_message_port(event.source);
} |
Let me elaborate on this more because this is hidden in The failing tests use I think this should be fixed in the tests, not in testharness.js. I'll make a fix. |
Thanks @stephenmcgruer and @nhiroki for dealing with this in such a thoughtful manner! Glad to see |
This CL fixes timeout on client-navigate.https.html, and removes unused code in testharness.js. This change is a follow-up for: [1] #21162 [2] #22086 After the change [1], fetch_tests_from_workers() helper uses ExtendableMessageEvent.source instead of MessageChannel to communicate between a window and a service worker. This change works well for most of cases, but fails some tests. The fetch_tests_from_workers() helper takes a service worker object to post a "connect" message to the worker, and then passes the worker object to RemoteContext in testharness.js. RemoteContext adds an onmessage event handler on self.navigator.serviceWorker. This works well as long as the given worker object is associated with `self`. However, these failing tests pass the worker object associated with the inner frame to the helper. In this case, the helper uses an inner frame's service worker object for postMessage(), while the helper waits on the main frame's navigator.serviceWorker.onmessage. Consequently event.source is the inner frame, and a reply from the service worker is dispatched on the inner frame's navigator.serviceWorker.onmessage. This results in timeout. To fix this, this CL makes the main frame pass its own service worker object instead of the inner frame's service worker object. Those objects should be equal other than associated contexts, and this change doesn't affect what the tests verify. Bug: 1057682 Change-Id: I0f30f1fe9c54c3de1006276f3445c5e2b92ea5a7
Thanks very much for the investigation and fixes @nhiroki . I will close this PR now :) |
This CL fixes timeout on client-navigate.https.html, and removes unused code in testharness.js. This change is a follow-up for: [1] #21162 [2] #22086 After the change [1], fetch_tests_from_workers() helper uses ExtendableMessageEvent.source instead of MessageChannel to communicate between a window and a service worker. This change works well for most of cases, but fails some tests. The fetch_tests_from_workers() helper takes a service worker object to post a "connect" message to the worker, and then passes the worker object to RemoteContext in testharness.js. RemoteContext adds an onmessage event handler on self.navigator.serviceWorker. This works well as long as the given worker object is associated with `self`. However, these failing tests pass the worker object associated with the inner frame to the helper. In this case, the helper uses an inner frame's service worker object for postMessage(), while the helper waits on the main frame's navigator.serviceWorker.onmessage. Consequently event.source is the inner frame, and a reply from the service worker is dispatched on the inner frame's navigator.serviceWorker.onmessage. This results in timeout. To fix this, this CL makes the main frame pass its own service worker object instead of the inner frame's service worker object. Those objects should be equal other than associated contexts, and this change doesn't affect what the tests verify. Bug: 1057682 Change-Id: I0f30f1fe9c54c3de1006276f3445c5e2b92ea5a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155760 Reviewed-by: Makoto Shimazu <shimazu@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#760974}
This CL fixes timeout on client-navigate.https.html, and removes unused code in testharness.js. This change is a follow-up for: [1] web-platform-tests/wpt#21162 [2] web-platform-tests/wpt#22086 After the change [1], fetch_tests_from_workers() helper uses ExtendableMessageEvent.source instead of MessageChannel to communicate between a window and a service worker. This change works well for most of cases, but fails some tests. The fetch_tests_from_workers() helper takes a service worker object to post a "connect" message to the worker, and then passes the worker object to RemoteContext in testharness.js. RemoteContext adds an onmessage event handler on self.navigator.serviceWorker. This works well as long as the given worker object is associated with `self`. However, these failing tests pass the worker object associated with the inner frame to the helper. In this case, the helper uses an inner frame's service worker object for postMessage(), while the helper waits on the main frame's navigator.serviceWorker.onmessage. Consequently event.source is the inner frame, and a reply from the service worker is dispatched on the inner frame's navigator.serviceWorker.onmessage. This results in timeout. To fix this, this CL makes the main frame pass its own service worker object instead of the inner frame's service worker object. Those objects should be equal other than associated contexts, and this change doesn't affect what the tests verify. Bug: 1057682 Change-Id: I0f30f1fe9c54c3de1006276f3445c5e2b92ea5a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155760 Reviewed-by: Makoto Shimazu <shimazu@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#760974}
This CL fixes timeout on client-navigate.https.html, and removes unused code in testharness.js. This change is a follow-up for: [1] #21162 [2] #22086 After the change [1], fetch_tests_from_workers() helper uses ExtendableMessageEvent.source instead of MessageChannel to communicate between a window and a service worker. This change works well for most of cases, but fails some tests. The fetch_tests_from_workers() helper takes a service worker object to post a "connect" message to the worker, and then passes the worker object to RemoteContext in testharness.js. RemoteContext adds an onmessage event handler on self.navigator.serviceWorker. This works well as long as the given worker object is associated with `self`. However, these failing tests pass the worker object associated with the inner frame to the helper. In this case, the helper uses an inner frame's service worker object for postMessage(), while the helper waits on the main frame's navigator.serviceWorker.onmessage. Consequently event.source is the inner frame, and a reply from the service worker is dispatched on the inner frame's navigator.serviceWorker.onmessage. This results in timeout. To fix this, this CL makes the main frame pass its own service worker object instead of the inner frame's service worker object. Those objects should be equal other than associated contexts, and this change doesn't affect what the tests verify. Bug: 1057682 Change-Id: I0f30f1fe9c54c3de1006276f3445c5e2b92ea5a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155760 Reviewed-by: Makoto Shimazu <shimazu@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#760974}
…igate.https.html, a=testonly Automatic update from web-platform-tests ServiceWorker: Fix timeout on client-navigate.https.html This CL fixes timeout on client-navigate.https.html, and removes unused code in testharness.js. This change is a follow-up for: [1] web-platform-tests/wpt#21162 [2] web-platform-tests/wpt#22086 After the change [1], fetch_tests_from_workers() helper uses ExtendableMessageEvent.source instead of MessageChannel to communicate between a window and a service worker. This change works well for most of cases, but fails some tests. The fetch_tests_from_workers() helper takes a service worker object to post a "connect" message to the worker, and then passes the worker object to RemoteContext in testharness.js. RemoteContext adds an onmessage event handler on self.navigator.serviceWorker. This works well as long as the given worker object is associated with `self`. However, these failing tests pass the worker object associated with the inner frame to the helper. In this case, the helper uses an inner frame's service worker object for postMessage(), while the helper waits on the main frame's navigator.serviceWorker.onmessage. Consequently event.source is the inner frame, and a reply from the service worker is dispatched on the inner frame's navigator.serviceWorker.onmessage. This results in timeout. To fix this, this CL makes the main frame pass its own service worker object instead of the inner frame's service worker object. Those objects should be equal other than associated contexts, and this change doesn't affect what the tests verify. Bug: 1057682 Change-Id: I0f30f1fe9c54c3de1006276f3445c5e2b92ea5a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155760 Reviewed-by: Makoto Shimazu <shimazu@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#760974} -- wpt-commits: 0a9ee5f5458c922aab15c25339db79e93df5c707 wpt-pr: 23105
…igate.https.html, a=testonly Automatic update from web-platform-tests ServiceWorker: Fix timeout on client-navigate.https.html This CL fixes timeout on client-navigate.https.html, and removes unused code in testharness.js. This change is a follow-up for: [1] web-platform-tests/wpt#21162 [2] web-platform-tests/wpt#22086 After the change [1], fetch_tests_from_workers() helper uses ExtendableMessageEvent.source instead of MessageChannel to communicate between a window and a service worker. This change works well for most of cases, but fails some tests. The fetch_tests_from_workers() helper takes a service worker object to post a "connect" message to the worker, and then passes the worker object to RemoteContext in testharness.js. RemoteContext adds an onmessage event handler on self.navigator.serviceWorker. This works well as long as the given worker object is associated with `self`. However, these failing tests pass the worker object associated with the inner frame to the helper. In this case, the helper uses an inner frame's service worker object for postMessage(), while the helper waits on the main frame's navigator.serviceWorker.onmessage. Consequently event.source is the inner frame, and a reply from the service worker is dispatched on the inner frame's navigator.serviceWorker.onmessage. This results in timeout. To fix this, this CL makes the main frame pass its own service worker object instead of the inner frame's service worker object. Those objects should be equal other than associated contexts, and this change doesn't affect what the tests verify. Bug: 1057682 Change-Id: I0f30f1fe9c54c3de1006276f3445c5e2b92ea5a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155760 Reviewed-by: Makoto Shimazu <shimazu@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#760974} -- wpt-commits: 0a9ee5f5458c922aab15c25339db79e93df5c707 wpt-pr: 23105
…igate.https.html, a=testonly Automatic update from web-platform-tests ServiceWorker: Fix timeout on client-navigate.https.html This CL fixes timeout on client-navigate.https.html, and removes unused code in testharness.js. This change is a follow-up for: [1] web-platform-tests/wpt#21162 [2] web-platform-tests/wpt#22086 After the change [1], fetch_tests_from_workers() helper uses ExtendableMessageEvent.source instead of MessageChannel to communicate between a window and a service worker. This change works well for most of cases, but fails some tests. The fetch_tests_from_workers() helper takes a service worker object to post a "connect" message to the worker, and then passes the worker object to RemoteContext in testharness.js. RemoteContext adds an onmessage event handler on self.navigator.serviceWorker. This works well as long as the given worker object is associated with `self`. However, these failing tests pass the worker object associated with the inner frame to the helper. In this case, the helper uses an inner frame's service worker object for postMessage(), while the helper waits on the main frame's navigator.serviceWorker.onmessage. Consequently event.source is the inner frame, and a reply from the service worker is dispatched on the inner frame's navigator.serviceWorker.onmessage. This results in timeout. To fix this, this CL makes the main frame pass its own service worker object instead of the inner frame's service worker object. Those objects should be equal other than associated contexts, and this change doesn't affect what the tests verify. Bug: 1057682 Change-Id: I0f30f1fe9c54c3de1006276f3445c5e2b92ea5a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155760 Reviewed-by: Makoto Shimazu <shimazu@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#760974} -- wpt-commits: 0a9ee5f5458c922aab15c25339db79e93df5c707 wpt-pr: 23105
…igate.https.html, a=testonly Automatic update from web-platform-tests ServiceWorker: Fix timeout on client-navigate.https.html This CL fixes timeout on client-navigate.https.html, and removes unused code in testharness.js. This change is a follow-up for: [1] web-platform-tests/wpt#21162 [2] web-platform-tests/wpt#22086 After the change [1], fetch_tests_from_workers() helper uses ExtendableMessageEvent.source instead of MessageChannel to communicate between a window and a service worker. This change works well for most of cases, but fails some tests. The fetch_tests_from_workers() helper takes a service worker object to post a "connect" message to the worker, and then passes the worker object to RemoteContext in testharness.js. RemoteContext adds an onmessage event handler on self.navigator.serviceWorker. This works well as long as the given worker object is associated with `self`. However, these failing tests pass the worker object associated with the inner frame to the helper. In this case, the helper uses an inner frame's service worker object for postMessage(), while the helper waits on the main frame's navigator.serviceWorker.onmessage. Consequently event.source is the inner frame, and a reply from the service worker is dispatched on the inner frame's navigator.serviceWorker.onmessage. This results in timeout. To fix this, this CL makes the main frame pass its own service worker object instead of the inner frame's service worker object. Those objects should be equal other than associated contexts, and this change doesn't affect what the tests verify. Bug: 1057682 Change-Id: I0f30f1fe9c54c3de1006276f3445c5e2b92ea5a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155760 Reviewed-by: Makoto Shimazu <shimazu@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#760974} -- wpt-commits: 0a9ee5f5458c922aab15c25339db79e93df5c707 wpt-pr: 23105
…igate.https.html, a=testonly Automatic update from web-platform-tests ServiceWorker: Fix timeout on client-navigate.https.html This CL fixes timeout on client-navigate.https.html, and removes unused code in testharness.js. This change is a follow-up for: [1] web-platform-tests/wpt#21162 [2] web-platform-tests/wpt#22086 After the change [1], fetch_tests_from_workers() helper uses ExtendableMessageEvent.source instead of MessageChannel to communicate between a window and a service worker. This change works well for most of cases, but fails some tests. The fetch_tests_from_workers() helper takes a service worker object to post a "connect" message to the worker, and then passes the worker object to RemoteContext in testharness.js. RemoteContext adds an onmessage event handler on self.navigator.serviceWorker. This works well as long as the given worker object is associated with `self`. However, these failing tests pass the worker object associated with the inner frame to the helper. In this case, the helper uses an inner frame's service worker object for postMessage(), while the helper waits on the main frame's navigator.serviceWorker.onmessage. Consequently event.source is the inner frame, and a reply from the service worker is dispatched on the inner frame's navigator.serviceWorker.onmessage. This results in timeout. To fix this, this CL makes the main frame pass its own service worker object instead of the inner frame's service worker object. Those objects should be equal other than associated contexts, and this change doesn't affect what the tests verify. Bug: 1057682 Change-Id: I0f30f1fe9c54c3de1006276f3445c5e2b92ea5a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155760 Reviewed-by: Makoto Shimazu <shimazuchromium.org> Commit-Queue: Hiroki Nakagawa <nhirokichromium.org> Cr-Commit-Position: refs/heads/master{#760974} -- wpt-commits: 0a9ee5f5458c922aab15c25339db79e93df5c707 wpt-pr: 23105 UltraBlame original commit: a1a73fefe890d9fd377e15fcac599508ea28e1c1
…igate.https.html, a=testonly Automatic update from web-platform-tests ServiceWorker: Fix timeout on client-navigate.https.html This CL fixes timeout on client-navigate.https.html, and removes unused code in testharness.js. This change is a follow-up for: [1] web-platform-tests/wpt#21162 [2] web-platform-tests/wpt#22086 After the change [1], fetch_tests_from_workers() helper uses ExtendableMessageEvent.source instead of MessageChannel to communicate between a window and a service worker. This change works well for most of cases, but fails some tests. The fetch_tests_from_workers() helper takes a service worker object to post a "connect" message to the worker, and then passes the worker object to RemoteContext in testharness.js. RemoteContext adds an onmessage event handler on self.navigator.serviceWorker. This works well as long as the given worker object is associated with `self`. However, these failing tests pass the worker object associated with the inner frame to the helper. In this case, the helper uses an inner frame's service worker object for postMessage(), while the helper waits on the main frame's navigator.serviceWorker.onmessage. Consequently event.source is the inner frame, and a reply from the service worker is dispatched on the inner frame's navigator.serviceWorker.onmessage. This results in timeout. To fix this, this CL makes the main frame pass its own service worker object instead of the inner frame's service worker object. Those objects should be equal other than associated contexts, and this change doesn't affect what the tests verify. Bug: 1057682 Change-Id: I0f30f1fe9c54c3de1006276f3445c5e2b92ea5a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155760 Reviewed-by: Makoto Shimazu <shimazuchromium.org> Commit-Queue: Hiroki Nakagawa <nhirokichromium.org> Cr-Commit-Position: refs/heads/master{#760974} -- wpt-commits: 0a9ee5f5458c922aab15c25339db79e93df5c707 wpt-pr: 23105 UltraBlame original commit: e4f2dd72c208f41d4cccb483eeead7523e60e0fc
…igate.https.html, a=testonly Automatic update from web-platform-tests ServiceWorker: Fix timeout on client-navigate.https.html This CL fixes timeout on client-navigate.https.html, and removes unused code in testharness.js. This change is a follow-up for: [1] web-platform-tests/wpt#21162 [2] web-platform-tests/wpt#22086 After the change [1], fetch_tests_from_workers() helper uses ExtendableMessageEvent.source instead of MessageChannel to communicate between a window and a service worker. This change works well for most of cases, but fails some tests. The fetch_tests_from_workers() helper takes a service worker object to post a "connect" message to the worker, and then passes the worker object to RemoteContext in testharness.js. RemoteContext adds an onmessage event handler on self.navigator.serviceWorker. This works well as long as the given worker object is associated with `self`. However, these failing tests pass the worker object associated with the inner frame to the helper. In this case, the helper uses an inner frame's service worker object for postMessage(), while the helper waits on the main frame's navigator.serviceWorker.onmessage. Consequently event.source is the inner frame, and a reply from the service worker is dispatched on the inner frame's navigator.serviceWorker.onmessage. This results in timeout. To fix this, this CL makes the main frame pass its own service worker object instead of the inner frame's service worker object. Those objects should be equal other than associated contexts, and this change doesn't affect what the tests verify. Bug: 1057682 Change-Id: I0f30f1fe9c54c3de1006276f3445c5e2b92ea5a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155760 Reviewed-by: Makoto Shimazu <shimazuchromium.org> Commit-Queue: Hiroki Nakagawa <nhirokichromium.org> Cr-Commit-Position: refs/heads/master{#760974} -- wpt-commits: 0a9ee5f5458c922aab15c25339db79e93df5c707 wpt-pr: 23105 UltraBlame original commit: a1a73fefe890d9fd377e15fcac599508ea28e1c1
…igate.https.html, a=testonly Automatic update from web-platform-tests ServiceWorker: Fix timeout on client-navigate.https.html This CL fixes timeout on client-navigate.https.html, and removes unused code in testharness.js. This change is a follow-up for: [1] web-platform-tests/wpt#21162 [2] web-platform-tests/wpt#22086 After the change [1], fetch_tests_from_workers() helper uses ExtendableMessageEvent.source instead of MessageChannel to communicate between a window and a service worker. This change works well for most of cases, but fails some tests. The fetch_tests_from_workers() helper takes a service worker object to post a "connect" message to the worker, and then passes the worker object to RemoteContext in testharness.js. RemoteContext adds an onmessage event handler on self.navigator.serviceWorker. This works well as long as the given worker object is associated with `self`. However, these failing tests pass the worker object associated with the inner frame to the helper. In this case, the helper uses an inner frame's service worker object for postMessage(), while the helper waits on the main frame's navigator.serviceWorker.onmessage. Consequently event.source is the inner frame, and a reply from the service worker is dispatched on the inner frame's navigator.serviceWorker.onmessage. This results in timeout. To fix this, this CL makes the main frame pass its own service worker object instead of the inner frame's service worker object. Those objects should be equal other than associated contexts, and this change doesn't affect what the tests verify. Bug: 1057682 Change-Id: I0f30f1fe9c54c3de1006276f3445c5e2b92ea5a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155760 Reviewed-by: Makoto Shimazu <shimazuchromium.org> Commit-Queue: Hiroki Nakagawa <nhirokichromium.org> Cr-Commit-Position: refs/heads/master{#760974} -- wpt-commits: 0a9ee5f5458c922aab15c25339db79e93df5c707 wpt-pr: 23105 UltraBlame original commit: e4f2dd72c208f41d4cccb483eeead7523e60e0fc
…igate.https.html, a=testonly Automatic update from web-platform-tests ServiceWorker: Fix timeout on client-navigate.https.html This CL fixes timeout on client-navigate.https.html, and removes unused code in testharness.js. This change is a follow-up for: [1] web-platform-tests/wpt#21162 [2] web-platform-tests/wpt#22086 After the change [1], fetch_tests_from_workers() helper uses ExtendableMessageEvent.source instead of MessageChannel to communicate between a window and a service worker. This change works well for most of cases, but fails some tests. The fetch_tests_from_workers() helper takes a service worker object to post a "connect" message to the worker, and then passes the worker object to RemoteContext in testharness.js. RemoteContext adds an onmessage event handler on self.navigator.serviceWorker. This works well as long as the given worker object is associated with `self`. However, these failing tests pass the worker object associated with the inner frame to the helper. In this case, the helper uses an inner frame's service worker object for postMessage(), while the helper waits on the main frame's navigator.serviceWorker.onmessage. Consequently event.source is the inner frame, and a reply from the service worker is dispatched on the inner frame's navigator.serviceWorker.onmessage. This results in timeout. To fix this, this CL makes the main frame pass its own service worker object instead of the inner frame's service worker object. Those objects should be equal other than associated contexts, and this change doesn't affect what the tests verify. Bug: 1057682 Change-Id: I0f30f1fe9c54c3de1006276f3445c5e2b92ea5a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155760 Reviewed-by: Makoto Shimazu <shimazuchromium.org> Commit-Queue: Hiroki Nakagawa <nhirokichromium.org> Cr-Commit-Position: refs/heads/master{#760974} -- wpt-commits: 0a9ee5f5458c922aab15c25339db79e93df5c707 wpt-pr: 23105 UltraBlame original commit: a1a73fefe890d9fd377e15fcac599508ea28e1c1
…igate.https.html, a=testonly Automatic update from web-platform-tests ServiceWorker: Fix timeout on client-navigate.https.html This CL fixes timeout on client-navigate.https.html, and removes unused code in testharness.js. This change is a follow-up for: [1] web-platform-tests/wpt#21162 [2] web-platform-tests/wpt#22086 After the change [1], fetch_tests_from_workers() helper uses ExtendableMessageEvent.source instead of MessageChannel to communicate between a window and a service worker. This change works well for most of cases, but fails some tests. The fetch_tests_from_workers() helper takes a service worker object to post a "connect" message to the worker, and then passes the worker object to RemoteContext in testharness.js. RemoteContext adds an onmessage event handler on self.navigator.serviceWorker. This works well as long as the given worker object is associated with `self`. However, these failing tests pass the worker object associated with the inner frame to the helper. In this case, the helper uses an inner frame's service worker object for postMessage(), while the helper waits on the main frame's navigator.serviceWorker.onmessage. Consequently event.source is the inner frame, and a reply from the service worker is dispatched on the inner frame's navigator.serviceWorker.onmessage. This results in timeout. To fix this, this CL makes the main frame pass its own service worker object instead of the inner frame's service worker object. Those objects should be equal other than associated contexts, and this change doesn't affect what the tests verify. Bug: 1057682 Change-Id: I0f30f1fe9c54c3de1006276f3445c5e2b92ea5a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155760 Reviewed-by: Makoto Shimazu <shimazuchromium.org> Commit-Queue: Hiroki Nakagawa <nhirokichromium.org> Cr-Commit-Position: refs/heads/master{#760974} -- wpt-commits: 0a9ee5f5458c922aab15c25339db79e93df5c707 wpt-pr: 23105 UltraBlame original commit: e4f2dd72c208f41d4cccb483eeead7523e60e0fc
This reverts commit d7032c0.
WIP: I want to see the results of this on TaskCluster; please don't review yet.