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 if (window.testRunner) { | 13 window.addEventListener('message', function () |
14 setTimeout(pollForTest, 1); | 14 { |
15 } else { | 15 runTest(); |
16 log("To run the test, click the button below when the opened win
dow finishes loading."); | 16 testRunner.notifyDone(); |
17 var button = document.createElement("button"); | 17 }); |
18 button.appendChild(document.createTextNode("Run Test")); | |
19 button.onclick = runTest; | |
20 document.body.appendChild(button); | |
21 } | |
22 } | |
23 | |
24 pollForTest = function() | |
25 { | |
26 if (!testRunner.globalFlag) { | |
27 setTimeout(pollForTest, 1); | |
28 return; | |
29 } | |
30 runTest(); | |
31 testRunner.notifyDone(); | |
32 } | 18 } |
33 | 19 |
34 runTest = function() | 20 runTest = function() |
35 { | 21 { |
36 try { | 22 try { |
37 window[0].document.getElementById('accessMe').innerHTML = "FAIL:
Cross frame access to a data: URL embed in a frame on a foreign domain allowed.
"; | 23 window[0].document.getElementById('accessMe').innerHTML = "FAIL:
Cross frame access to a data: URL embed in a frame on a foreign domain allowed.
"; |
38 log("FAIL: Cross frame access to a data: URL embed in a frame on
a foreign domain allowed."); | 24 log("FAIL: Cross frame access to a data: URL embed in a frame on
a foreign domain allowed."); |
39 return; | 25 return; |
40 } catch (e) { | 26 } catch (e) { |
41 } | 27 } |
42 log("PASS: Cross frame access to a data: URL embed in a frame on a f
oreign domain denied!"); | 28 log("PASS: Cross frame access to a data: URL embed in a frame on a f
oreign domain denied!"); |
43 } | 29 } |
44 </script> | 30 </script> |
45 | 31 |
46 </head> | 32 </head> |
47 <body> | 33 <body> |
48 <p>Opener frame</p> | 34 <p>Opener frame</p> |
49 <iframe src="http://localhost:8000/security/dataURL/resources/foreign-domain
-data-url-window-location.html" style="width: 400px; height:200px;"></iframe> | 35 <iframe src="http://localhost:8000/security/dataURL/resources/foreign-domain
-data-url-window-location.html" style="width: 400px; height:200px;"></iframe> |
50 <pre id="console"></pre> | 36 <pre id="console"></pre> |
51 </body> | 37 </body> |
52 </html> | 38 </html> |
OLD | NEW |