| OLD | NEW |
| 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" | |
| 9 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/macros.h" |
| 10 | 10 |
| 11 namespace base { | 11 namespace base { |
| 12 | 12 |
| 13 class FilePath; | 13 class FilePath; |
| 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 { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 34 private: | 34 private: |
| 35 int key_; | 35 int key_; |
| 36 ScopedTempDir temp_dir_; | 36 ScopedTempDir temp_dir_; |
| 37 | 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(ScopedPathOverride); | 38 DISALLOW_COPY_AND_ASSIGN(ScopedPathOverride); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace base | 41 } // namespace base |
| 42 | 42 |
| 43 #endif // BASE_TEST_SCOPED_PATH_OVERRIDE_H_ | 43 #endif // BASE_TEST_SCOPED_PATH_OVERRIDE_H_ |
| OLD | NEW |