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

Unified Diff: chrome/test/base/scoped_command_line_override.cc

Issue 8561031: Replace ScopedCommandLineOverride with TestSuite listener. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/test/base/scoped_command_line_override.cc
diff --git a/chrome/test/base/scoped_command_line_override.cc b/chrome/test/base/scoped_command_line_override.cc
index bd4cb30a2ccb8f32aad22be81e42eda94a695957..372f93e5d946673ac9cda61871887ba0f4c1011f 100644
--- a/chrome/test/base/scoped_command_line_override.cc
+++ b/chrome/test/base/scoped_command_line_override.cc
@@ -10,6 +10,28 @@ ScopedCommandLineOverride::ScopedCommandLineOverride(
CommandLine::ForCurrentProcess()->AppendSwitch(new_switch);
}
+ScopedCommandLineOverride::ScopedCommandLineOverride(
+ CommandLine& old_command_line)
+ : old_command_line_(old_command_line) {}
+
+ScopedCommandLineOverride::ScopedCommandLineOverride(
+ const std::string& switch1,
+ const std::string& switch2)
+ : old_command_line_(*CommandLine::ForCurrentProcess()) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(switch1);
+ CommandLine::ForCurrentProcess()->AppendSwitch(switch2);
+}
+
+ScopedCommandLineOverride::ScopedCommandLineOverride(
+ const std::string& switch1,
+ const std::string& switch2,
+ const std::string& switch3)
+ : old_command_line_(*CommandLine::ForCurrentProcess()) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(switch1);
+ CommandLine::ForCurrentProcess()->AppendSwitch(switch2);
+ CommandLine::ForCurrentProcess()->AppendSwitch(switch3);
+}
+
ScopedCommandLineOverride::~ScopedCommandLineOverride() {
*CommandLine::ForCurrentProcess() = old_command_line_;
}

Powered by Google App Engine
This is Rietveld 408576698