| OLD | NEW |
| (Empty) |
| 1 <!doctype html> | |
| 2 <body> | |
| 3 Test should log two "PASS" messages to the console. | |
| 4 <script> | |
| 5 if (window.testRunner) { | |
| 6 testRunner.dumpAsText(); | |
| 7 testRunner.waitUntilDone(); | |
| 8 } | |
| 9 | |
| 10 var frame = document.body.appendChild(document.createElement("iframe")); | |
| 11 frame.src = "https://localhost:8443/security/resources/doc-with-iframe.html"; | |
| 12 frame.onload = function() { | |
| 13 frame.onload = null; | |
| 14 target = frame.contentWindow; | |
| 15 target[0].location = "data:text/html,<script>name='eval'</scr" + "ipt>"; | |
| 16 setTimeout(function() { | |
| 17 try { | |
| 18 Object.getOwnPropertyDescriptor(target, "eval").value("console.log('
FAIL: Access check bypassed.')"); | |
| 19 } catch (e) { | |
| 20 console.log("PASS: Access check triggered"); | |
| 21 } | |
| 22 target[0].location = "data:text/html,<script>name='myEval'</scr" + "ipt>
"; | |
| 23 setTimeout(function() { | |
| 24 try { | |
| 25 target.myEval("console.log('FAIL: Access check bypassed.')"); | |
| 26 } catch (e) { | |
| 27 console.log("PASS: Access check triggered"); | |
| 28 } | |
| 29 if (window.testRunner) | |
| 30 testRunner.notifyDone(); | |
| 31 }, 500); | |
| 32 }, 500); | |
| 33 } | |
| 34 </script> | |
| 35 </body> | |
| OLD | NEW |