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

Unified Diff: LayoutTests/fast/frames/sandboxed-iframe-navigation-top-by-name-denied.html

Issue 1126253007: Block modal dialogs inside sandboxes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: WebSandboxFlags. Created 5 years, 7 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
Index: LayoutTests/fast/frames/sandboxed-iframe-navigation-top-by-name-denied.html
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-navigation-top-by-name-denied.html b/LayoutTests/fast/frames/sandboxed-iframe-navigation-top-by-name-denied.html
index 83a710a2df938bfc4d54f97d92efbf803a438bfb..c95f900a496e109fecdb2e3f5fd4a26ee22540af 100644
--- a/LayoutTests/fast/frames/sandboxed-iframe-navigation-top-by-name-denied.html
+++ b/LayoutTests/fast/frames/sandboxed-iframe-navigation-top-by-name-denied.html
@@ -1,16 +1,31 @@
<html>
<head>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<script>
-if (window.testRunner)
- testRunner.dumpAsText();
-window.name = "target"
+ var test = async_test("Sandboxed frame cannot navigate top-level browsing context by name.");
+
+ window.addEventListener("message", test.step_func(function (e) {
+ assert_equals(undefined, e.data["target"]);
+ assert_equals(undefined, e.data["_top"]);
+ assert_equals(undefined, e.data["_parent"]);
+ assert_equals(undefined, e.data["_blank"]);
+
+ test.done();
+ }));
</script>
</head>
<body>
-<p>This test verifies that a sandboxed IFrame cannot navigate the top-level
-frame without allow-top-navigation. This test passes if the navigation does
-not occur.</p>
<iframe sandbox="allow-scripts"
- src="resources/navigate-top-by-name-to-fail.html">
+ srcdoc="
+<script>
+ window.top.postMessage({
+ 'target': window.open('fail-and-notify-done.html', 'target'),
+ '_top': window.open('fail-and-notify-done.html', '_top'),
+ '_parent': window.open('fail-and-notify-done.html', '_parent'),
+ '_blank': window.open('fail-and-notify-done.html', '_blank'),
+ }, '*');
+</script>
+ ">
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698