Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

stephenmcgruer
Copy link
Contributor

This reverts commit d7032c0.

WIP: I want to see the results of this on TaskCluster; please don't review yet.

@jgraham
Copy link
Contributor

jgraham commented Apr 8, 2020

What's the plan with this one?

@stephenmcgruer
Copy link
Contributor Author

What's the plan with this one?

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).

@stephenmcgruer
Copy link
Contributor Author

https://wpt.fyi/results/?diff&filter=ADC&run_id=455690005&run_id=480270002 should be the diff. Some flakes, as expected, but the service-worker/ changes seem to back up what happened in #21162 (comment) - a handful of tests in client-navigate.html come back (https://wpt.fyi/results/service-workers/service-worker/client-navigate.https.html?diff&filter=ADC&run_id=455690005&run_id=480270002).

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?

@nhiroki
Copy link
Contributor

nhiroki commented Apr 16, 2020

'Blink setting MessageEvent.source to null for messages sent via ServiceWorker.postMessage()'

This should already be supported in Blink (https://crbug.com/543198).

I guess that the original PR needs more work. In the original code, postMessage() transfers the message port to the worker.

worker.postMessage({type: "connect"}, [message_channel.port2]);

Looks like some tests still depend on the transferre port instead of the ExtendableMessageEvent.source attribute (e.g., wpt/service-workers/service-worker/resources/client-navigate-worker.js). Probably service workers in the tests cannot handle the message event due to this, and time out.

@nhiroki
Copy link
Contributor

nhiroki commented Apr 20, 2020

@stephenmcgruer @annevk I'll make a patch to fix this (chromium issue).

@nhiroki
Copy link
Contributor

nhiroki commented Apr 20, 2020

[edited] I understand the root cause. The failing tests use an inner frame's service worker object's postMessage(), while they wait on the main frame's navigator.serviceWorker.onmessage. In this case, 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.

In addition, we could remove the leftover in ServiceWorkerTestEnvironment() in testharness.js.

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);
}

@nhiroki
Copy link
Contributor

nhiroki commented Apr 20, 2020

I understand the root cause. The failing tests use an inner frame's navigatior.serviceWorker.postMessage(), while they wait on the main frame's navigator.serviceWorker.onmessage. In this case, 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.

Let me elaborate on this more because this is hidden in fetch_tests_from_worker() helper and it's a bit difficult to trace what happens there.

The failing tests use fetch_tests_from_worker() helper. This 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 when the given worker object is associated with self. However, these failing tests pass the worker object associated with the inner frame (not self) to the helper, so the mismatch explained above happens.

I think this should be fixed in the tests, not in testharness.js. I'll make a fix.

@annevk
Copy link
Member

annevk commented Apr 20, 2020

Thanks @stephenmcgruer and @nhiroki for dealing with this in such a thoughtful manner! Glad to see testharness.js might see further simplifications.

chromium-wpt-export-bot pushed a commit that referenced this pull request Apr 20, 2020
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
@stephenmcgruer
Copy link
Contributor Author

Thanks very much for the investigation and fixes @nhiroki . I will close this PR now :)

@stephenmcgruer stephenmcgruer deleted the smcgruer/revert branch April 20, 2020 15:36
chromium-wpt-export-bot pushed a commit that referenced this pull request Apr 21, 2020
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}
pull bot pushed a commit to FreddyZeng/chromium that referenced this pull request Apr 21, 2020
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}
chromium-wpt-export-bot pushed a commit that referenced this pull request Apr 22, 2020
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}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request May 1, 2020
…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
xeonchen pushed a commit to xeonchen/gecko that referenced this pull request May 1, 2020
…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
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request May 1, 2020
…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
xeonchen pushed a commit to xeonchen/gecko that referenced this pull request May 1, 2020
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request May 3, 2020
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request May 3, 2020
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request May 3, 2020
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request May 3, 2020
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request May 3, 2020
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request May 3, 2020
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants