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 <map> | 5 #include <map> |
6 #include <set> | 6 #include <set> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop.h" |
12 #include "base/message_loop_proxy.h" | 13 #include "base/message_loop_proxy.h" |
13 #include "base/scoped_temp_dir.h" | 14 #include "base/scoped_temp_dir.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "webkit/fileapi/file_system_context.h" | 16 #include "webkit/fileapi/file_system_context.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" |
18 #include "webkit/fileapi/file_util_helper.h" | 19 #include "webkit/fileapi/file_util_helper.h" |
19 #include "webkit/fileapi/isolated_context.h" | 20 #include "webkit/fileapi/isolated_context.h" |
20 #include "webkit/fileapi/isolated_file_util.h" | 21 #include "webkit/fileapi/isolated_file_util.h" |
21 #include "webkit/fileapi/local_file_util.h" | 22 #include "webkit/fileapi/local_file_util.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 } | 203 } |
203 | 204 |
204 test::SetUpOneTestCase(toplevel_root_map_[toplevel], test_case); | 205 test::SetUpOneTestCase(toplevel_root_map_[toplevel], test_case); |
205 } | 206 } |
206 | 207 |
207 // Register the toplevel entries. | 208 // Register the toplevel entries. |
208 filesystem_id_ = isolated_context()->RegisterIsolatedFileSystem(toplevels); | 209 filesystem_id_ = isolated_context()->RegisterIsolatedFileSystem(toplevels); |
209 } | 210 } |
210 | 211 |
211 ScopedTempDir data_dir_; | 212 ScopedTempDir data_dir_; |
| 213 MessageLoop message_loop_; |
212 std::string filesystem_id_; | 214 std::string filesystem_id_; |
213 scoped_refptr<FileSystemContext> file_system_context_; | 215 scoped_refptr<FileSystemContext> file_system_context_; |
214 std::map<FilePath, FilePath> toplevel_root_map_; | 216 std::map<FilePath, FilePath> toplevel_root_map_; |
215 scoped_ptr<IsolatedFileUtil> file_util_; | 217 scoped_ptr<IsolatedFileUtil> file_util_; |
216 scoped_ptr<LocalFileUtil> other_file_util_; | 218 scoped_ptr<LocalFileUtil> other_file_util_; |
217 FileSystemTestOriginHelper other_file_util_helper_; | 219 FileSystemTestOriginHelper other_file_util_helper_; |
218 DISALLOW_COPY_AND_ASSIGN(IsolatedFileUtilTest); | 220 DISALLOW_COPY_AND_ASSIGN(IsolatedFileUtilTest); |
219 }; | 221 }; |
220 | 222 |
221 TEST_F(IsolatedFileUtilTest, BasicTest) { | 223 TEST_F(IsolatedFileUtilTest, BasicTest) { |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 context.get(), other_file_util(), file_util(), dest_path, src_path); | 442 context.get(), other_file_util(), file_util(), dest_path, src_path); |
441 ASSERT_TRUE(result == base::PLATFORM_FILE_ERROR_FAILED || | 443 ASSERT_TRUE(result == base::PLATFORM_FILE_ERROR_FAILED || |
442 result == base::PLATFORM_FILE_ERROR_NOT_EMPTY); | 444 result == base::PLATFORM_FILE_ERROR_NOT_EMPTY); |
443 | 445 |
444 VerifyDirectoriesHaveSameContent(file_util(), other_file_util(), | 446 VerifyDirectoriesHaveSameContent(file_util(), other_file_util(), |
445 src_path, dest_path); | 447 src_path, dest_path); |
446 } | 448 } |
447 } | 449 } |
448 | 450 |
449 } // namespace fileapi | 451 } // namespace fileapi |
OLD | NEW |