Commit 123ddc4d authored by Chromium WPT Sync's avatar Chromium WPT Sync Committed by Commit Bot

Import wpt@923fe410c97230337f2067bd68a9e31f3adfd4ab

Using wpt-import in Chromium d2104e4a.
With Chromium commits locally applied on WPT:
d0ad7cf8 "UpgradeInsecureRequest: Add WPTs for static-import in dedicated/shared workers"
2688e49a "De-flake two lazyload WPT tests."
8fa00285 "[webauthn] Fix resident key credentials.get() WPT"
edb8adb1 "Implement and ship RTCRtpSendParameters.degradationPreference"
2fb88bb8 "Use integer coordinates for Actions.pointerMove."


Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md

NOAUTOREVERT=true
TBR=lpz

No-Export: true
Change-Id: Id3c05a605d49adc640a5fec80fd9274552e83526
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2134147Reviewed-by: default avatarWPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#756213}
parent 6f56d17b
This is a testharness.js-based test. This is a testharness.js-based test.
PASS global setup PASS global setup
FAIL FetchEvent.handled should resolve when respondWith() is not called assert_equals: expected "RESOLVED" but got "FAILED" FAIL FetchEvent.handled should resolve when respondWith() is not called for a navigation request assert_equals: expected "RESOLVED" but got "FAILED"
FAIL FetchEvent.handled should resolve when respondWith() is not called for a sub-resource request assert_equals: expected "RESOLVED" but got "FAILED"
FAIL FetchEvent.handled should reject when respondWith() is not called and the event is canceled assert_equals: expected "REJECTED" but got "FAILED" FAIL FetchEvent.handled should reject when respondWith() is not called and the event is canceled assert_equals: expected "REJECTED" but got "FAILED"
FAIL FetchEvent.handled should resolve when the promise provided to respondWith() is resolved assert_equals: expected "RESOLVED" but got "FAILED" FAIL FetchEvent.handled should resolve when the promise provided to respondWith() is resolved assert_equals: expected "RESOLVED" but got "FAILED"
FAIL FetchEvent.handled should reject when the promise provided to respondWith() is resolved to an invalid response assert_equals: expected "REJECTED" but got "FAILED" FAIL FetchEvent.handled should reject when the promise provided to respondWith() is resolved to an invalid response assert_equals: expected "REJECTED" but got "FAILED"
......
...@@ -30,14 +30,21 @@ promise_test(async (t) => { ...@@ -30,14 +30,21 @@ promise_test(async (t) => {
await service_worker_unregister_and_register(t, script, scope); await service_worker_unregister_and_register(t, script, scope);
worker = registration.installing; worker = registration.installing;
await wait_for_state(t, worker, 'activated'); await wait_for_state(t, worker, 'activated');
frame = await with_iframe(scope);
}, 'global setup'); }, 'global setup');
promise_test(async (t) => {
frame = await with_iframe(scope);
const message = await wait_for_message_from_worker();
assert_equals(message, 'RESOLVED');
}, 'FetchEvent.handled should resolve when respondWith() is not called for a' +
' navigation request');
promise_test(async (t) => { promise_test(async (t) => {
frame.contentWindow.fetch('dummy.txt?respondWith-not-called'); frame.contentWindow.fetch('dummy.txt?respondWith-not-called');
const message = await wait_for_message_from_worker(); const message = await wait_for_message_from_worker();
assert_equals(message, 'RESOLVED'); assert_equals(message, 'RESOLVED');
}, 'FetchEvent.handled should resolve when respondWith() is not called'); }, 'FetchEvent.handled should resolve when respondWith() is not called for a' +
' sub-resource request');
promise_test(async (t) => { promise_test(async (t) => {
frame.contentWindow.fetch( frame.contentWindow.fetch(
......
...@@ -9,7 +9,9 @@ function send_message_to_client(message, clientId) { ...@@ -9,7 +9,9 @@ function send_message_to_client(message, clientId) {
} }
self.addEventListener('fetch', function(event) { self.addEventListener('fetch', function(event) {
const clientId = event.clientId; const clientId = (event.request.mode === 'navigate') ?
event.resultingClientId : event.clientId;
try { try {
event.handled.then(() => { event.handled.then(() => {
send_message_to_client('RESOLVED', clientId); send_message_to_client('RESOLVED', clientId);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment