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

Side by Side Diff: LayoutTests/fast/frames/sandboxed-iframe-history-denied.html

Issue 14198015: Deny cross-origin access to 'window.history'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/frames/sandboxed-iframe-history-denied-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script> 3 <script>
4 if (window.testRunner) { 4 if (window.testRunner) {
5 testRunner.dumpAsText(); 5 testRunner.dumpAsText();
6 testRunner.waitUntilDone(); 6 testRunner.waitUntilDone();
7 } 7 }
8 8
9 window.unload = function() { 9 function loaded() {
10 alert("FAIL"); 10 if (window.testRunner)
11 } 11 testRunner.notifyDone();
12
13 window.onload = function() {
14 // There's no way to write a test that determinstically fails because the
15 // history API is asynchronous. There's no way to know whether the
16 // asynchronous haven't yet happened or never will. Consequently, we just
17 // wait for a bit.
18 setTimeout(function() {
19 alert("PASS");
20 if (window.testRunner)
21 testRunner.notifyDone();
22 }, 20);
23 } 12 }
24 </script> 13 </script>
25 </head> 14 </head>
26 <body> 15 <body>
27 <p>This test verifies that a sandboxed IFrame cannot navigate the top-level fram e using the history API.</p> 16 <p>This test verifies that a sandboxed IFrame cannot access the history object of the top-level frame.
28 <iframe sandbox="allow-scripts" src="data:text/html,<script>top.history.back()</ script>"> 17 It passes if a console error is present, noting that the inner frame cannot ac cess the outer.</p>
29 <iframe sandbox="allow-scripts" src="data:text/html,<script>top.history.forward( )</script>"> 18 <iframe sandbox="allow-scripts" src="data:text/html,<script>top.history</script> " onload="loaded()">
30 <iframe sandbox="allow-scripts" src="data:text/html,<script>top.history.go(-1)</ script>">
31 </body> 19 </body>
32 </html> 20 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/frames/sandboxed-iframe-history-denied-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698