OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 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_FILE_TEST_UTILS_H_ | |
6 #define CHROME_TEST_FILE_TEST_UTILS_H_ | |
7 #pragma once | |
8 | |
9 #include "base/file_path.h" | |
10 #include "base/file_util.h" | |
11 | |
12 // Auto deletes file/folder when it goes out-of-scope. This is useful for tests | |
13 // to cleanup files/folder automatically. | |
14 class FileAutoDeleter { | |
15 public: | |
16 explicit FileAutoDeleter(const FilePath& path); | |
17 ~FileAutoDeleter(); | |
18 | |
19 const FilePath& path() { return path_; } | |
20 private: | |
21 FilePath path_; | |
22 DISALLOW_COPY_AND_ASSIGN(FileAutoDeleter); | |
23 }; | |
24 | |
25 #endif // CHROME_TEST_FILE_TEST_UTILS_H_ | |
OLD | NEW |