Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: chrome/test/data/extensions/api_test/permissions/optional_deny/background.js

Issue 9222013: Prevent unnecessary prompts when unpacked extensions use chrome.permissions.request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reword comment Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698