Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / frames / sandboxed-iframe-navigation-targetlink.html
blob4ab57b4a797901228563310a6405e28517b54abf
1 <html>
2 <head>
3 <script>
5 if (window.testRunner) {
6 window.testRunner.dumpAsText();
7 window.testRunner.waitUntilDone();
10 var navigatedFrames = 0;
12 function checkResults()
14 var testStatus = document.getElementById('testStatus');
16 if (self.sandboxed_target.location.href.indexOf('.html') != -1)
17 testStatus.innerHTML = 'FAIL: disallowed frame navigated';
18 else if (navigatedFrames == 10)
19 testStatus.innerHTML = 'PASS';
20 else
21 testStatus.innerHTML = 'FAIL: frames not navigated properly';
23 if (window.testRunner)
24 window.testRunner.notifyDone();
27 function countFrame()
29 ++navigatedFrames;
31 if (navigatedFrames == 10)
32 checkResults();
35 </script>
36 </head>
38 <body>
40 <p>This test verifies that a sandboxed IFrame cannot open a link in
41 another frame using the <code>target</code> attribute of a link.</p>
43 <p>This is done by loading ten non-sandboxed IFrames, and a single
44 sandboxed one. In addition each of these frames have a target frame
45 (so, 22 frames in total). Expect ten frames to be able to open a link
46 in their corresponding target frame, but the sandboxed one
47 to <b>not</b> be one of them.</p>
49 <p>This test will print &quot;PASS&quot; on success.</p>
51 <iframe src="resources/sandboxed-iframe-navigation-targetlink.html"
52 name="f1">
53 </iframe>
54 <iframe name="f1_target" src="about:blank"></iframe>
56 <iframe src="resources/sandboxed-iframe-navigation-targetlink.html"
57 name="f2">
58 </iframe>
59 <iframe name="f2_target" src="about:blank"></iframe>
61 <iframe src="resources/sandboxed-iframe-navigation-targetlink.html"
62 name="f3">
63 </iframe>
64 <iframe name="f3_target" src="about:blank"></iframe>
66 <iframe src="resources/sandboxed-iframe-navigation-targetlink.html"
67 name="f4">
68 </iframe>
69 <iframe name="f4_target" src="about:blank"></iframe>
71 <iframe src="resources/sandboxed-iframe-navigation-targetlink.html"
72 name="f5">
73 </iframe>
74 <iframe name="f5_target" src="about:blank"></iframe>
76 <iframe src="resources/sandboxed-iframe-navigation-targetlink.html"
77 name="sandboxed"
78 sandbox="allow-scripts allow-same-origin">
79 </iframe>
80 <iframe name="sandboxed_target" src="about:blank"></iframe>
82 <iframe src="resources/sandboxed-iframe-navigation-targetlink.html"
83 name="f6">
84 </iframe>
85 <iframe name="f6_target" src="about:blank"></iframe>
87 <iframe src="resources/sandboxed-iframe-navigation-targetlink.html"
88 name="f7">
89 </iframe>
90 <iframe name="f7_target" src="about:blank"></iframe>
92 <iframe src="resources/sandboxed-iframe-navigation-targetlink.html"
93 name="f8">
94 </iframe>
95 <iframe name="f8_target" src="about:blank"></iframe>
97 <iframe src="resources/sandboxed-iframe-navigation-targetlink.html"
98 name="f9">
99 </iframe>
100 <iframe name="f9_target" src="about:blank"></iframe>
102 <iframe src="resources/sandboxed-iframe-navigation-targetlink.html"
103 name="f10">
104 </iframe>
105 <iframe name="f10_target" src="about:blank"></iframe>
107 <p id='testStatus'>FAIL: Script didn't run</p>
108 </body>
109 </html>