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

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

Issue 1867293004: Set service worker response info data for foreign fetch intercepted fetches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ff-check-origin
Patch Set: Created 4 years, 8 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="../resources/get-host-info.js"></script> 4 <script src="../resources/get-host-info.js"></script>
5 <script src="resources/test-helpers.js"></script> 5 <script src="resources/test-helpers.js"></script>
6 <body> 6 <body>
7 <script> 7 <script>
8 var host_info = get_host_info(); 8 var host_info = get_host_info();
9 9
10 function worker_for_origins(origins) { 10 function worker_for_origins(origins) {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 .then(frame => new Promise(resolve => { 110 .then(frame => new Promise(resolve => {
111 var channel = new MessageChannel(); 111 var channel = new MessageChannel();
112 frame.contentWindow.postMessage('ping', '*', [channel.port1]); 112 frame.contentWindow.postMessage('ping', '*', [channel.port1]);
113 channel.port2.onmessage = reply => resolve(reply.data); 113 channel.port2.onmessage = reply => resolve(reply.data);
114 })) 114 }))
115 .then(reply => { 115 .then(reply => {
116 assert_equals(reply, 'ping'); 116 assert_equals(reply, 'ping');
117 }); 117 });
118 }, 'Service Worker does not intercept navigations.'); 118 }, 'Service Worker does not intercept navigations.');
119 119
120 promise_test(t => {
121 var scope = 'simple.txt?fallback';
122 var remote_url =
123 host_info.HTTPS_REMOTE_ORIGIN + '/serviceworker/resources/' + scope;
124 return install_cross_origin_worker(t, worker_for_scopes(['']), scope)
125 .then(() => fetch(remote_url))
126 .then(response => {});
127 }, 'Service Worker that fallback to network should not crash.');
128
120 </script> 129 </script>
121 </body> 130 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698