Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / security / resources / cross-frame-iframe-for-parent-isolated-world.html
blobf0e31a52b39884d898f5cbf035d5d1a655fe145b
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script>
5 testRunner.setIsolatedWorldSecurityOrigin(2, 'chrome-extension://123');
6 runTestInWorld(2, 'accessParentDocument');
8 function runTestInWorld(worldId, funcName)
10 testRunner.evaluateScriptInIsolatedWorld(
11 worldId, String(eval(funcName)) + "\n" + funcName + "();");
14 function accessParentDocument()
16 function debug(message) {
17 window.parent.postMessage(JSON.stringify({ 'type' : 'debug', 'message' : message }), '*');
19 function finish() {
20 window.parent.postMessage(JSON.stringify({ 'type' : 'finish' }), '*');
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);
29 finish();
31 </script>
32 </body>
33 </html>