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

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

Issue 595363002: Add policy controlled permission block list for extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext-fix
Patch Set: fix memory leaks Created 6 years, 2 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_policy_blocked/background.js
diff --git a/chrome/test/data/extensions/api_test/permissions/optional_policy_blocked/background.js b/chrome/test/data/extensions/api_test/permissions/optional_policy_blocked/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..8c026927dbf0018f5d8481664495a3d382e453a2
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/permissions/optional_policy_blocked/background.js
@@ -0,0 +1,27 @@
+// Copyright 2014 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 assertTrue = chrome.test.assertTrue;
+var fail = chrome.test.callbackFail;
+var pass = chrome.test.callbackPass;
+
+var BLOCKED_BY_ENTERPRISE_ERROR =
+ "Permissions are blocked by enterprise policy.";
+
+chrome.test.getConfig(function(config) {
+
+ chrome.test.runTests([
+ function allowedPermission() {
+ chrome.permissions.request(
+ {permissions:['bookmarks']},
+ pass(function(granted) { assertTrue(granted); }));
+ },
+
+ function allowedPermission() {
+ chrome.permissions.request(
+ {permissions:['management']},
+ fail(BLOCKED_BY_ENTERPRISE_ERROR));
+ }
+ ]);
+});
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chrome/test/data/extensions/api_test/permissions/optional_policy_blocked/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698