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

Side by Side Diff: LayoutTests/http/tests/serviceworker/resources/test-helpers.js

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
« no previous file with comments | « LayoutTests/http/tests/serviceworker/resources/fetch-access-control-util.js ('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 // Adapter for testharness.js-style tests with Service Workers 1 // Adapter for testharness.js-style tests with Service Workers
2 2
3 function service_worker_unregister_and_register(test, url, scope) { 3 function service_worker_unregister_and_register(test, url, scope) {
4 if (!scope || scope.length == 0) 4 if (!scope || scope.length == 0)
5 return Promise.reject(new Error('tests must define a scope')); 5 return Promise.reject(new Error('tests must define a scope'));
6 6
7 var options = { scope: scope }; 7 var options = { scope: scope };
8 return service_worker_unregister(test, scope) 8 return service_worker_unregister(test, scope)
9 .then(function() { 9 .then(function() {
10 return navigator.serviceWorker.register(url, options); 10 return navigator.serviceWorker.register(url, options);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 HTTP_REMOTE_ORIGIN: 'http://' + REMOTE_HOST + ':' + HTTP_PORT, 240 HTTP_REMOTE_ORIGIN: 'http://' + REMOTE_HOST + ':' + HTTP_PORT,
241 HTTPS_REMOTE_ORIGIN: 'https://' + REMOTE_HOST + ':' + HTTPS_PORT, 241 HTTPS_REMOTE_ORIGIN: 'https://' + REMOTE_HOST + ':' + HTTPS_PORT,
242 UNAUTHENTICATED_ORIGIN: 'http://' + UNAUTHENTICATED_HOST + ':' + HTTP_PORT 242 UNAUTHENTICATED_ORIGIN: 'http://' + UNAUTHENTICATED_HOST + ':' + HTTP_PORT
243 }; 243 };
244 } 244 }
245 245
246 function base_path() { 246 function base_path() {
247 return location.pathname.replace(/\/[^\/]*$/, '/'); 247 return location.pathname.replace(/\/[^\/]*$/, '/');
248 } 248 }
249 249
250 function test_login(test, origin, username, password) { 250 function test_login(test, origin, username, password, cookie) {
251 return new Promise(function(resolve, reject) { 251 return new Promise(function(resolve, reject) {
252 with_iframe( 252 with_iframe(
253 origin + base_path() + 253 origin + base_path() +
254 'resources/fetch-access-control-login.html') 254 'resources/fetch-access-control-login.html')
255 .then(test.step_func(function(frame) { 255 .then(test.step_func(function(frame) {
256 var channel = new MessageChannel(); 256 var channel = new MessageChannel();
257 channel.port1.onmessage = test.step_func(function() { 257 channel.port1.onmessage = test.step_func(function() {
258 unload_iframe(frame).catch(function() {}); 258 unload_iframe(frame).catch(function() {});
259 resolve(); 259 resolve();
260 }); 260 });
261 frame.contentWindow.postMessage( 261 frame.contentWindow.postMessage(
262 {username: username, password: password}, 262 {username: username, password: password, cookie: cookie},
263 [channel.port2], origin); 263 [channel.port2], origin);
264 })); 264 }));
265 }); 265 });
266 } 266 }
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/serviceworker/resources/fetch-access-control-util.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698