| Index: LayoutTests/http/tests/serviceworker/fetch-frame-resource.html
|
| diff --git a/LayoutTests/http/tests/serviceworker/fetch-frame-resource.html b/LayoutTests/http/tests/serviceworker/fetch-frame-resource.html
|
| index caec13af4bbccbdcdbd51fb563e58219f4ecfb1a..4de0f2f7223b945fc6c514736ffb679b61157ff2 100644
|
| --- a/LayoutTests/http/tests/serviceworker/fetch-frame-resource.html
|
| +++ b/LayoutTests/http/tests/serviceworker/fetch-frame-resource.html
|
| @@ -42,21 +42,27 @@ async_test(function(t) {
|
| return wait_for_state(t, reg.installing, 'activated');
|
| })
|
| .then(function() {
|
| - return with_iframe(
|
| + var frame = document.createElement('iframe');
|
| + frame.src =
|
| scope + '?mode=cors&url=' +
|
| encodeURIComponent(host_info['HTTP_REMOTE_ORIGIN'] + path +
|
| - '?ACAOrigin=' + host_info['HTTP_ORIGIN']));
|
| + '?ACAOrigin=' + host_info['HTTP_ORIGIN']);
|
| + document.body.appendChild(frame);
|
| + // We can't catch the network error on iframe. So we use the timer.
|
| + return new Promise(function(resolve) {
|
| + setTimeout(function() { resolve(frame); }, 1000);
|
| + });
|
| })
|
| .then(function(frame) {
|
| - assert_not_equals(
|
| + assert_equals(
|
| frame.contentDocument.body.textContent,
|
| '',
|
| - 'CORS type response could be loaded in the iframe.');
|
| + 'CORS type response could not be loaded in the iframe.');
|
| frame.remove();
|
| return service_worker_unregister_and_done(t, scope);
|
| })
|
| .catch(unreached_rejection(t));
|
| - }, 'CORS type response could be loaded in the iframe.');
|
| + }, 'CORS type response could not be loaded in the iframe.');
|
|
|
| async_test(function(t) {
|
| var scope = 'resources/fetch-frame-resource/frame-opaque';
|
| @@ -118,24 +124,25 @@ async_test(function(t) {
|
| return wait_for_state(t, reg.installing, 'activated');
|
| })
|
| .then(function() {
|
| + var win = window.open(
|
| + scope + '?mode=cors&url=' +
|
| + encodeURIComponent(host_info['HTTP_REMOTE_ORIGIN'] + path +
|
| + '?ACAOrigin=' + host_info['HTTP_ORIGIN']));
|
| + // We can't catch the network error on window. So we use the timer.
|
| return new Promise(function(resolve) {
|
| - var win = window.open(
|
| - scope + '?mode=cors&url=' +
|
| - encodeURIComponent(host_info['HTTP_REMOTE_ORIGIN'] + path +
|
| - '?ACAOrigin=' + host_info['HTTP_ORIGIN']));
|
| - win.onload = function() { resolve(win); };
|
| + setTimeout(function() { resolve(win); }, 1000);
|
| });
|
| })
|
| .then(function(win) {
|
| - assert_not_equals(
|
| + assert_equals(
|
| win.document.body.textContent,
|
| '',
|
| - 'CORS type response could be loaded in the new window.');
|
| + 'CORS type response could not be loaded in the new window.');
|
| win.close();
|
| return service_worker_unregister_and_done(t, scope);
|
| })
|
| .catch(unreached_rejection(t));
|
| - }, 'CORS type response could be loaded in the new window.');
|
| + }, 'CORS type response could not be loaded in the new window.');
|
|
|
| async_test(function(t) {
|
| var scope = 'resources/fetch-frame-resource/window-opaque';
|
| @@ -156,7 +163,7 @@ async_test(function(t) {
|
| assert_equals(
|
| win.document.body.textContent,
|
| '',
|
| - 'CORS type response could not be loaded in the new window.');
|
| + 'Opaque type response could not be loaded in the new window.');
|
| win.close();
|
| return service_worker_unregister_and_done(t, scope);
|
| })
|
|
|