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

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

Issue 2110163002: Correctly set initiated_in_secure_context on requests from shared/service workers, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@skip-service-worker-foreign-fetch
Patch Set: wrap layout test at 80 columns Created 4 years, 5 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 <script src="resources/foreign-fetch-helpers.js"></script> 6 <script src="resources/foreign-fetch-helpers.js"></script>
7 <body> 7 <body>
8 <script> 8 <script>
9 var host_info = get_host_info(); 9 var host_info = get_host_info();
10 10
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 }); 182 });
183 }, 'Referrer and origin are set correctly in ForeignFetchEvent.'); 183 }, 'Referrer and origin are set correctly in ForeignFetchEvent.');
184 184
185 function fetch_from_iframe(origin, url) { 185 function fetch_from_iframe(origin, url) {
186 return with_iframe(origin + 186 return with_iframe(origin +
187 '/serviceworker/resources/foreign-fetch-helper-iframe.html') 187 '/serviceworker/resources/foreign-fetch-helper-iframe.html')
188 .then(frame => new Promise((resolve) => { 188 .then(frame => new Promise((resolve) => {
189 var channel = new MessageChannel(); 189 var channel = new MessageChannel();
190 frame.contentWindow.postMessage({url: url, 190 frame.contentWindow.postMessage({url: url,
191 port: channel.port1}, 191 port: channel.port1},
192 '*', [channel.port1]); 192 '*', [channel.port1]);
193 channel.port2.onmessage = reply => resolve(reply.data); 193 channel.port2.onmessage = reply => resolve(reply.data);
194 })); 194 }));
195 } 195 }
196 196
197 promise_test(t => { 197 promise_test(t => {
198 var scope = 'simple.txt?basic_insecure'; 198 var scope = 'simple.txt?basic_insecure';
199 var remote_url = 199 var remote_url =
200 host_info.AUTHENTICATED_ORIGIN + '/serviceworker/resources/' + scope; 200 host_info.AUTHENTICATED_ORIGIN + '/serviceworker/resources/' + scope;
201 return install_cross_origin_worker(t, worker_for_scopes(['']), scope, 201 return install_cross_origin_worker(t, worker_for_scopes(['']), scope,
202 host_info.AUTHENTICATED_ORIGIN) 202 host_info.AUTHENTICATED_ORIGIN)
(...skipping 10 matching lines...) Expand all
213 var remote_url = 213 var remote_url =
214 host_info.HTTPS_REMOTE_ORIGIN + '/serviceworker/resources/' + scope; 214 host_info.HTTPS_REMOTE_ORIGIN + '/serviceworker/resources/' + scope;
215 return install_cross_origin_worker(t, worker_for_scopes(['']), scope) 215 return install_cross_origin_worker(t, worker_for_scopes(['']), scope)
216 .then(() => fetch(remote_url, {method: 'SPECIAL'})) 216 .then(() => fetch(remote_url, {method: 'SPECIAL'}))
217 .then(response => response.text()) 217 .then(response => response.text())
218 .then(response_text => assert_true(response_text.startsWith('report('))); 218 .then(response_text => assert_true(response_text.startsWith('report(')));
219 }, 'Service Worker does not intercept fetches with CORS preflight'); 219 }, 'Service Worker does not intercept fetches with CORS preflight');
220 220
221 </script> 221 </script>
222 </body> 222 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698