Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
|
jochen (gone - plz use gerrit)
2015/09/14 08:56:35
nit. add <!DOCTYPE html>
epertoso
2015/09/14 09:13:50
Done.
| |
| 2 <body> | |
| 3 <script> | |
| 4 testRunner.setIsolatedWorldSecurityOrigin(2, 'chrome-extension://123'); | |
| 5 runTestInWorld(2, 'accessParentDocument'); | |
| 6 | |
| 7 function runTestInWorld(worldId, funcName) | |
| 8 { | |
| 9 testRunner.evaluateScriptInIsolatedWorld( | |
| 10 worldId, String(eval(funcName)) + "\n" + funcName + "();"); | |
| 11 } | |
| 12 | |
| 13 function accessParentDocument() | |
| 14 { | |
| 15 function debug(message) { | |
| 16 window.parent.postMessage(JSON.stringify({ 'type' : 'debug', 'message' : message }), '*'); | |
| 17 } | |
| 18 function finish() { | |
| 19 window.parent.postMessage(JSON.stringify({ 'type' : 'finish' }), '*'); | |
| 20 } | |
| 21 var description = 'Parent document access from isolated world is not allowed .' | |
| 22 try { | |
| 23 var doc = window.parent.document; | |
| 24 debug('FAIL ' + description); | |
| 25 } catch (e) { | |
| 26 debug('PASS ' + description); | |
| 27 } | |
| 28 finish(); | |
| 29 } | |
| 30 </script> | |
| 31 </body> | |
| 32 </html> | |
| OLD | NEW |