OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <script> | 3 <script> |
4 function test() | 4 function test() |
5 { | 5 { |
6 if (window.testRunner) { | 6 if (window.testRunner) { |
7 testRunner.dumpAsText(); | 7 testRunner.dumpAsText(); |
8 var frame = document.getElementById("frame"); | 8 var frame = document.getElementById("frame"); |
9 frame.contentWindow.focus(); | 9 frame.contentWindow.focus(); |
10 testRunner.evaluateScriptInIsolatedWorld(1, "alert('PASS');"); | 10 testRunner.evaluateScriptInIsolatedWorld(1, "console.log('PASS');"); |
11 } else { | 11 } else { |
12 var msg = document.createElement("p"); | 12 var msg = document.createElement("p"); |
13 msg.innerText = "FAIL: Test requires testRunner to run."; | 13 msg.innerText = "FAIL: Test requires testRunner to run."; |
14 document.body.appendChild(msg); | 14 document.body.appendChild(msg); |
15 } | 15 } |
16 } | 16 } |
17 </script> | 17 </script> |
18 <body onload="test()"> | 18 <body onload="test()"> |
19 <p> | 19 <p> |
20 Test that executing scripts in an isolated world works even inside sandboxed | 20 Test that executing scripts in an isolated world works even inside sandboxed |
21 iframes. The test passes, if an alert with the text "PASS" is shown. | 21 iframes. The test passes, if an alert with the text "PASS" is shown. |
22 </p> | 22 </p> |
23 <iframe id="frame" src="resources/fail.html" sandbox="allow-same-origin"></ifram
e> | 23 <iframe id="frame" src="resources/fail.html" sandbox="allow-same-origin"></ifram
e> |
24 </body> | 24 </body> |
25 </html> | 25 </html> |
OLD | NEW |