Chromium Code Reviews| 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)); |
| + } |
| + ]); |
| +}); |