| Index: LayoutTests/http/tests/security/resources/cross-frame-iframe-for-parent-isolated-world.html
|
| diff --git a/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-parent-isolated-world.html b/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-parent-isolated-world.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f0e31a52b39884d898f5cbf035d5d1a655fe145b
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-parent-isolated-world.html
|
| @@ -0,0 +1,33 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<body>
|
| +<script>
|
| +testRunner.setIsolatedWorldSecurityOrigin(2, 'chrome-extension://123');
|
| +runTestInWorld(2, 'accessParentDocument');
|
| +
|
| +function runTestInWorld(worldId, funcName)
|
| +{
|
| + testRunner.evaluateScriptInIsolatedWorld(
|
| + worldId, String(eval(funcName)) + "\n" + funcName + "();");
|
| +}
|
| +
|
| +function accessParentDocument()
|
| +{
|
| + function debug(message) {
|
| + window.parent.postMessage(JSON.stringify({ 'type' : 'debug', 'message' : message }), '*');
|
| + }
|
| + function finish() {
|
| + window.parent.postMessage(JSON.stringify({ 'type' : 'finish' }), '*');
|
| + }
|
| + var description = 'Parent document access from isolated world is not allowed.';
|
| + try {
|
| + var doc = window.parent.document;
|
| + debug('FAIL ' + description);
|
| + } catch (e) {
|
| + debug('PASS ' + description);
|
| + }
|
| + finish();
|
| +}
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|