Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / permissions / optional_policy_blocked / background.js
blob8c026927dbf0018f5d8481664495a3d382e453a2
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.
5 var assertTrue = chrome.test.assertTrue;
6 var fail = chrome.test.callbackFail;
7 var pass = chrome.test.callbackPass;
9 var BLOCKED_BY_ENTERPRISE_ERROR =
10     "Permissions are blocked by enterprise policy.";
12 chrome.test.getConfig(function(config) {
14   chrome.test.runTests([
15     function allowedPermission() {
16       chrome.permissions.request(
17           {permissions:['bookmarks']},
18           pass(function(granted) { assertTrue(granted); }));
19     },
21     function allowedPermission() {
22       chrome.permissions.request(
23           {permissions:['management']},
24           fail(BLOCKED_BY_ENTERPRISE_ERROR));
25     }
26   ]);
27 });