1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 var secret = 'main_window_secret';
7 onmessage = function(event) {
8 var sandboxedWindow = event.source;
9 // They can't read our secret.
10 chrome.test.assertEq(undefined, event.data);
12 // And we can't read theirs.
13 sandboxedWindowSecret = undefined;
15 sandboxedWindowSecret = sandboxedWindow.secret;
17 chrome.test.assertEq(undefined, sandboxedWindowSecret);
19 chrome.test.succeed();
23 chrome.test.runTests([
24 function sandboxedWindow() {
25 var w = window.open('sandboxed.html');
28 function sandboxedFrame() {
29 var iframe = document.createElement('iframe');
30 iframe.src = 'sandboxed.html';
31 document.body.appendChild(iframe);