OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../resources/cross-frame-access.js"></script> | 3 <script src="../resources/cross-frame-access.js"></script> |
4 <script> | 4 <script> |
5 window.onload = function() | 5 window.onload = function() |
6 { | 6 { |
7 if (window.testRunner) { | 7 if (window.testRunner) { |
8 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
9 testRunner.dumpChildFramesAsText(); | 9 testRunner.dumpChildFramesAsText(); |
10 testRunner.waitUntilDone(); | 10 testRunner.waitUntilDone(); |
11 } | 11 } |
12 | 12 |
13 window.addEventListener('message', function () | 13 window.addEventListener('message', function () |
14 { | 14 { |
15 runTest(); | 15 runTest(); |
16 if (window.testRunner) | 16 if (window.testRunner) |
17 testRunner.notifyDone(); | 17 testRunner.notifyDone(); |
18 }); | 18 }); |
| 19 |
| 20 document.getElementById('testFrame').src="http://localhost:8000/secu
rity/javascriptURL/resources/foreign-domain-javascript-url-accessee-iframe.html" |
19 } | 21 } |
20 | 22 |
21 runTest = function() | 23 function runTest() |
22 { | 24 { |
23 try { | 25 try { |
24 window[0][0].document.getElementById('accessMe').innerHTML = "FA
IL: Cross frame access to a javascript: URL embed in a frame on a foreign domain
allowed."; | 26 window[0][0].document.getElementById('accessMe').innerHTML = "FA
IL: Cross frame access to a javascript: URL embed in a frame on a foreign domain
allowed."; |
25 log("FAIL: Cross frame access to a javascript: URL embed in a fr
ame on a foreign domain allowed."); | 27 log("FAIL: Cross frame access to a javascript: URL embed in a fr
ame on a foreign domain allowed."); |
26 return; | 28 return; |
27 } catch (e) { | 29 } catch (e) { |
28 } | 30 } |
29 | 31 |
30 log("PASS: Cross frame access to a javascript: URL embed in a frame
on a foreign domain denied!"); | 32 log("PASS: Cross frame access to a javascript: URL embed in a frame
on a foreign domain denied!"); |
31 } | 33 } |
32 </script> | 34 </script> |
33 </head> | 35 </head> |
34 <body> | 36 <body> |
35 <p>The scenario for this test is that you have an iframe with content from a
foreign domain. In that foreign content | 37 <p>The scenario for this test is that you have an iframe with content from a
foreign domain. In that foreign content |
36 is an iframe which loads a javascript: URL. This tests that this main d
ocument does not have access to that | 38 is an iframe which loads a javascript: URL. This tests that this main d
ocument does not have access to that |
37 javascript: URL loaded iframe.</p> | 39 javascript: URL loaded iframe.</p> |
38 <iframe src="http://localhost:8000/security/javascriptURL/resources/foreign-
domain-javascript-url-accessee-iframe.html" style="width: 400px; height:200px;">
</iframe> | 40 <iframe id="testFrame" style="width: 400px; height:200px;"></iframe> |
39 <pre id="console"></pre> | 41 <pre id="console"></pre> |
40 </body> | 42 </body> |
41 </html> | 43 </html> |
OLD | NEW |