diff options
author | ericdingle@chromium.org <ericdingle@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-27 16:30:20 +0000 |
---|---|---|
committer | ericdingle@chromium.org <ericdingle@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-27 16:30:20 +0000 |
commit | d5b528c5a418faaf40c5f1a33de4b829b95dba62 (patch) | |
tree | f35d804da4af4b0211f102e60d59f2e0e4e8bc6a /chrome/browser/extensions/script_badge_controller_unittest.cc | |
parent | adbc18d00e892b6afce23472f42aca7f31a7f6e7 (diff) | |
download | chromium_src-d5b528c5a418faaf40c5f1a33de4b829b95dba62.zip chromium_src-d5b528c5a418faaf40c5f1a33de4b829b95dba62.tar.gz chromium_src-d5b528c5a418faaf40c5f1a33de4b829b95dba62.tar.bz2 |
Add content script activity to the extension activity log.
BUG=39802
Review URL: https://chromiumcodereview.appspot.com/10905245
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159040 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 | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/chrome/browser/extensions/script_badge_controller_unittest.cc b/chrome/browser/extensions/script_badge_controller_unittest.cc index 760d104..0be5411 100644 --- a/chrome/browser/extensions/script_badge_controller_unittest.cc +++ b/chrome/browser/extensions/script_badge_controller_unittest.cc @@ -15,6 +15,7 @@ #include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tab_contents/test_tab_contents.h" #include "chrome/common/chrome_notification_types.h" +#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_builder.h" @@ -41,6 +42,16 @@ class ScriptBadgeControllerTest : public TabContentsTestHarness { file_thread_(BrowserThread::FILE, MessageLoop::current()), current_channel_(chrome::VersionInfo::CHANNEL_DEV) {} + static void SetUpTestCase() { + old_command_line_ = *CommandLine::ForCurrentProcess(); + CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kEnableScriptBadges); + } + + static void TearDownTestCase() { + *CommandLine::ForCurrentProcess() = old_command_line_; + } + virtual void SetUp() OVERRIDE { // Note that this sets a PageActionController into the // extensions::TabHelper's location_bar_controller field. Do @@ -57,9 +68,9 @@ class ScriptBadgeControllerTest : public TabContentsTestHarness { extension_service_ = extension_system->CreateExtensionService( &command_line, FilePath(), false); - script_executor_.reset(new ScriptExecutor(web_contents())); - script_badge_controller_.reset(new ScriptBadgeController( - web_contents(), script_executor_.get())); + TabHelper::CreateForWebContents(web_contents()); + script_badge_controller_ = static_cast<ScriptBadgeController*>( + TabHelper::FromWebContents(web_contents())->location_bar_controller()); } protected: @@ -80,15 +91,18 @@ class ScriptBadgeControllerTest : public TabContentsTestHarness { } ExtensionService* extension_service_; - scoped_ptr<ScriptExecutor> script_executor_; - scoped_ptr<ScriptBadgeController> script_badge_controller_; + ScriptBadgeController* script_badge_controller_; private: + static CommandLine old_command_line_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; Feature::ScopedCurrentChannel current_channel_; }; +CommandLine ScriptBadgeControllerTest::old_command_line_( + CommandLine::NO_PROGRAM); + struct CountingNotificationObserver : public content::NotificationObserver { CountingNotificationObserver() : events(0) {} |