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/message_loop.h" |
8 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
9 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
10 #include "base/scoped_temp_dir.h" | 11 #include "base/scoped_temp_dir.h" |
11 #include "base/sys_string_conversions.h" | 12 #include "base/sys_string_conversions.h" |
12 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "webkit/fileapi/file_system_context.h" | 15 #include "webkit/fileapi/file_system_context.h" |
15 #include "webkit/fileapi/file_system_file_util.h" | 16 #include "webkit/fileapi/file_system_file_util.h" |
16 #include "webkit/fileapi/file_system_operation_context.h" | 17 #include "webkit/fileapi/file_system_operation_context.h" |
17 #include "webkit/fileapi/file_system_test_helper.h" | 18 #include "webkit/fileapi/file_system_test_helper.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 Path(file_name), created); | 91 Path(file_name), created); |
91 } | 92 } |
92 | 93 |
93 const FileSystemTestOriginHelper& test_helper() const { | 94 const FileSystemTestOriginHelper& test_helper() const { |
94 return test_helper_; | 95 return test_helper_; |
95 } | 96 } |
96 | 97 |
97 private: | 98 private: |
98 scoped_ptr<LocalFileUtil> local_file_util_; | 99 scoped_ptr<LocalFileUtil> local_file_util_; |
99 ScopedTempDir data_dir_; | 100 ScopedTempDir data_dir_; |
| 101 MessageLoop message_loop_; |
100 FileSystemTestOriginHelper test_helper_; | 102 FileSystemTestOriginHelper test_helper_; |
101 | 103 |
102 DISALLOW_COPY_AND_ASSIGN(LocalFileUtilTest); | 104 DISALLOW_COPY_AND_ASSIGN(LocalFileUtilTest); |
103 }; | 105 }; |
104 | 106 |
105 TEST_F(LocalFileUtilTest, CreateAndClose) { | 107 TEST_F(LocalFileUtilTest, CreateAndClose) { |
106 const char *file_name = "test_file"; | 108 const char *file_name = "test_file"; |
107 base::PlatformFile file_handle; | 109 base::PlatformFile file_handle; |
108 bool created; | 110 bool created; |
109 ASSERT_EQ(base::PLATFORM_FILE_OK, | 111 ASSERT_EQ(base::PLATFORM_FILE_OK, |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 test_helper().SameFileUtilMove(context.get(), | 272 test_helper().SameFileUtilMove(context.get(), |
271 Path(from_dir), Path(to_dir))); | 273 Path(from_dir), Path(to_dir))); |
272 | 274 |
273 EXPECT_FALSE(DirectoryExists(from_dir)); | 275 EXPECT_FALSE(DirectoryExists(from_dir)); |
274 EXPECT_TRUE(DirectoryExists(to_dir)); | 276 EXPECT_TRUE(DirectoryExists(to_dir)); |
275 EXPECT_TRUE(FileExists(to_file)); | 277 EXPECT_TRUE(FileExists(to_file)); |
276 EXPECT_EQ(1020, GetSize(to_file)); | 278 EXPECT_EQ(1020, GetSize(to_file)); |
277 } | 279 } |
278 | 280 |
279 } // namespace fileapi | 281 } // namespace fileapi |
OLD | NEW |