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 #include <string> | 5 #include <string> |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 LocalFileUtil* FileUtil() { | 46 LocalFileUtil* FileUtil() { |
47 return static_cast<LocalFileUtil*>(test_helper_.file_util()); | 47 return static_cast<LocalFileUtil*>(test_helper_.file_util()); |
48 } | 48 } |
49 | 49 |
50 FileSystemURL Path(const std::string& file_name) { | 50 FileSystemURL Path(const std::string& file_name) { |
51 return test_helper_.CreateURLFromUTF8(file_name); | 51 return test_helper_.CreateURLFromUTF8(file_name); |
52 } | 52 } |
53 | 53 |
54 FilePath LocalPath(const char *file_name) { | 54 base::FilePath LocalPath(const char *file_name) { |
55 return test_helper_.GetLocalPathFromASCII(file_name); | 55 return test_helper_.GetLocalPathFromASCII(file_name); |
56 } | 56 } |
57 | 57 |
58 bool FileExists(const char *file_name) { | 58 bool FileExists(const char *file_name) { |
59 return file_util::PathExists(LocalPath(file_name)) && | 59 return file_util::PathExists(LocalPath(file_name)) && |
60 !file_util::DirectoryExists(LocalPath(file_name)); | 60 !file_util::DirectoryExists(LocalPath(file_name)); |
61 } | 61 } |
62 | 62 |
63 bool DirectoryExists(const char *file_name) { | 63 bool DirectoryExists(const char *file_name) { |
64 return file_util::DirectoryExists(LocalPath(file_name)); | 64 return file_util::DirectoryExists(LocalPath(file_name)); |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 test_helper().SameFileUtilMove(context.get(), | 325 test_helper().SameFileUtilMove(context.get(), |
326 Path(from_dir), Path(to_dir))); | 326 Path(from_dir), Path(to_dir))); |
327 | 327 |
328 EXPECT_FALSE(DirectoryExists(from_dir)); | 328 EXPECT_FALSE(DirectoryExists(from_dir)); |
329 EXPECT_TRUE(DirectoryExists(to_dir)); | 329 EXPECT_TRUE(DirectoryExists(to_dir)); |
330 EXPECT_TRUE(FileExists(to_file)); | 330 EXPECT_TRUE(FileExists(to_file)); |
331 EXPECT_EQ(1020, GetSize(to_file)); | 331 EXPECT_EQ(1020, GetSize(to_file)); |
332 } | 332 } |
333 | 333 |
334 } // namespace fileapi | 334 } // namespace fileapi |
OLD | NEW |