OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 assertEq = chrome.test.assertEq; | 5 var assertEq = chrome.test.assertEq; |
6 var assertFalse = chrome.test.assertFalse; | 6 var assertFalse = chrome.test.assertFalse; |
7 var assertTrue = chrome.test.assertTrue; | 7 var assertTrue = chrome.test.assertTrue; |
8 var fail = chrome.test.callbackFail; | 8 var fail = chrome.test.callbackFail; |
9 var pass = chrome.test.callbackPass; | 9 var pass = chrome.test.callbackPass; |
10 var listenOnce = chrome.test.listenOnce; | 10 var listenOnce = chrome.test.listenOnce; |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 // Remove the notifications permission to return to normal. | 224 // Remove the notifications permission to return to normal. |
225 chrome.permissions.remove( | 225 chrome.permissions.remove( |
226 {permissions: ['notifications']}, | 226 {permissions: ['notifications']}, |
227 pass(function(removed) { assertTrue(removed); })); | 227 pass(function(removed) { assertTrue(removed); })); |
228 })); | 228 })); |
229 }, | 229 }, |
230 | 230 |
231 // Make sure you can only access the white listed permissions. | 231 // Make sure you can only access the white listed permissions. |
232 function whitelist() { | 232 function whitelist() { |
233 var error_msg = NOT_WHITE_LISTED_ERROR.replace('*', 'chromeAuthPrivate'); | 233 var error_msg = NOT_WHITE_LISTED_ERROR.replace('*', 'cloudPrintPrivate'); |
234 chrome.permissions.request( | 234 chrome.permissions.request( |
235 {permissions: ['chromeAuthPrivate']}, fail(error_msg)); | 235 {permissions: ['cloudPrintPrivate']}, fail(error_msg)); |
236 chrome.permissions.remove( | 236 chrome.permissions.remove( |
237 {permissions: ['chromeAuthPrivate']}, fail(error_msg)); | 237 {permissions: ['cloudPrintPrivate']}, fail(error_msg)); |
238 }, | 238 }, |
239 | 239 |
240 function unknownPermission() { | 240 function unknownPermission() { |
241 var error_msg = UNKNOWN_PERMISSIONS_ERROR.replace('*', 'asdf'); | 241 var error_msg = UNKNOWN_PERMISSIONS_ERROR.replace('*', 'asdf'); |
242 chrome.permissions.request( | 242 chrome.permissions.request( |
243 {permissions: ['asdf']}, fail(error_msg)); | 243 {permissions: ['asdf']}, fail(error_msg)); |
244 }, | 244 }, |
245 | 245 |
246 function requestOrigin() { | 246 function requestOrigin() { |
247 doReq('http://c.com', pass(function(success) { assertFalse(success); })); | 247 doReq('http://c.com', pass(function(success) { assertFalse(success); })); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 assertTrue(granted); | 318 assertTrue(granted); |
319 chrome.permissions.remove( | 319 chrome.permissions.remove( |
320 {permissions: ['tabs']}, pass(function() { | 320 {permissions: ['tabs']}, pass(function() { |
321 assertTrue(true); | 321 assertTrue(true); |
322 })); | 322 })); |
323 })); | 323 })); |
324 } | 324 } |
325 | 325 |
326 ]); | 326 ]); |
327 }); | 327 }); |
OLD | NEW |