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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture.html

Issue 2645733002: Add an 'allow-top-navigation-with-user-interaction' sandbox flag. (Closed)
Patch Set: Fix the tests finally! Created 3 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <style>
4 iframe { width: 400px; height: 200px;}
5 </style>
6 <script>
7 if (window.testRunner) {
8 testRunner.dumpAsText();
9 testRunner.waitUntilDone();
10 }
11
12 function loaded()
13 {
14 document.getElementsByTagName('h4')[0].innerHTML = document.domain;
15 var iframe = document.getElementById("i");
16 // The iframe uses eventSender to emulate a user navigatation, which requires absolute coordinates.
17 // Because the iframe is cross-origin, it can't get the offsets itse lf, so leak them.
18 frames[0].postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, " *");
19 }
20 </script>
21 </head>
22 <body onload="loaded();">
23 <p>This tests that an iframe in sandbox with 'allow-top-navigation-with-user -activation'
24 can navigate the top level page, if it is trigged by a user gesture.</p>
25 <h4>DOMAIN</h4>
26 <iframe id="i" sandbox="allow-scripts allow-top-navigation-with-user-activat ion" src="http://localhost:8000/security/frameNavigation/resources/iframe-that-p erforms-parent-navigation.html"></iframe>
27 </body>
28 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698