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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/suborigin-foreign-fetch-service-worker-worker.js

Issue 2770213002: Add LayoutTest for a bug of Suborigin and MemoryCache and ForeignFetch
Patch Set: Created 3 years, 9 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
Index: third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/suborigin-foreign-fetch-service-worker-worker.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/suborigin-foreign-fetch-service-worker-worker.js b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/suborigin-foreign-fetch-service-worker-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..985eeed620395ed797f84a439cef43c05abf9847
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/suborigin-foreign-fetch-service-worker-worker.js
@@ -0,0 +1,18 @@
+self.addEventListener('install', event => {
+ event.waitUntil(
+ event.registerForeignFetch({
+ scopes: ['./sw-scope/'],
+ origins: ['*']
+ }));
+});
+
+self.addEventListener('foreignfetch', event => {
+ console.log('foreignfetch');
+ event.respondWith(
+ {
+ response:
+ new Response('run(\'from foreignfetch\')',
+ {headers: [['Content-Type', 'text/javascript'],
+ ['Cache-Control', 'max-age=86400']]})
+ });
+ });

Powered by Google App Engine
This is Rietveld 408576698