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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/sandboxed-opener-can-close-window.html

Issue 2399713002: window.close() should work from a sandboxed iframe if iframe is opener (Closed)
Patch Set: +close() test Created 4 years, 1 month 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
Index: third_party/WebKit/LayoutTests/http/tests/security/sandboxed-opener-can-close-window.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-when-allowed.html b/third_party/WebKit/LayoutTests/http/tests/security/sandboxed-opener-can-close-window.html
similarity index 52%
copy from third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-when-allowed.html
copy to third_party/WebKit/LayoutTests/http/tests/security/sandboxed-opener-can-close-window.html
index 26e581024bb74474144180ea9cd9b7b1807e4792..fa878452d628142073abacdf97e6b31677d16242 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/popup-allowed-by-sandbox-when-allowed.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/sandboxed-opener-can-close-window.html
@@ -1,16 +1,19 @@
<script>
if (window.testRunner) {
testRunner.dumpAsText();
- testRunner.waitUntilDone();
+ testRunner.dumpChildFramesAsText();
testRunner.setCanOpenWindows(true);
testRunner.setCloseRemainingWindowsWhenComplete(true);
}
</script>
<p>To run this test outside of DumpRenderTree, please disable your popup blocker!</p>
+<p>This test passes if it doesnt hang.</p>
<iframe sandbox="allow-scripts allow-popups"
src="data:text/html,
- <script>
- var win = window.open('data:text/html,<script>if (window.testRunner) testRunner.notifyDone();<\/script>', '_blank');
- console.log(win ? 'PASS' : 'FAIL');
- </script>"
+ <body><script>
+ var win = window.open('data:text/html,', '_blank');
+ win.close();
+ document.body.appendChild(
+ document.createTextNode(win.closed ? 'PASS' : 'FAIL'));
+ </script></body>"
></iframe>

Powered by Google App Engine
This is Rietveld 408576698