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); }));
21 function allowedPermission() {
22 chrome.permissions.request(
23 {permissions:['management']},
24 fail(BLOCKED_BY_ENTERPRISE_ERROR));