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

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: Created 7 years, 5 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 4a7958e41018b6db21d5690b1e49ae5b2754a59d..cd6b7da82b86523818159c65ce207ad87ec1d01f 100644
--- a/chrome/browser/extensions/activity_log/activity_log_unittest.cc
+++ b/chrome/browser/extensions/activity_log/activity_log_unittest.cc
@@ -40,24 +40,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();
felt 2013/07/23 06:37:34 why did you remove this? we're still mucking aroun
pmarch 2013/07/29 17:36:47 Comment below says saved_cmdline_ is used to prese
felt 2013/07/29 19:29:42 Ahh, I see, the problem was being caused by Recomp
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();
}
@@ -67,8 +62,6 @@ class ActivityLogTest : public ChromeRenderViewHostTestHarness {
#endif
base::RunLoop().RunUntilIdle();
// Restore the original command line and undo the affects of SetUp().
felt 2013/07/29 21:05:23 PS please kill the comment too if removing the cod
pmarch 2013/08/08 14:42:42 Done.
- *CommandLine::ForCurrentProcess() = saved_cmdline_;
- ActivityLog::RecomputeLoggingIsEnabled(false); // Logging now disabled.
ChromeRenderViewHostTestHarness::TearDown();
}
@@ -135,11 +128,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_;
@@ -148,10 +136,6 @@ class ActivityLogTest : public ChromeRenderViewHostTestHarness {
#endif
};
-TEST_F(ActivityLogTest, Enabled) {
- ASSERT_TRUE(ActivityLog::IsLogEnabledOnAnyProfile());
-}
-
TEST_F(ActivityLogTest, Construct) {
ActivityLog* activity_log = ActivityLog::GetInstance(profile());
scoped_ptr<base::ListValue> args(new base::ListValue());

Powered by Google App Engine
This is Rietveld 408576698