| Index: chrome/browser/extensions/extension_keybinding_apitest.cc
|
| diff --git a/chrome/browser/extensions/extension_keybinding_apitest.cc b/chrome/browser/extensions/extension_keybinding_apitest.cc
|
| index 07906a18b79c18956c16bb9ed74de4674f3dd134..80281949ebbc4c1fe8bb6f0d2b8eec47bf19a843 100644
|
| --- a/chrome/browser/extensions/extension_keybinding_apitest.cc
|
| +++ b/chrome/browser/extensions/extension_keybinding_apitest.cc
|
| @@ -13,6 +13,7 @@
|
| #include "chrome/browser/ui/tabs/tab_strip_model.h"
|
| #include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/extensions/extension.h"
|
| +#include "chrome/common/extensions/permissions/permissions_data.h"
|
| #include "chrome/test/base/interactive_test_utils.h"
|
| #include "chrome/test/base/ui_test_utils.h"
|
| #include "content/public/browser/notification_service.h"
|
| @@ -32,6 +33,14 @@ class CommandsApiTest : public ExtensionApiTest {
|
| BrowserActionTestUtil GetBrowserActionsBar() {
|
| return BrowserActionTestUtil(browser());
|
| }
|
| +
|
| + bool IsGrantedForTab(const Extension* extension,
|
| + const content::WebContents* web_contents) {
|
| + return PermissionsData::HasAPIPermissionForTab(
|
| + extension,
|
| + SessionID::IdForTab(web_contents),
|
| + APIPermission::kTab);
|
| + }
|
| };
|
|
|
| class ScriptBadgesCommandsApiTest : public ExtensionApiTest {
|
| @@ -73,16 +82,14 @@ IN_PROC_BROWSER_TEST_F(CommandsApiTest, Basic) {
|
| WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
|
| ASSERT_TRUE(tab);
|
|
|
| - ActiveTabPermissionGranter* granter =
|
| - TabHelper::FromWebContents(tab)->active_tab_permission_granter();
|
| - EXPECT_FALSE(granter->IsGranted(extension));
|
| + EXPECT_FALSE(IsGrantedForTab(extension, tab));
|
|
|
| // Activate the shortcut (Ctrl+Shift+F).
|
| ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
|
| browser(), ui::VKEY_F, true, true, false, false));
|
|
|
| // activeTab should now be granted.
|
| - EXPECT_TRUE(granter->IsGranted(extension));
|
| + EXPECT_TRUE(IsGrantedForTab(extension, tab));
|
|
|
| // Verify the command worked.
|
| bool result = false;
|
|
|