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';
21 testStatus
.innerHTML
= 'FAIL: frames not navigated properly';
23 if (window
.testRunner
)
24 window
.testRunner
.notifyDone();
31 if (navigatedFrames
== 10)
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
"PASS
" on success.
</p>
51 <iframe src=
"resources/sandboxed-iframe-navigation-targetlink.html"
54 <iframe name=
"f1_target" src=
"about:blank"></iframe>
56 <iframe src=
"resources/sandboxed-iframe-navigation-targetlink.html"
59 <iframe name=
"f2_target" src=
"about:blank"></iframe>
61 <iframe src=
"resources/sandboxed-iframe-navigation-targetlink.html"
64 <iframe name=
"f3_target" src=
"about:blank"></iframe>
66 <iframe src=
"resources/sandboxed-iframe-navigation-targetlink.html"
69 <iframe name=
"f4_target" src=
"about:blank"></iframe>
71 <iframe src=
"resources/sandboxed-iframe-navigation-targetlink.html"
74 <iframe name=
"f5_target" src=
"about:blank"></iframe>
76 <iframe src=
"resources/sandboxed-iframe-navigation-targetlink.html"
78 sandbox=
"allow-scripts allow-same-origin">
80 <iframe name=
"sandboxed_target" src=
"about:blank"></iframe>
82 <iframe src=
"resources/sandboxed-iframe-navigation-targetlink.html"
85 <iframe name=
"f6_target" src=
"about:blank"></iframe>
87 <iframe src=
"resources/sandboxed-iframe-navigation-targetlink.html"
90 <iframe name=
"f7_target" src=
"about:blank"></iframe>
92 <iframe src=
"resources/sandboxed-iframe-navigation-targetlink.html"
95 <iframe name=
"f8_target" src=
"about:blank"></iframe>
97 <iframe src=
"resources/sandboxed-iframe-navigation-targetlink.html"
100 <iframe name=
"f9_target" src=
"about:blank"></iframe>
102 <iframe src=
"resources/sandboxed-iframe-navigation-targetlink.html"
105 <iframe name=
"f10_target" src=
"about:blank"></iframe>
107 <p id='testStatus'
>FAIL: Script didn't run
</p>