Closed Bug 1631356 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 23105 - ServiceWorker: Fix timeout on client-navigate.https.html

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox77 fixed)

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 23105 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/23105
Details from upstream follow.

Hiroki Nakagawa <nhiroki@chromium.org> wrote:

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] https://github.com/web-platform-tests/wpt/pull/21162
[2] https://github.com/web-platform-tests/wpt/pull/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/2155760
WPT-Export-Revision: ca7e9c3bae32d3ee96855b0dce23f74dd842c484

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Status: REOPENED → RESOLVED
Closed: 1 year ago1 year ago
Resolution: --- → INVALID
Status: RESOLVED → REOPENED
Resolution: INVALID → ---

CI Results

Ran 13 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 60 tests

Status Summary

Firefox

OK : 1
PASS: 10[Gecko-windows10-64-qr-debug, GitHub] 59[Gecko-android-em-7.0-x86_64-debug-geckoview, Gecko-android-em-7.0-x86_64-opt-geckoview] 69[Gecko-linux1804-64-asan-opt, Gecko-linux1804-64-debug, Gecko-linux1804-64-opt, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows10-64-debug, Gecko-windows10-64-opt, Gecko-windows10-64-qr-opt, Gecko-windows7-32-debug, Gecko-windows7-32-opt]

Chrome

OK : 1
PASS: 10

Safari

OK : 1
PASS: 2
FAIL: 8

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/service-workers/service-worker/client-navigate.https.html: OK [Gecko-linux1804-64-asan-opt, Gecko-linux1804-64-debug, Gecko-linux1804-64-opt, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows10-64-debug, Gecko-windows10-64-opt, Gecko-windows10-64-qr-debug, Gecko-windows10-64-qr-opt, Gecko-windows7-32-debug, Gecko-windows7-32-opt, GitHub], SKIP [Gecko-android-em-7.0-x86_64-debug-geckoview, Gecko-android-em-7.0-x86_64-opt-geckoview] (Chrome: OK, Safari: OK)

Tests Disabled in Gecko Infrastructure

/service-workers/service-worker/client-navigate.https.html: OK [Gecko-linux1804-64-asan-opt, Gecko-linux1804-64-debug, Gecko-linux1804-64-opt, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows10-64-debug, Gecko-windows10-64-opt, Gecko-windows10-64-qr-debug, Gecko-windows10-64-qr-opt, Gecko-windows7-32-debug, Gecko-windows7-32-opt, GitHub], SKIP [Gecko-android-em-7.0-x86_64-debug-geckoview, Gecko-android-em-7.0-x86_64-opt-geckoview] (Chrome: OK, Safari: OK)

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a1a73fefe890
[wpt PR 23105] - ServiceWorker: Fix timeout on client-navigate.https.html, a=testonly
https://hg.mozilla.org/integration/autoland/rev/4147a555fd8f
[wpt PR 23105] - Update wpt metadata, a=testonly
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/e4f2dd72c208
[wpt PR 23105] - ServiceWorker: Fix timeout on client-navigate.https.html, a=testonly
https://hg.mozilla.org/integration/autoland/rev/c810496118ef
[wpt PR 23105] - Update wpt metadata, a=testonly
Status: REOPENED → RESOLVED
Closed: 1 year ago1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.