Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/fetch/chromium/discarded-window.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/chromium/discarded-window.html b/third_party/WebKit/LayoutTests/http/tests/fetch/chromium/discarded-window.html |
| index 2c13c5da28ea065f0f46fdf5b9ef9798e8269057..598f1337bce1f801dbe660e47bf4fa50561eb496 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/fetch/chromium/discarded-window.html |
| +++ b/third_party/WebKit/LayoutTests/http/tests/fetch/chromium/discarded-window.html |
| @@ -1,18 +1,26 @@ |
| <!doctype html> |
| -<iframe id="iframe"></iframe> |
| +<iframe></iframe> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script> |
| -test(function(test) { |
| - var iframe = document.getElementById('iframe'); |
| - var w = iframe.contentWindow; |
| - iframe.remove(); |
| +var fetchTest = async_test("fetch() on discarded window"); |
| - assert_not_equals(w.fetch, undefined, |
| - 'A discarded window should have |fetch| function.'); |
| - // NOTE: This is not explicitly specified as far as I know. This behavior |
| - // may be Blink specific. |
| - assert_equals(w.fetch('/fetch/resources/doctype.html'), undefined, |
| - '|fetch| on a discarded window returns undefined, not a Promise.'); |
| - }); |
| +var iframe = document.querySelector('iframe'); |
| +var w = iframe.contentWindow; |
| +iframe.remove(); |
| + |
| +assert_not_equals(w.fetch, undefined, |
| + 'A discarded window should have |fetch| function.'); |
| + |
| +// NOTE: This is not explicitly specified as far as I know. This behavior |
| +// may be Blink specific. |
| +w.fetch('/fetch/resources/doctype.html').then( |
| + function () { |
| + assert_true(false, "This Promise must always be rejected."); |
|
Yuki
2017/03/01 08:36:17
nit: assert_unreached
No need to fix. Just FYI fo
|
| + }, |
| + fetchTest.step_func(function (e) { |
| + assert_true(e instanceof w.TypeError); |
| + assert_equals(e.message, "Failed to execute 'fetch' on 'Window': The global scope is shutting down."); |
| + fetchTest.done(); |
| + })); |
| </script> |