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

Unified Diff: LayoutTests/fast/dom/navigator-detached-by-navigation.html

Issue 1308723003: DOMWindow::navigator should return navigator w/o frame when detached. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | Source/core/frame/LocalDOMWindow.cpp » ('j') | Source/core/frame/LocalDOMWindow.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/navigator-detached-by-navigation.html
diff --git a/LayoutTests/fast/dom/navigator-detached-by-navigation.html b/LayoutTests/fast/dom/navigator-detached-by-navigation.html
new file mode 100644
index 0000000000000000000000000000000000000000..df33962f1c7f2b4e4e63fbcc7407af894e9062bc
--- /dev/null
+++ b/LayoutTests/fast/dom/navigator-detached-by-navigation.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+</head>
+<body>
+ <iframe id="subframe" src="about:blank"></iframe>
+<script>
+promise_test(function(t) {
+ var iframe = document.querySelector("#subframe");
+ var f = iframe.contentWindow.Function;
+ function get_navigator() {
+ return f("return navigator")();
+ }
+ return new Promise(function(resolve) {
+ assert_equals(iframe.contentWindow.navigator, get_navigator());
+ iframe.src = "resources/a.html";
+ iframe.onload = resolve;
+ }).then(function() {
+ assert_equals(get_navigator(), null);
+ });
+ });
+</script>
+
+</body>
+</html>
« no previous file with comments | « no previous file | Source/core/frame/LocalDOMWindow.cpp » ('j') | Source/core/frame/LocalDOMWindow.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698