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

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: add extension api test 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..2f4ab1ad2c18674543e9e0f1c15f1b41b8388bc9
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/permissions/optional_policy_blocked/background.js
@@ -0,0 +1,27 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
Finnur 2014/10/30 14:16:59 Nit: Delete the (c)
binjin 2014/10/30 16:41:12 Done.
+// 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));
+ }
+ ]);
+});

Powered by Google App Engine
This is Rietveld 408576698