| Index: extensions/common/test/scoped_command_line_switch.cc
|
| diff --git a/extensions/common/test/scoped_command_line_switch.cc b/extensions/common/test/scoped_command_line_switch.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..700a52d4cf8f46a525a3ab29fccb64119fcb1f01
|
| --- /dev/null
|
| +++ b/extensions/common/test/scoped_command_line_switch.cc
|
| @@ -0,0 +1,23 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "extensions/common/test/scoped_command_line_switch.h"
|
| +
|
| +ScopedCommandLineSwitch::ScopedCommandLineSwitch(
|
| + const std::string& switch_string)
|
| + : original_command_line_(*base::CommandLine::ForCurrentProcess()) {
|
| + base::CommandLine::ForCurrentProcess()->AppendSwitch(switch_string);
|
| +}
|
| +
|
| +ScopedCommandLineSwitch::ScopedCommandLineSwitch(
|
| + const std::string& switch_string,
|
| + const std::string& value)
|
| + : original_command_line_(*base::CommandLine::ForCurrentProcess()) {
|
| + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(switch_string,
|
| + value);
|
| +}
|
| +
|
| +ScopedCommandLineSwitch::~ScopedCommandLineSwitch() {
|
| + *base::CommandLine::ForCurrentProcess() = original_command_line_;
|
| +}
|
|
|