| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 MOJO_EDK_SYSTEM_TEST_SCOPED_TEST_DIR_H_ | 5 #ifndef MOJO_EDK_SYSTEM_TEST_SCOPED_TEST_DIR_H_ |
| 6 #define MOJO_EDK_SYSTEM_TEST_SCOPED_TEST_DIR_H_ | 6 #define MOJO_EDK_SYSTEM_TEST_SCOPED_TEST_DIR_H_ |
| 7 | 7 |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "mojo/edk/util/scoped_file.h" | 9 #include "mojo/edk/util/scoped_file.h" |
| 10 #include "mojo/public/cpp/system/macros.h" | 10 #include "mojo/public/cpp/system/macros.h" |
| 11 | 11 |
| 12 namespace mojo { | 12 namespace mojo { |
| 13 namespace system { | 13 namespace system { |
| 14 namespace test { | 14 namespace test { |
| 15 | 15 |
| 16 // Creates/destroyes a temporary directory for test purposes. (Unlike | 16 // Creates/destroyes a temporary directory for test purposes. (Unlike |
| 17 // |base::ScopedTempDir|, this automatically creates the temporary directory.) | 17 // |base::ScopedTempDir|, this automatically creates the temporary directory.) |
| 18 class ScopedTestDir { | 18 class ScopedTestDir final { |
| 19 public: | 19 public: |
| 20 ScopedTestDir(); | 20 ScopedTestDir(); |
| 21 ~ScopedTestDir(); | 21 ~ScopedTestDir(); |
| 22 | 22 |
| 23 util::ScopedFILE CreateFile(); | 23 util::ScopedFILE CreateFile(); |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 base::ScopedTempDir temp_dir_; | 26 base::ScopedTempDir temp_dir_; |
| 27 | 27 |
| 28 MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedTestDir); | 28 MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedTestDir); |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 } // namespace test | 31 } // namespace test |
| 32 } // namespace system | 32 } // namespace system |
| 33 } // namespace mojo | 33 } // namespace mojo |
| 34 | 34 |
| 35 #endif // MOJO_EDK_SYSTEM_TEST_SCOPED_TEST_DIR_H_ | 35 #endif // MOJO_EDK_SYSTEM_TEST_SCOPED_TEST_DIR_H_ |
| OLD | NEW |