| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Service Worker: Fetch for the frame loading.</title> | 2 <title>Service Worker: Fetch for the frame loading.</title> |
| 3 <meta name=timeout content=long> | 3 <meta name=timeout content=long> |
| 4 <script src="/resources/testharness.js"></script> | 4 <script src="/resources/testharness.js"></script> |
| 5 <script src="/resources/testharnessreport.js"></script> | 5 <script src="/resources/testharnessreport.js"></script> |
| 6 <script src="resources/get-host-info.sub.js"></script> | 6 <script src="resources/get-host-info.sub.js"></script> |
| 7 <script src="resources/test-helpers.sub.js"></script> | 7 <script src="resources/test-helpers.sub.js"></script> |
| 8 <body> | 8 <body> |
| 9 <script> | 9 <script> |
| 10 var worker = 'resources/fetch-rewrite-worker.js'; | 10 var worker = 'resources/fetch-rewrite-worker.js'; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 var frame; | 103 var frame; |
| 104 service_worker_unregister_and_register(t, worker, scope) | 104 service_worker_unregister_and_register(t, worker, scope) |
| 105 .then(function(reg) { | 105 .then(function(reg) { |
| 106 return wait_for_state(t, reg.installing, 'activated'); | 106 return wait_for_state(t, reg.installing, 'activated'); |
| 107 }) | 107 }) |
| 108 .then(function() { | 108 .then(function() { |
| 109 frame = document.createElement('iframe'); | 109 frame = document.createElement('iframe'); |
| 110 frame.src = | 110 frame.src = |
| 111 scope + '?mode=cors&url=' + | 111 scope + '?mode=cors&url=' + |
| 112 encodeURIComponent(host_info['HTTPS_REMOTE_ORIGIN'] + path + | 112 encodeURIComponent(host_info['HTTPS_REMOTE_ORIGIN'] + path + |
| 113 '?ACAOrigin=' + host_info['HTTPS_ORIGIN']); | 113 '?ACAOrigin=' + host_info['HTTPS_ORIGIN'] + |
| 114 '&ACACredentials=true'); |
| 114 document.body.appendChild(frame); | 115 document.body.appendChild(frame); |
| 115 return getLoadedFrameAsObject(frame); | 116 return getLoadedFrameAsObject(frame); |
| 116 }) | 117 }) |
| 117 .then(function(result) { | 118 .then(function(result) { |
| 118 assert_equals( | 119 assert_equals( |
| 119 result.jsonpResult, | 120 result.jsonpResult, |
| 120 'success', | 121 'success', |
| 121 'CORS type response could be loaded in the iframe.'); | 122 'CORS type response could be loaded in the iframe.'); |
| 122 frame.remove(); | 123 frame.remove(); |
| 123 return service_worker_unregister_and_done(t, scope); | 124 return service_worker_unregister_and_done(t, scope); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 async_test(function(t) { | 177 async_test(function(t) { |
| 177 var scope = 'resources/fetch-frame-resource/window-cors'; | 178 var scope = 'resources/fetch-frame-resource/window-cors'; |
| 178 service_worker_unregister_and_register(t, worker, scope) | 179 service_worker_unregister_and_register(t, worker, scope) |
| 179 .then(function(reg) { | 180 .then(function(reg) { |
| 180 return wait_for_state(t, reg.installing, 'activated'); | 181 return wait_for_state(t, reg.installing, 'activated'); |
| 181 }) | 182 }) |
| 182 .then(function() { | 183 .then(function() { |
| 183 var win = window.open( | 184 var win = window.open( |
| 184 scope + '?mode=cors&url=' + | 185 scope + '?mode=cors&url=' + |
| 185 encodeURIComponent(host_info['HTTPS_REMOTE_ORIGIN'] + path + | 186 encodeURIComponent(host_info['HTTPS_REMOTE_ORIGIN'] + path + |
| 186 '?ACAOrigin=' + host_info['HTTPS_ORIGIN'])); | 187 '?ACAOrigin=' + host_info['HTTPS_ORIGIN'] + |
| 188 '&ACACredentials=true')); |
| 187 return getLoadedWindowAsObject(win); | 189 return getLoadedWindowAsObject(win); |
| 188 }) | 190 }) |
| 189 .then(function(result) { | 191 .then(function(result) { |
| 190 assert_equals( | 192 assert_equals( |
| 191 result.jsonpResult, | 193 result.jsonpResult, |
| 192 'success', | 194 'success', |
| 193 'CORS type response could be loaded in the new window.'); | 195 'CORS type response could be loaded in the new window.'); |
| 194 return service_worker_unregister_and_done(t, scope); | 196 return service_worker_unregister_and_done(t, scope); |
| 195 }) | 197 }) |
| 196 .catch(unreached_rejection(t)); | 198 .catch(unreached_rejection(t)); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 212 assert_equals( | 214 assert_equals( |
| 213 result, | 215 result, |
| 214 null, | 216 null, |
| 215 'Opaque type response could not be loaded in the new window.'); | 217 'Opaque type response could not be loaded in the new window.'); |
| 216 return service_worker_unregister_and_done(t, scope); | 218 return service_worker_unregister_and_done(t, scope); |
| 217 }) | 219 }) |
| 218 .catch(unreached_rejection(t)); | 220 .catch(unreached_rejection(t)); |
| 219 }, 'Opaque type response could not be loaded in the new window.'); | 221 }, 'Opaque type response could not be loaded in the new window.'); |
| 220 </script> | 222 </script> |
| 221 </body> | 223 </body> |
| OLD | NEW |