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" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 const test::TestCaseRecord& test_case = test::kRegularTestCases[i]; | 199 const test::TestCaseRecord& test_case = test::kRegularTestCases[i]; |
200 FilePath path(test_case.path); | 200 FilePath path(test_case.path); |
201 FilePath toplevel = GetTopLevelPath(path); | 201 FilePath toplevel = GetTopLevelPath(path); |
202 | 202 |
203 // We create the test case files under one of the kRootPaths | 203 // We create the test case files under one of the kRootPaths |
204 // to simulate a drop with multiple directories. | 204 // to simulate a drop with multiple directories. |
205 if (toplevel_root_map_.find(toplevel) == toplevel_root_map_.end()) { | 205 if (toplevel_root_map_.find(toplevel) == toplevel_root_map_.end()) { |
206 FilePath root = root_path().Append( | 206 FilePath root = root_path().Append( |
207 kRootPaths[(root_path_index++) % arraysize(kRootPaths)]); | 207 kRootPaths[(root_path_index++) % arraysize(kRootPaths)]); |
208 toplevel_root_map_[toplevel] = root; | 208 toplevel_root_map_[toplevel] = root; |
209 toplevels.AddPath(root.Append(path)); | 209 toplevels.AddPath(root.Append(path), NULL); |
210 } | 210 } |
211 | 211 |
212 test::SetUpOneTestCase(toplevel_root_map_[toplevel], test_case); | 212 test::SetUpOneTestCase(toplevel_root_map_[toplevel], test_case); |
213 } | 213 } |
214 | 214 |
215 // Register the toplevel entries. | 215 // Register the toplevel entries. |
216 filesystem_id_ = isolated_context()->RegisterFileSystem(toplevels); | 216 filesystem_id_ = isolated_context()->RegisterDraggedFileSystem(toplevels); |
217 } | 217 } |
218 | 218 |
219 ScopedTempDir data_dir_; | 219 ScopedTempDir data_dir_; |
220 MessageLoop message_loop_; | 220 MessageLoop message_loop_; |
221 std::string filesystem_id_; | 221 std::string filesystem_id_; |
222 scoped_refptr<FileSystemContext> file_system_context_; | 222 scoped_refptr<FileSystemContext> file_system_context_; |
223 std::map<FilePath, FilePath> toplevel_root_map_; | 223 std::map<FilePath, FilePath> toplevel_root_map_; |
224 scoped_ptr<IsolatedFileUtil> file_util_; | 224 scoped_ptr<IsolatedFileUtil> file_util_; |
225 scoped_ptr<LocalFileUtil> other_file_util_; | 225 scoped_ptr<LocalFileUtil> other_file_util_; |
226 LocalFileSystemTestOriginHelper other_file_util_helper_; | 226 LocalFileSystemTestOriginHelper other_file_util_helper_; |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 EXPECT_EQ(base::PLATFORM_FILE_OK, | 506 EXPECT_EQ(base::PLATFORM_FILE_OK, |
507 file_util()->Truncate(GetOperationContext().get(), url, 999)); | 507 file_util()->Truncate(GetOperationContext().get(), url, 999)); |
508 ASSERT_EQ(base::PLATFORM_FILE_OK, | 508 ASSERT_EQ(base::PLATFORM_FILE_OK, |
509 file_util()->GetFileInfo(GetOperationContext().get(), url, | 509 file_util()->GetFileInfo(GetOperationContext().get(), url, |
510 &info, &platform_path)); | 510 &info, &platform_path)); |
511 EXPECT_EQ(999, info.size); | 511 EXPECT_EQ(999, info.size); |
512 } | 512 } |
513 } | 513 } |
514 | 514 |
515 } // namespace fileapi | 515 } // namespace fileapi |
OLD | NEW |