OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Service Worker: FetchEvent for HTMLImports</title> | 2 <title>Service Worker: FetchEvent for HTMLImports</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 <script> | 6 <script> |
7 async_test(function(t) { | 7 async_test(function(t) { |
8 var SCOPE = 'resources/fetch-request-html-imports-iframe.html'; | 8 var SCOPE = 'resources/fetch-request-html-imports-iframe.html'; |
9 var SCRIPT = 'resources/fetch-request-html-imports-worker.js'; | 9 var SCRIPT = 'resources/fetch-request-html-imports-worker.js'; |
10 var host_info = get_host_info(); | 10 var host_info = get_host_info(); |
11 service_worker_unregister_and_register(t, SCRIPT, SCOPE) | 11 service_worker_unregister_and_register(t, SCRIPT, SCOPE) |
12 .then(function(registration) { | 12 .then(function(registration) { |
13 return wait_for_activated(t, registration); | 13 return wait_for_state(t, registration.installing, 'activated'); |
14 }) | 14 }) |
15 .then(function() { return with_iframe(SCOPE); }) | 15 .then(function() { return with_iframe(SCOPE); }) |
16 .then(function(frame) { | 16 .then(function(frame) { |
17 var same = frame.contentWindow.document.getElementById("same").import; | 17 var same = frame.contentWindow.document.getElementById("same").import; |
18 var same_same = same.getElementById("same-same").import; | 18 var same_same = same.getElementById("same-same").import; |
19 var same_other = same.getElementById("same-other").import; | 19 var same_other = same.getElementById("same-other").import; |
20 var other = | 20 var other = |
21 frame.contentWindow.document.getElementById("other").import; | 21 frame.contentWindow.document.getElementById("other").import; |
22 var other_same = other.getElementById("other-same").import; | 22 var other_same = other.getElementById("other-same").import; |
23 var other_other = other.getElementById("other-other").import; | 23 var other_other = other.getElementById("other-other").import; |
(...skipping 27 matching lines...) Expand all Loading... |
51 other_other.body.innerText, | 51 other_other.body.innerText, |
52 'mode=cors credentials=omit', | 52 'mode=cors credentials=omit', |
53 'The request mode and credentials for other origin HTMLImport ' + | 53 'The request mode and credentials for other origin HTMLImport ' + |
54 'from other origin HTMLImport must be set correctly.'); | 54 'from other origin HTMLImport must be set correctly.'); |
55 | 55 |
56 service_worker_unregister_and_done(t, SCOPE); | 56 service_worker_unregister_and_done(t, SCOPE); |
57 }) | 57 }) |
58 .catch(unreached_rejection(t)); | 58 .catch(unreached_rejection(t)); |
59 }, 'Verify the FetchEvent for HTMLImports'); | 59 }, 'Verify the FetchEvent for HTMLImports'); |
60 </script> | 60 </script> |
OLD | NEW |