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

Unified Diff: chrome/test/data/extensions/api_test/permissions/optional/background.js

Issue 15961006: Regenerate Extensions API bindings when optional permissions change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: try againto fix android Created 7 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/permissions/optional/background.js
diff --git a/chrome/test/data/extensions/api_test/permissions/optional/background.js b/chrome/test/data/extensions/api_test/permissions/optional/background.js
index 99af45053ba669c85347e61936e6515357ca4c5b..9be32d65954734187a9fcf48ace19a94a191193d 100644
--- a/chrome/test/data/extensions/api_test/permissions/optional/background.js
+++ b/chrome/test/data/extensions/api_test/permissions/optional/background.js
@@ -12,9 +12,6 @@ var listenOnce = chrome.test.listenOnce;
var NOT_OPTIONAL_ERROR =
"Optional permissions must be listed in extension manifest.";
-var NO_BOOKMARKS_PERMISSION =
- "You do not have permission to use 'bookmarks.getTree'.";
-
var REQUIRED_ERROR =
"You cannot remove required permissions.";
@@ -127,16 +124,7 @@ chrome.test.getConfig(function(config) {
// We should be able to request the bookmarks API since it's in the granted
// permissions list (see permissions_apitest.cc).
function requestBookmarks() {
- // chrome.bookmarks is a optional permission, so the API definition should
- // exist but its use disallowed.
- assertTrue(!!chrome.bookmarks);
- try {
- chrome.bookmarks.getTree(function() {
- chrome.test.fail("Should not have bookmarks API permission.");
- });
- } catch (e) {
- assertTrue(e.message.indexOf(NO_BOOKMARKS_PERMISSION) == 0);
- }
+ assertEq(undefined, chrome.bookmarks);
listenOnce(chrome.permissions.onAdded,
function(permissions) {
assertTrue(permissions.permissions.length == 1);
@@ -205,13 +193,7 @@ chrome.test.getConfig(function(config) {
chrome.permissions.getAll(pass(function(permissions) {
assertTrue(checkPermSetsEq(initialPermissions, permissions));
}));
- try {
- chrome.bookmarks.getTree(function() {
- chrome.test.fail("Should not have bookmarks API permission.");
- });
- } catch (e) {
- assertTrue(e.message.indexOf(NO_BOOKMARKS_PERMISSION) == 0);
- }
+ assertEq(undefined, chrome.bookmarks);
}));
},
@@ -305,13 +287,7 @@ chrome.test.getConfig(function(config) {
});
listenOnce(chrome.permissions.onRemoved,
function(permissions) {
- try {
- chrome.bookmarks.getTree(function() {
- chrome.test.fail("Should not have bookmakrs API permission.");
- });
- } catch (e) {
- assertTrue(e.message.indexOf(NO_BOOKMARKS_PERMISSION) == 0);
- }
+ assertEq(undefined, chrome.bookmarks);
});
chrome.permissions.request(
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | chrome/test/data/extensions/api_test/permissions/optional_deny/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698