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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-helpers.js

Issue 2049723004: Revert of Limit foreign fetch to only intercept requests made from secure contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-helper-iframe.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Common helper functions for foreign fetch tests. 1 // Common helper functions for foreign fetch tests.
2 2
3 // Installs a service worker on a different origin. Both |worker| and |scope| 3 // Installs a service worker on a different origin. Both |worker| and |scope|
4 // are resolved relative to the /serviceworker/resources/ directory on a 4 // are resolved relative to the /serviceworker/resources/ directory on a
5 // remote origin. 5 // remote origin.
6 function install_cross_origin_worker( 6 function install_cross_origin_worker(t, worker, scope) {
7 t, worker, scope, origin = get_host_info().HTTPS_REMOTE_ORIGIN) { 7 return with_iframe(get_host_info().HTTPS_REMOTE_ORIGIN +
8 return with_iframe(origin +
9 '/serviceworker/resources/install-worker-helper.html') 8 '/serviceworker/resources/install-worker-helper.html')
10 .then(frame => new Promise((resolve, reject) => { 9 .then(frame => new Promise((resolve, reject) => {
11 var channel = new MessageChannel(); 10 var channel = new MessageChannel();
12 frame.contentWindow.postMessage({worker: worker, 11 frame.contentWindow.postMessage({worker: worker,
13 options: {scope: scope}, 12 options: {scope: scope},
14 port: channel.port1}, 13 port: channel.port1},
15 '*', [channel.port1]); 14 '*', [channel.port1]);
16 channel.port2.onmessage = reply => { 15 channel.port2.onmessage = reply => {
17 if (reply.data == 'success') resolve(); 16 if (reply.data == 'success') resolve();
18 else reject(reply.data); 17 else reject(reply.data);
19 }; 18 };
20 })); 19 }));
21 } 20 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-helper-iframe.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698