OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var assertFalse = chrome.test.assertFalse; | 5 var assertFalse = chrome.test.assertFalse; |
6 var assertTrue = chrome.test.assertTrue; | 6 var assertTrue = chrome.test.assertTrue; |
7 var pass = chrome.test.callbackPass; | 7 var pass = chrome.test.callbackPass; |
8 | 8 |
9 var NO_TABS_PERMISSION = | 9 var NO_TABS_PERMISSION = |
10 "You do not have permission to use 'windows.getAll'."; | 10 "You do not have permission to use 'windows.getAll'."; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 chrome.test.fail("Should not have tabs API permission."); | 53 chrome.test.fail("Should not have tabs API permission."); |
54 }); | 54 }); |
55 } catch (e) { | 55 } catch (e) { |
56 assertTrue(e.message.indexOf(NO_TABS_PERMISSION) == 0); | 56 assertTrue(e.message.indexOf(NO_TABS_PERMISSION) == 0); |
57 } | 57 } |
58 | 58 |
59 doReq('http://b.c.com/', pass(function(result) { | 59 doReq('http://b.c.com/', pass(function(result) { |
60 assertFalse(result); | 60 assertFalse(result); |
61 })); | 61 })); |
62 })); | 62 })); |
| 63 }, |
| 64 |
| 65 function noPromptForActivePermissions() { |
| 66 // We shouldn't prompt if the extension already has the permissions. |
| 67 chrome.permissions.request( |
| 68 {permissions: ["management"]}, |
| 69 pass(function(granted) { |
| 70 assertTrue(granted); |
| 71 })); |
63 } | 72 } |
64 ]); | 73 ]); |
65 }); | 74 }); |
OLD | NEW |