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

Unified Diff: chrome/browser/extensions/activity_log/activity_log_unittest.cc

Issue 18430004: Sets correct ActivityLog enabled status to the first renderer process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ChromeOS fix Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/activity_log/activity_log_unittest.cc
diff --git a/chrome/browser/extensions/activity_log/activity_log_unittest.cc b/chrome/browser/extensions/activity_log/activity_log_unittest.cc
index 25c9cea83cfea0b3a5b17b823f4e8387c154d523..30ade1f2ffd497fa65689ff0153a3526333aaa36 100644
--- a/chrome/browser/extensions/activity_log/activity_log_unittest.cc
+++ b/chrome/browser/extensions/activity_log/activity_log_unittest.cc
@@ -39,24 +39,19 @@ namespace extensions {
class ActivityLogTest : public ChromeRenderViewHostTestHarness {
protected:
- ActivityLogTest() : saved_cmdline_(CommandLine::NO_PROGRAM) {}
-
virtual void SetUp() OVERRIDE {
ChromeRenderViewHostTestHarness::SetUp();
#if defined OS_CHROMEOS
test_user_manager_.reset(new chromeos::ScopedTestUserManager());
#endif
CommandLine command_line(CommandLine::NO_PROGRAM);
- saved_cmdline_ = *CommandLine::ForCurrentProcess();
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kEnableExtensionActivityLogging);
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kEnableExtensionActivityLogTesting);
- ActivityLog::RecomputeLoggingIsEnabled(true); // Logging now enabled.
extension_service_ = static_cast<TestExtensionSystem*>(
ExtensionSystem::Get(profile()))->CreateExtensionService
(&command_line, base::FilePath(), false);
- ActivityLog::GetInstance(profile())->Init();
base::RunLoop().RunUntilIdle();
}
@@ -65,9 +60,6 @@ class ActivityLogTest : public ChromeRenderViewHostTestHarness {
test_user_manager_.reset();
#endif
base::RunLoop().RunUntilIdle();
- // Restore the original command line and undo the affects of SetUp().
- *CommandLine::ForCurrentProcess() = saved_cmdline_;
- ActivityLog::RecomputeLoggingIsEnabled(false); // Logging now disabled.
ChromeRenderViewHostTestHarness::TearDown();
}
@@ -96,11 +88,6 @@ class ActivityLogTest : public ChromeRenderViewHostTestHarness {
}
ExtensionService* extension_service_;
- // Used to preserve a copy of the original command line.
- // The test framework will do this itself as well. However, by then,
- // it is too late to call ActivityLog::RecomputeLoggingIsEnabled() in
- // TearDown().
- CommandLine saved_cmdline_;
#if defined OS_CHROMEOS
chromeos::ScopedTestDeviceSettingsService test_device_settings_service_;
@@ -109,10 +96,6 @@ class ActivityLogTest : public ChromeRenderViewHostTestHarness {
#endif
};
-TEST_F(ActivityLogTest, Enabled) {
- ASSERT_TRUE(ActivityLog::IsLogEnabledOnAnyProfile());
-}
-
TEST_F(ActivityLogTest, Construct) {
ActivityLog* activity_log = ActivityLog::GetInstance(profile());
ASSERT_TRUE(activity_log->IsLogEnabled());
« no previous file with comments | « chrome/browser/extensions/activity_log/activity_log_enabled_unittest.cc ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698