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

Unified Diff: LayoutTests/http/tests/serviceworker/chromium/frame-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 | LayoutTests/http/tests/serviceworker/chromium/frame-removed.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/serviceworker/chromium/frame-detached-by-navigation.html
diff --git a/LayoutTests/http/tests/serviceworker/chromium/frame-detached-by-navigation.html b/LayoutTests/http/tests/serviceworker/chromium/frame-detached-by-navigation.html
new file mode 100644
index 0000000000000000000000000000000000000000..8d9cf1355f60b4c72a57cf7c3937b88b3f773cf3
--- /dev/null
+++ b/LayoutTests/http/tests/serviceworker/chromium/frame-detached-by-navigation.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>navigator.serviceWorker should return null when frame is detached</title>
+<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().serviceWorker, null);
+ });
+ });
+</script>
+
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/chromium/frame-removed.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698