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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/base/scoped_command_line_override.h" 5 #include "chrome/test/base/scoped_command_line_override.h"
6 6
7 ScopedCommandLineOverride::ScopedCommandLineOverride( 7 ScopedCommandLineOverride::ScopedCommandLineOverride(
8 const std::string& new_switch) 8 const std::string& new_switch)
9 : old_command_line_(*CommandLine::ForCurrentProcess()) { 9 : old_command_line_(*CommandLine::ForCurrentProcess()) {
10 CommandLine::ForCurrentProcess()->AppendSwitch(new_switch); 10 CommandLine::ForCurrentProcess()->AppendSwitch(new_switch);
11 } 11 }
12 12
13 ScopedCommandLineOverride::ScopedCommandLineOverride(
14 CommandLine& old_command_line)
15 : old_command_line_(old_command_line) {}
16
17 ScopedCommandLineOverride::ScopedCommandLineOverride(
18 const std::string& switch1,
19 const std::string& switch2)
20 : old_command_line_(*CommandLine::ForCurrentProcess()) {
21 CommandLine::ForCurrentProcess()->AppendSwitch(switch1);
22 CommandLine::ForCurrentProcess()->AppendSwitch(switch2);
23 }
24
25 ScopedCommandLineOverride::ScopedCommandLineOverride(
26 const std::string& switch1,
27 const std::string& switch2,
28 const std::string& switch3)
29 : old_command_line_(*CommandLine::ForCurrentProcess()) {
30 CommandLine::ForCurrentProcess()->AppendSwitch(switch1);
31 CommandLine::ForCurrentProcess()->AppendSwitch(switch2);
32 CommandLine::ForCurrentProcess()->AppendSwitch(switch3);
33 }
34
13 ScopedCommandLineOverride::~ScopedCommandLineOverride() { 35 ScopedCommandLineOverride::~ScopedCommandLineOverride() {
14 *CommandLine::ForCurrentProcess() = old_command_line_; 36 *CommandLine::ForCurrentProcess() = old_command_line_;
15 } 37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698