Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/fetch/chromium/discarded-window.html

Issue 2713413002: Blink bindings: use v8 to enforce method call access checks (Closed)
Patch Set: Restore comment Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/aboutBlank/xss-DENIED-set-opener-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/aboutBlank/xss-DENIED-set-opener-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698