Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-basics.html

Issue 2255383002: Allow a foreign fetch event handler to not handle an event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove comment from FallbackToNetworkOrRenderer Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/service_worker/service_worker_url_request_job.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-basics.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-basics.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-basics.html
index 90f75cf8c457833763b63debc7aa273d314c54ba..1f6c41bee3ed2f48784776836aee4af6ac62f2fc 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-basics.html
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-basics.html
@@ -103,13 +103,24 @@ promise_test(t => {
}, 'Service Worker does not intercept navigations.');
promise_test(t => {
- var scope = 'simple.txt?fallback';
+ var scope = 'fetch-access-control.php?fallback&ACAOrigin=*';
var remote_url =
host_info.HTTPS_REMOTE_ORIGIN + '/serviceworker/resources/' + scope;
return install_cross_origin_worker(t, worker_for_scopes(['']), scope)
.then(() => fetch(remote_url))
- .then(response => {});
- }, 'Service Worker that fallback to network should not crash.');
+ .then(response => response.text())
+ .then(response_text => assert_true(response_text.startsWith('report(')));
+ }, 'Service Worker that fallback to network should fallback to network.');
+
+promise_test(t => {
+ var scope = 'simple.txt?fallback';
+ var remote_url =
+ host_info.HTTPS_REMOTE_ORIGIN + '/serviceworker/resources/' + scope;
+ return install_cross_origin_worker(t, worker_for_scopes(['']), scope)
+ .then(() => fetch(remote_url, {mode: 'no-cors'}))
+ .then(response => assert_equals(response.type, 'opaque'))
+ .then(() => promise_rejects(t, new TypeError(), fetch(remote_url)));
+ }, 'Falling back to network should still respect CORS.');
promise_test(t => {
var ff_scope = 'foreign-fetch/scope/controlled?basic';
« no previous file with comments | « content/browser/service_worker/service_worker_url_request_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698