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

Side by Side 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, 1 month 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var assertTrue = chrome.test.assertTrue;
6 var fail = chrome.test.callbackFail;
7 var pass = chrome.test.callbackPass;
8
9 var BLOCKED_BY_ENTERPRISE_ERROR =
10 "Permissions are blocked by enterprise policy.";
11
12 chrome.test.getConfig(function(config) {
13
14 chrome.test.runTests([
15 function allowedPermission() {
16 chrome.permissions.request(
17 {permissions:['bookmarks']},
18 pass(function(granted) { assertTrue(granted); }));
19 },
20
21 function allowedPermission() {
22 chrome.permissions.request(
23 {permissions:['management']},
24 fail(BLOCKED_BY_ENTERPRISE_ERROR));
25 }
26 ]);
27 });
OLDNEW
« 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