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

Side by Side Diff: LayoutTests/http/tests/serviceworker/fetch-cors-xhr.html

Issue 722603002: [ServiceWorker] Use the cookie which is differnt from the username in LayoutTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 <title>Service Worker: CORS XHR of fetch()</title> 2 <title>Service Worker: CORS XHR of fetch()</title>
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.js?pipe=sub"></script> 5 <script src="resources/test-helpers.js?pipe=sub"></script>
6 <body> 6 <body>
7 <script> 7 <script>
8 async_test(function(t) { 8 async_test(function(t) {
9 var login1 = 9 var login1 =
10 test_login(t, 'http://127.0.0.1:8000', 'username1', 'password1'); 10 test_login(t, 'http://127.0.0.1:8000',
11 'username1', 'password1', 'cookie1');
11 var login2 = 12 var login2 =
12 test_login(t, 'http://localhost:8000', 'username2', 'password2'); 13 test_login(t, 'http://localhost:8000',
14 'username2', 'password2', 'cookie2');
13 var SCOPE = 'resources/fetch-cors-xhr-iframe.html'; 15 var SCOPE = 'resources/fetch-cors-xhr-iframe.html';
14 var SCRIPT = 'resources/fetch-rewrite-worker.js'; 16 var SCRIPT = 'resources/fetch-rewrite-worker.js';
15 var host_info = get_host_info(); 17 var host_info = get_host_info();
16 18
17 Promise.all([login1, login2]) 19 Promise.all([login1, login2])
18 .then(function() { 20 .then(function() {
19 return service_worker_unregister_and_register(t, SCRIPT, SCOPE); 21 return service_worker_unregister_and_register(t, SCRIPT, SCOPE);
20 }) 22 })
21 .then(function(registration) { 23 .then(function(registration) {
22 return wait_for_update(t, registration); 24 return wait_for_update(t, registration);
(...skipping 12 matching lines...) Expand all
35 }); 37 });
36 frame.contentWindow.postMessage({}, 38 frame.contentWindow.postMessage({},
37 [channel.port2], 39 [channel.port2],
38 host_info['HTTP_ORIGIN']); 40 host_info['HTTP_ORIGIN']);
39 }); 41 });
40 }) 42 })
41 .catch(unreached_rejection(t)); 43 .catch(unreached_rejection(t));
42 }, 'Verify CORS XHR of fetch() in a Service Worker'); 44 }, 'Verify CORS XHR of fetch() in a Service Worker');
43 </script> 45 </script>
44 </body> 46 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698