| 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/files/scoped_temp_dir.h" |
| 11 #include "base/logging.h" | 12 #include "base/logging.h" |
| 12 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 13 #include "base/message_loop_proxy.h" | 14 #include "base/message_loop_proxy.h" |
| 14 #include "base/scoped_temp_dir.h" | |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "webkit/fileapi/file_system_context.h" | 17 #include "webkit/fileapi/file_system_context.h" |
| 18 #include "webkit/fileapi/file_system_operation_context.h" | 18 #include "webkit/fileapi/file_system_operation_context.h" |
| 19 #include "webkit/fileapi/file_system_task_runners.h" | 19 #include "webkit/fileapi/file_system_task_runners.h" |
| 20 #include "webkit/fileapi/file_util_helper.h" | 20 #include "webkit/fileapi/file_util_helper.h" |
| 21 #include "webkit/fileapi/isolated_context.h" | 21 #include "webkit/fileapi/isolated_context.h" |
| 22 #include "webkit/fileapi/isolated_file_util.h" | 22 #include "webkit/fileapi/isolated_file_util.h" |
| 23 #include "webkit/fileapi/local_file_system_operation.h" | 23 #include "webkit/fileapi/local_file_system_operation.h" |
| 24 #include "webkit/fileapi/local_file_system_test_helper.h" | 24 #include "webkit/fileapi/local_file_system_test_helper.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 toplevels.AddPath(root.Append(path), NULL); | 227 toplevels.AddPath(root.Append(path), NULL); |
| 228 } | 228 } |
| 229 | 229 |
| 230 test::SetUpOneTestCase(toplevel_root_map_[toplevel], test_case); | 230 test::SetUpOneTestCase(toplevel_root_map_[toplevel], test_case); |
| 231 } | 231 } |
| 232 | 232 |
| 233 // Register the toplevel entries. | 233 // Register the toplevel entries. |
| 234 filesystem_id_ = isolated_context()->RegisterDraggedFileSystem(toplevels); | 234 filesystem_id_ = isolated_context()->RegisterDraggedFileSystem(toplevels); |
| 235 } | 235 } |
| 236 | 236 |
| 237 ScopedTempDir data_dir_; | 237 base::ScopedTempDir data_dir_; |
| 238 MessageLoop message_loop_; | 238 MessageLoop message_loop_; |
| 239 std::string filesystem_id_; | 239 std::string filesystem_id_; |
| 240 scoped_refptr<FileSystemContext> file_system_context_; | 240 scoped_refptr<FileSystemContext> file_system_context_; |
| 241 std::map<FilePath, FilePath> toplevel_root_map_; | 241 std::map<FilePath, FilePath> toplevel_root_map_; |
| 242 scoped_ptr<IsolatedFileUtil> file_util_; | 242 scoped_ptr<IsolatedFileUtil> file_util_; |
| 243 scoped_ptr<LocalFileUtil> other_file_util_; | 243 scoped_ptr<LocalFileUtil> other_file_util_; |
| 244 LocalFileSystemTestOriginHelper other_file_util_helper_; | 244 LocalFileSystemTestOriginHelper other_file_util_helper_; |
| 245 DISALLOW_COPY_AND_ASSIGN(IsolatedFileUtilTest); | 245 DISALLOW_COPY_AND_ASSIGN(IsolatedFileUtilTest); |
| 246 }; | 246 }; |
| 247 | 247 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 EXPECT_EQ(base::PLATFORM_FILE_OK, | 507 EXPECT_EQ(base::PLATFORM_FILE_OK, |
| 508 file_util()->Truncate(GetOperationContext().get(), url, 999)); | 508 file_util()->Truncate(GetOperationContext().get(), url, 999)); |
| 509 ASSERT_EQ(base::PLATFORM_FILE_OK, | 509 ASSERT_EQ(base::PLATFORM_FILE_OK, |
| 510 file_util()->GetFileInfo(GetOperationContext().get(), url, | 510 file_util()->GetFileInfo(GetOperationContext().get(), url, |
| 511 &info, &platform_path)); | 511 &info, &platform_path)); |
| 512 EXPECT_EQ(999, info.size); | 512 EXPECT_EQ(999, info.size); |
| 513 } | 513 } |
| 514 } | 514 } |
| 515 | 515 |
| 516 } // namespace fileapi | 516 } // namespace fileapi |
| OLD | NEW |