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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation-manual.html

Issue 2711073002: WPT tests of allow-top-navigation-by-user-activation for iframe@sandbox. (Closed)
Patch Set: Add an async_test for the manual test to test the top-navigation blocking given no user gesture. 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
Index: third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation-manual.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation-manual.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation-manual.html
new file mode 100644
index 0000000000000000000000000000000000000000..4bf8f5b312c4cd613556cece8eaec106255e14ac
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation-manual.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+ <style>
+ iframe { width: 400px; height: 200px;}
+ </style>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ setup({explicit_timeout: true});
+
+ async_test(function(t) {
+ window.addEventListener("message", t.step_func_done(function(e) {
+ assert_equals(e.data, "BLOCKED", "The message should say 'BLOCKED'.");
+ }));
+ }, "The sandboxed iframe should post a message saying the top navigation was blocked when no user gesture.");
+ </script>
+</head>
+<body>
+ <p>This tests that an iframe in sandbox with 'allow-top-navigation-by-user-activation'
+ can navigate the top level page, if it is trigged by a user gesture.</p>
+ <p>Click on the button in the iframe and it should navigate the top page.</p>
+ <iframe id="i" sandbox="allow-scripts allow-top-navigation-by-user-activation" src="support/iframe-that-performs-top-navigation.html"></iframe>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698