OLD | NEW |
(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 }); |
OLD | NEW |