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

Side by Side Diff: chrome/browser/extensions/extension_keybinding_apitest.cc

Issue 315573003: Remove PermissionsData::ForExtension() completely (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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) 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 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/extensions/active_tab_permission_granter.h" 6 #include "chrome/browser/extensions/active_tab_permission_granter.h"
7 #include "chrome/browser/extensions/browser_action_test_util.h" 7 #include "chrome/browser/extensions/browser_action_test_util.h"
8 #include "chrome/browser/extensions/extension_action.h" 8 #include "chrome/browser/extensions/extension_action.h"
9 #include "chrome/browser/extensions/extension_action_manager.h" 9 #include "chrome/browser/extensions/extension_action_manager.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 10 #include "chrome/browser/extensions/extension_apitest.h"
(...skipping 19 matching lines...) Expand all
30 CommandsApiTest() {} 30 CommandsApiTest() {}
31 virtual ~CommandsApiTest() {} 31 virtual ~CommandsApiTest() {}
32 32
33 protected: 33 protected:
34 BrowserActionTestUtil GetBrowserActionsBar() { 34 BrowserActionTestUtil GetBrowserActionsBar() {
35 return BrowserActionTestUtil(browser()); 35 return BrowserActionTestUtil(browser());
36 } 36 }
37 37
38 bool IsGrantedForTab(const Extension* extension, 38 bool IsGrantedForTab(const Extension* extension,
39 const content::WebContents* web_contents) { 39 const content::WebContents* web_contents) {
40 return PermissionsData::ForExtension(extension)->HasAPIPermissionForTab( 40 return extension->permissions_data()->HasAPIPermissionForTab(
41 SessionID::IdForTab(web_contents), APIPermission::kTab); 41 SessionID::IdForTab(web_contents), APIPermission::kTab);
42 } 42 }
43 }; 43 };
44 44
45 // Test the basic functionality of the Keybinding API: 45 // Test the basic functionality of the Keybinding API:
46 // - That pressing the shortcut keys should perform actions (activate the 46 // - That pressing the shortcut keys should perform actions (activate the
47 // browser action or send an event). 47 // browser action or send an event).
48 // - Note: Page action keybindings are tested in PageAction test below. 48 // - Note: Page action keybindings are tested in PageAction test below.
49 // - The shortcut keys taken by one extension are not overwritten by the last 49 // - The shortcut keys taken by one extension are not overwritten by the last
50 // installed extension. 50 // installed extension.
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 // Activate the Media Stop key. 289 // Activate the Media Stop key.
290 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( 290 ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
291 browser(), ui::VKEY_MEDIA_STOP, false, false, false, false)); 291 browser(), ui::VKEY_MEDIA_STOP, false, false, false, false));
292 292
293 // We should get two success result. 293 // We should get two success result.
294 ASSERT_TRUE(catcher.GetNextResult()); 294 ASSERT_TRUE(catcher.GetNextResult());
295 ASSERT_TRUE(catcher.GetNextResult()); 295 ASSERT_TRUE(catcher.GetNextResult());
296 } 296 }
297 297
298 } // namespace extensions 298 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698