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
}), '*');
20 window
.parent
.postMessage(JSON
.stringify({ 'type' : 'finish' }), '*');
22 var description
= 'Parent document access from isolated world is not allowed.';
24 var doc
= window
.parent
.document
;
25 debug('FAIL ' + description
);
27 debug('PASS ' + description
);