Commit 2b9cc44c authored by Matt Falkenhagen's avatar Matt Falkenhagen Committed by Commit Bot

service worker: Add WPT for requests through no fetch controller.

NetworkService and NetS13nSW currently fail this test.

Bug: 850839
Cq-Include-Trybots: luci.chromium.try:linux_mojo
Change-Id: Ic33481d43b34f36c5ac7b234a2ca149d4134fcd0
Reviewed-on: https://chromium-review.googlesource.com/1107029Reviewed-by: default avatarMakoto Shimazu <shimazu@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568725}
parent 5e2d32f0
......@@ -6,6 +6,7 @@ Bug(none) external/wpt/clear-site-data/navigation.https.html [ Timeout ]
Bug(none) external/wpt/html/browsers/offline/appcache/workers/appcache-worker.html [ Timeout ]
crbug.com/829417 external/wpt/html/browsers/offline/appcache/workers/appcache-worker.https.html [ Timeout ]
crbug.com/771118 external/wpt/service-workers/service-worker/mime-sniffing.https.html [ Failure ]
crbug.com/850839 external/wpt/service-workers/service-worker/controller-with-no-fetch-event-handler.https.html [ Failure Crash ]
# Passes on NetworkService and fails on non-NetworkService because
# NetworkService isn't affected by https://crbug.com/595993.
......
......@@ -1754,6 +1754,7 @@ crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/workers/cross
# Failing tests in dictionary order.
crbug.com/802835 virtual/outofblink-cors/external/wpt/fetch/corb/img-mime-types-coverage.tentative.sub.html [ Failure ]
crbug.com/850839 virtual/outofblink-cors/external/wpt/service-workers/service-worker/controller-with-no-fetch-event-handler.https.html [ Failure ]
crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-canvas-tainting-image-cache.https.html [ Failure ]
crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-canvas-tainting-image.https.html [ Failure ]
crbug.com/736308 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-canvas-tainting-video-cache.https.html [ Failure ]
......@@ -2278,6 +2279,8 @@ crbug.com/524160 [ Debug ] http/tests/media/media-source/stream_memory_tests/med
crbug.com/630342 virtual/mse-1mb-buffers/http/tests/media/media-source/stream_memory_tests/mediasource-appendbuffer-quota-exceeded-default-buffers.html [ Skip ]
crbug.com/630342 http/tests/media/media-source/stream_memory_tests/mediasource-appendbuffer-quota-exceeded-1mb-buffers.html [ Skip ]
crbug.com/850839 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/controller-with-no-fetch-event-handler.https.html [ Failure Crash ]
# On these platforms (all but Android) media tests don't currently use gpu-accelerated (proprietary) codecs, so no
# benefit to running them again with gpu acceleration enabled.
crbug.com/555703 [ Linux Mac Win Fuchsia ] virtual/media-gpu-accelerated [ Skip ]
......
<!DOCTYPE html>
<meta charset="utf-8">
<title>Service Worker: controller without a fetch event handler</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="resources/test-helpers.sub.js?pipe=sub"></script>
<body>
<script>
let registration;
let frame;
const host_info = get_host_info();
const remote_base_url =
new URL(`${host_info.HTTPS_REMOTE_ORIGIN}${base_path()}resources/`);
promise_test(async t => {
const script = 'resources/empty.js'
const scope = 'resources/';
promise_test(async t => {
if (frame)
frame.remove();
if (registration)
await registration.unregister();
}, 'cleanup global state');
registration = await
service_worker_unregister_and_register(t, script, scope);
await wait_for_state(t, registration.installing, 'activated');
frame = await with_iframe(scope + 'blank.html');
}, 'global setup');
promise_test(async t => {
const url = new URL('cors-approved.txt', remote_base_url);
const response = await frame.contentWindow.fetch(url, {mode:'no-cors'});
const text = await response.text();
assert_equals(text, '');
}, 'cross-origin request, no-cors mode');
promise_test(async t => {
const url = new URL('cors-denied.txt', remote_base_url);
const response = frame.contentWindow.fetch(url);
await promise_rejects(t, new TypeError(), response);
}, 'cross-origin request, cors denied');
promise_test(async t => {
const url = new URL('cors-approved.txt', remote_base_url);
response = await frame.contentWindow.fetch(url);
let text = await response.text();
text = text.trim();
assert_equals(text, 'plaintext');
}, 'cross-origin request, cors approved');
</script>
</body>
this file is served without Access-Control-Allow-Origin headers so it should not
be readable from cross-origin.
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