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