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

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

Issue 1908633002: Introduce ScopedCommandLine (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean Up Other Tests Created 4 years, 8 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/fullstream_ui_policy_unittest.cc
diff --git a/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc b/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc
index c1509e45f3af0cad8acc8eecce17b68b12e5e6f3..6a349e9074af1ca1a7fd4c529e5593350148e89a 100644
--- a/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc
+++ b/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc
@@ -45,21 +45,18 @@ namespace extensions {
class FullStreamUIPolicyTest : public testing::Test {
public:
FullStreamUIPolicyTest()
- : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
- saved_cmdline_(base::CommandLine::NO_PROGRAM) {
+ : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {
#if defined OS_CHROMEOS
test_user_manager_.reset(new chromeos::ScopedTestUserManager());
#endif
- base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
- saved_cmdline_ = *base::CommandLine::ForCurrentProcess();
+ base::CommandLine no_program_command_line(base::CommandLine::NO_PROGRAM);
profile_.reset(new TestingProfile());
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kEnableExtensionActivityLogging);
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kEnableExtensionActivityLogTesting);
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ command_line->AppendSwitch(switches::kEnableExtensionActivityLogging);
+ command_line->AppendSwitch(switches::kEnableExtensionActivityLogTesting);
extension_service_ = static_cast<TestExtensionSystem*>(
ExtensionSystem::Get(profile_.get()))->CreateExtensionService
- (&command_line, base::FilePath(), false);
+ (&no_program_command_line, base::FilePath(), false);
}
~FullStreamUIPolicyTest() override {
@@ -69,8 +66,6 @@ class FullStreamUIPolicyTest : public testing::Test {
base::RunLoop().RunUntilIdle();
profile_.reset(NULL);
base::RunLoop().RunUntilIdle();
- // Restore the original command line and undo the affects of SetUp().
- *base::CommandLine::ForCurrentProcess() = saved_cmdline_;
}
// A wrapper function for CheckReadFilteredData, so that we don't need to
@@ -443,11 +438,6 @@ class FullStreamUIPolicyTest : public testing::Test {
ExtensionService* extension_service_;
std::unique_ptr<TestingProfile> profile_;
content::TestBrowserThreadBundle thread_bundle_;
- // 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().
- base::CommandLine saved_cmdline_;
#if defined OS_CHROMEOS
chromeos::ScopedTestDeviceSettingsService test_device_settings_service_;

Powered by Google App Engine
This is Rietveld 408576698