diff options
author | jyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-12 21:28:30 +0000 |
---|---|---|
committer | jyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-12 21:28:30 +0000 |
commit | 5ed5ec52082aa3740a2a9657fc8e0b2bb765317a (patch) | |
tree | 15a21c11c00a6bf938a8d50e87d97bc65e4c1c8f /chrome/browser/extensions/script_badge_controller_unittest.cc | |
parent | 8381068a6afa9343adb0558ea2e395e465174285 (diff) | |
download | chromium_src-5ed5ec52082aa3740a2a9657fc8e0b2bb765317a.zip chromium_src-5ed5ec52082aa3740a2a9657fc8e0b2bb765317a.tar.gz chromium_src-5ed5ec52082aa3740a2a9657fc8e0b2bb765317a.tar.bz2 |
Remove Extension's accessors for ExtensionActions.
extension->browser_action() is replaced by ExtensionActionManager::Get(profile)->GetBrowserAction(*extension), and similar for page actions and script badges.
This is the second step of a four-part refactoring to simplify icon handling.
The subsequent parts are:
3) Move ExtensionAction from common/ to browser/
4) Make the icon-loading and -caching classes into ExtensionAction methods.
BUG=153463
Review URL: https://chromiumcodereview.appspot.com/11036025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/script_badge_controller_unittest.cc')
-rw-r--r-- | chrome/browser/extensions/script_badge_controller_unittest.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/chrome/browser/extensions/script_badge_controller_unittest.cc b/chrome/browser/extensions/script_badge_controller_unittest.cc index 0be5411..325b4fa 100644 --- a/chrome/browser/extensions/script_badge_controller_unittest.cc +++ b/chrome/browser/extensions/script_badge_controller_unittest.cc @@ -8,6 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" #include "base/stringprintf.h" +#include "chrome/browser/extensions/extension_action_manager.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/script_badge_controller.h" #include "chrome/browser/extensions/tab_helper.h" @@ -90,6 +91,10 @@ class ScriptBadgeControllerTest : public TabContentsTestHarness { return extension; } + ExtensionAction* GetScriptBadge(const Extension& extension) { + return ExtensionActionManager::Get(profile())->GetScriptBadge(extension); + } + ExtensionService* extension_service_; ScriptBadgeController* script_badge_controller_; @@ -145,7 +150,7 @@ TEST_F(ScriptBadgeControllerTest, ExecutionMakesBadgeVisible) { GURL(""), val); EXPECT_THAT(script_badge_controller_->GetCurrentActions(), - testing::ElementsAre(extension->script_badge())); + testing::ElementsAre(GetScriptBadge(*extension))); EXPECT_THAT(location_bar_updated.events, testing::Gt(0)); }; @@ -174,7 +179,7 @@ TEST_F(ScriptBadgeControllerTest, FragmentNavigation) { val); EXPECT_THAT(script_badge_controller_->GetCurrentActions(), - testing::ElementsAre(extension->script_badge())); + testing::ElementsAre(GetScriptBadge(*extension))); EXPECT_EQ(1, location_bar_updated.events); } @@ -190,7 +195,7 @@ TEST_F(ScriptBadgeControllerTest, FragmentNavigation) { NavigateAndCommit(GURL("http://www.google.com#hash")); EXPECT_THAT(script_badge_controller_->GetCurrentActions(), - testing::ElementsAre(extension->script_badge())); + testing::ElementsAre(GetScriptBadge(*extension))); EXPECT_EQ(0, location_bar_updated.events); } @@ -242,7 +247,7 @@ TEST_F(ScriptBadgeControllerTest, GetAttentionMakesBadgeVisible) { script_badge_controller_->GetAttentionFor(extension->id()); EXPECT_THAT(script_badge_controller_->GetCurrentActions(), - testing::ElementsAre(extension->script_badge())); + testing::ElementsAre(GetScriptBadge(*extension))); EXPECT_THAT(initial_badge_display.events, testing::Gt(0)); CountingNotificationObserver subsequent_get_attention_call; @@ -255,7 +260,7 @@ TEST_F(ScriptBadgeControllerTest, GetAttentionMakesBadgeVisible) { script_badge_controller_->GetAttentionFor(extension->id()); EXPECT_THAT(script_badge_controller_->GetCurrentActions(), - testing::ElementsAre(extension->script_badge())); + testing::ElementsAre(GetScriptBadge(*extension))); EXPECT_EQ(0, subsequent_get_attention_call.events); }; |