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

Side by Side Diff: chrome/test/base/scoped_command_line_override.h

Issue 8429023: Add platform_app flag to manifest. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge conflict resolution. 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_TEST_BASE_SCOPED_COMMAND_LINE_OVERRIDE_H_
6 #define CHROME_TEST_BASE_SCOPED_COMMAND_LINE_OVERRIDE_H_
7 #pragma once
8
9 #include <string>
10
11 #include "base/command_line.h"
12
13 // ScopedCommandLineOverride takes the CommandLine for the current
14 // process, saves it, then alters it. When the instance of this class
15 // goes out of scope, it restores CommandLine to its prior state. The
16 // intended usage is to test something that requires a flag that's off
17 // by default:
18 //
19 // ASSERT_TRUE(!Something::NotFullyBaked());
20 // {
21 // ScopedCommandLineOverride override(switches:kEnableSomethingHalfBaked);
22 // ASSERT_TRUE(Something::NotFullyBaked());
23 // }
24 class ScopedCommandLineOverride {
25 public:
26 explicit ScopedCommandLineOverride(const std::string& new_switch);
27 virtual ~ScopedCommandLineOverride();
28 private:
29 CommandLine old_command_line_;
30 };
31
32 #endif // CHROME_TEST_BASE_SCOPED_COMMAND_LINE_OVERRIDE_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_manifests_unittest.cc ('k') | chrome/test/base/scoped_command_line_override.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698