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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/support/iframe-that-performs-top-navigation.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/support/iframe-that-performs-top-navigation.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/support/iframe-that-performs-top-navigation.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/support/iframe-that-performs-top-navigation.html
new file mode 100644
index 0000000000000000000000000000000000000000..74c7a1ee2407d9b8dfe5b6a7c842578e29b85275
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/support/iframe-that-performs-top-navigation.html
@@ -0,0 +1,20 @@
+<html>
+<head>
+ <script>
+ function performTest()
+ {
+ try {
+ top.location = "navigation-changed-iframe.html";
+ } catch(e) {
+ top.postMessage("BLOCKED", "*");
+ }
+ }
+ </script>
+</head>
+<body onload="performTest();">
+ <p>This doc tried to navigate the top page when loaded, which should fail since it's not trigged by user activation while in a sandboxed frame with 'allow-top-navigtaion-by-user-activation'. <br> <br>
+ If you click the button below, the top navigation should succeed with the new page saying "PASSED: Navigation succeeded.".
+ </p>
+ <button id="b" onclick="performTest();">Navigate the top page</button>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698