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

Side by Side Diff: chrome/test/data/extensions/api_test/sandboxed_pages/sandboxed.html

Issue 19783003: Rewrite ExtensionApiTest.SandboxedPages to catch exceptions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/extensions/api_test/sandboxed_pages/main.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 This page should be sandboxed. 1 This page should be sandboxed.
2 2
3 <script> 3 <script>
4 // We're not served with the extension default CSP, we can use inline script. 4 // We're not served with the extension default CSP, we can use inline script.
5 onload = function() { 5 onload = function() {
6 var secret = 'sandboxed_window_secret'; 6 var secret = 'sandboxed_window_secret';
7 7
8 if (chrome.extension) { 8 if (chrome.extension) {
9 chrome.test.notifyFail('Extension APIs should not be injected.'); 9 chrome.test.notifyFail('Extension APIs should not be injected.');
10 return; 10 return;
11 } 11 }
12 12
13 var mainWindow = window.opener || window.top; 13 var mainWindow = window.opener || window.top;
14 mainWindow.postMessage(mainWindow.secret, '*'); 14 var mainWindowSecret = undefined;
15 try {
16 mainWindowSecret = mainWindow.secret;
17 } catch(e) {}
18 mainWindow.postMessage(mainWindowSecret, '*');
15 }; 19 };
16 </script> 20 </script>
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/sandboxed_pages/main.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698