OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Service Worker: fetch()</title> | 2 <title>Service Worker: 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"></script> | 5 <script src="resources/test-helpers.js"></script> |
6 <body> | 6 <body> |
7 <script> | 7 <script> |
8 var SCOPE = 'resources/fetch-access-control-iframe.html'; | 8 var SCOPE = 'resources/fetch-access-control-iframe.html'; |
9 var BASE_URL = 'http://127.0.0.1:8000/serviceworker/resources/fetch-access-contr
ol.php?'; | 9 var BASE_URL = 'http://127.0.0.1:8000/serviceworker/resources/fetch-access-contr
ol.php?'; |
10 var OTHER_BASE_URL = 'http://localhost:8000/serviceworker/resources/fetch-access
-control.php?'; | 10 var OTHER_BASE_URL = 'http://localhost:8000/serviceworker/resources/fetch-access
-control.php?'; |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 var frameWindow = {}; | 511 var frameWindow = {}; |
512 var counter = 0; | 512 var counter = 0; |
513 window.addEventListener('message', test.step_func(onMessage), false); | 513 window.addEventListener('message', test.step_func(onMessage), false); |
514 | 514 |
515 Promise.all([login1, login2]) | 515 Promise.all([login1, login2]) |
516 .then(function() { | 516 .then(function() { |
517 return service_worker_unregister_and_register(test, | 517 return service_worker_unregister_and_register(test, |
518 workerScript, | 518 workerScript, |
519 SCOPE); | 519 SCOPE); |
520 }) | 520 }) |
| 521 .then(function(registration) { |
| 522 return wait_for_update(test, registration); |
| 523 }) |
521 .then(function(sw) { | 524 .then(function(sw) { |
522 worker = sw; | 525 worker = sw; |
523 var messageChannel = new MessageChannel(); | 526 var messageChannel = new MessageChannel(); |
524 messageChannel.port1.onmessage = test.step_func(onWorkerMessage); | 527 messageChannel.port1.onmessage = test.step_func(onWorkerMessage); |
525 sw.postMessage( | 528 sw.postMessage( |
526 {port: messageChannel.port2}, [messageChannel.port2]); | 529 {port: messageChannel.port2}, [messageChannel.port2]); |
527 return wait_for_state(test, sw, 'activated'); | 530 return wait_for_state(test, sw, 'activated'); |
528 }) | 531 }) |
529 .then(function() { return with_iframe(SCOPE); }) | 532 .then(function() { return with_iframe(SCOPE); }) |
530 .then(function(frame) { | 533 .then(function(frame) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 })) | 592 })) |
590 .then(test.step_func(function() { | 593 .then(test.step_func(function() { |
591 frameWindow.postMessage( | 594 frameWindow.postMessage( |
592 {url: TEST_TARGETS[counter][0]}, | 595 {url: TEST_TARGETS[counter][0]}, |
593 IFRAME_ORIGIN); | 596 IFRAME_ORIGIN); |
594 })); | 597 })); |
595 } | 598 } |
596 }); | 599 }); |
597 </script> | 600 </script> |
598 </body> | 601 </body> |
OLD | NEW |