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

Side by Side Diff: chrome/test/data/extensions/api_test/content_scripts/extension_iframe/iframe.js

Issue 9460002: Convert app_bindings.js to the schema_generated_bindings.js infrastructure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make test extension ID tests pass Created 8 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Simple success test: we want content-script APIs to be available (like 5 // Simple success test: we want content-script APIs to be available (like
6 // sendRequest), but other APIs to be undefined or throw exceptions on access. 6 // sendRequest), but other APIs to be undefined or throw exceptions on access.
7 7
8 function runsWithException(f) { 8 function runsWithException(f) {
9 try { 9 try {
10 var foo = f(); 10 var foo = f();
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 var success = true; 23 var success = true;
24 24
25 // The whole of chrome.storage (arbitrary unprivileged) is unavailable. 25 // The whole of chrome.storage (arbitrary unprivileged) is unavailable.
26 if (chrome.storage) { 26 if (chrome.storage) {
27 console.log('Error: chrome.storage exists, it shouldn\'t.'); 27 console.log('Error: chrome.storage exists, it shouldn\'t.');
28 success = false; 28 success = false;
29 } 29 }
30 30
31 // Parts of chrome.extension and chrome.tabs (which get included because it's 31 // Ditto chrome.tabs, though it's special because it's a dependency of the
32 // a dependency of chrome.extension) are unavailable. 32 // partially unprivileged chrome.extension.
33 if (chrome.tabs) {
34 console.log('Error: chrome.tabs exists, it shouldn\'t.');
35 success = false;
36 }
37
38 // Parts of chrome.extension are unavailable.
33 if (!runsWithException(function() { return chrome.extension.getViews; })) 39 if (!runsWithException(function() { return chrome.extension.getViews; }))
34 success = false; 40 success = false;
35 if (!runsWithException(function() { return chrome.tabs.create; }))
36 success = false;
37 41
38 chrome.extension.sendRequest({success: success}); 42 chrome.extension.sendRequest({success: success});
OLDNEW
« no previous file with comments | « chrome/renderer/resources/extensions/setup_bindings.js ('k') | chrome/test/data/extensions/api_test/stubs/content_script.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698