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

Side by Side Diff: base/test/scoped_command_line.h

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 unified diff | Download patch
« no previous file with comments | « base/test/BUILD.gn ('k') | base/test/scoped_command_line.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_TEST_SCOPED_COMMAND_LINE_H_
6 #define BASE_TEST_SCOPED_COMMAND_LINE_H_
7
8 #include "base/command_line.h"
9
10 namespace base {
11 namespace test {
12
13 // Helper class to restore the original command line at the end of the scope.
14 // NOTE: In most unit tests, the command line is automatically restored per
15 // test, so this class is not necessary if the command line applies to
16 // the entire single test.
17 class ScopedCommandLine final {
18 public:
19 ScopedCommandLine();
20 ~ScopedCommandLine();
21
22 // Gets the command line for the current process.
23 // NOTE: Do not name this GetCommandLine as this will conflict with Windows's
24 // GetCommandLine and get renamed to GetCommandLineW.
25 CommandLine* GetProcessCommandLine();
26
27 private:
28 const CommandLine original_command_line_;
29 };
30
31 } // namespace test
32 } // namespace base
33
34 #endif // BASE_TEST_SCOPED_COMMAND_LINE_H_
OLDNEW
« no previous file with comments | « base/test/BUILD.gn ('k') | base/test/scoped_command_line.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698