Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8826)

Unified Diff: chrome/test/data/extensions/api_test/sandboxed_pages/main.js

Issue 10458063: Add sanbdoxed_pages to allow extension/app pages to be served in a sandboxed, unique origin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CheckCurrentContextAccessToExtensionAPI Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/sandboxed_pages/main.js
diff --git a/chrome/test/data/extensions/api_test/sandboxed_pages/main.js b/chrome/test/data/extensions/api_test/sandboxed_pages/main.js
new file mode 100644
index 0000000000000000000000000000000000000000..a313b114f9f89daf6bcc68ae6b141a370d21a289
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/sandboxed_pages/main.js
@@ -0,0 +1,30 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var secret = 'main_window_secret';
+
+onmessage = function(event) {
+ var sandboxedWindow = event.source;
+ // They can't read our secret.
+ chrome.test.assertEq(undefined, event.data);
+
+ // And we can't read theirs.
+ chrome.test.assertEq(undefined, sandboxedWindow.secret);
+
+ chrome.test.succeed();
+};
+
+onload = function() {
+ chrome.test.runTests([
+ function sandboxedWindow() {
+ var w = window.open('sandboxed.html');
+ },
+
+ function sandboxedFrame() {
+ var iframe = document.createElement('iframe');
+ iframe.src = 'sandboxed.html';
+ document.body.appendChild(iframe);
+ }
+ ]);
+};

Powered by Google App Engine
This is Rietveld 408576698