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

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

Issue 11359217: Move scoped_temp_dir from base to base/files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « base/scoped_temp_dir_unittest.cc ('k') | base/win/event_trace_consumer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef BASE_TEST_SCOPED_PATH_OVERRIDE_H_ 5 #ifndef BASE_TEST_SCOPED_PATH_OVERRIDE_H_
6 #define BASE_TEST_SCOPED_PATH_OVERRIDE_H_ 6 #define BASE_TEST_SCOPED_PATH_OVERRIDE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 10
11 class FilePath; 11 class FilePath;
12 12
13 namespace base { 13 namespace base {
14 14
15 // Sets a path override on construction, and removes it when the object goes out 15 // Sets a path override on construction, and removes it when the object goes out
16 // of scope. This class is intended to be used by tests that need to override 16 // of scope. This class is intended to be used by tests that need to override
17 // paths to ensure their overrides are properly handled and reverted when the 17 // paths to ensure their overrides are properly handled and reverted when the
18 // scope of the test is left. 18 // scope of the test is left.
19 class ScopedPathOverride { 19 class ScopedPathOverride {
20 public: 20 public:
21 // Contructor that intializes the override to a scoped temp directory. 21 // Contructor that intializes the override to a scoped temp directory.
22 explicit ScopedPathOverride(int key); 22 explicit ScopedPathOverride(int key);
23 // Constructor that would use a path provided by the user. 23 // Constructor that would use a path provided by the user.
24 ScopedPathOverride(int key, const FilePath& dir); 24 ScopedPathOverride(int key, const FilePath& dir);
25 ~ScopedPathOverride(); 25 ~ScopedPathOverride();
26 26
27 private: 27 private:
28 int key_; 28 int key_;
29 ScopedTempDir temp_dir_; 29 ScopedTempDir temp_dir_;
30 30
31 DISALLOW_COPY_AND_ASSIGN(ScopedPathOverride); 31 DISALLOW_COPY_AND_ASSIGN(ScopedPathOverride);
32 }; 32 };
33 33
34 } // namespace base 34 } // namespace base
35 35
36 #endif // BASE_TEST_SCOPED_PATH_OVERRIDE_H_ 36 #endif // BASE_TEST_SCOPED_PATH_OVERRIDE_H_
OLDNEW
« no previous file with comments | « base/scoped_temp_dir_unittest.cc ('k') | base/win/event_trace_consumer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698