OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/bind.h" | 10 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
12 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
13 #include "base/files/scoped_temp_dir.h" | 13 #include "base/files/scoped_temp_dir.h" |
14 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
15 #include "base/single_thread_task_runner.h" | |
Lei Zhang
2015/05/07 20:02:49
In the files where you do not call base::ThreadTas
| |
15 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
17 #include "base/thread_task_runner_handle.h" | |
16 #include "base/time/time.h" | 18 #include "base/time/time.h" |
17 #include "chrome/browser/media_galleries/fileapi/iphoto_data_provider.h" | 19 #include "chrome/browser/media_galleries/fileapi/iphoto_data_provider.h" |
18 #include "chrome/browser/media_galleries/fileapi/iphoto_file_util.h" | 20 #include "chrome/browser/media_galleries/fileapi/iphoto_file_util.h" |
19 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" | 21 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" |
20 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h" | 22 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h" |
21 #include "chrome/browser/media_galleries/imported_media_gallery_registry.h" | 23 #include "chrome/browser/media_galleries/imported_media_gallery_registry.h" |
22 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
23 #include "content/public/test/mock_special_storage_policy.h" | 25 #include "content/public/test/mock_special_storage_policy.h" |
24 #include "content/public/test/test_browser_thread.h" | 26 #include "content/public/test/test_browser_thread.h" |
25 #include "content/public/test/test_file_system_options.h" | 27 #include "content/public/test/test_file_system_options.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
200 event.Wait(); | 202 event.Wait(); |
201 | 203 |
202 media_path_filter_.reset(new MediaPathFilter()); | 204 media_path_filter_.reset(new MediaPathFilter()); |
203 ScopedVector<storage::FileSystemBackend> additional_providers; | 205 ScopedVector<storage::FileSystemBackend> additional_providers; |
204 additional_providers.push_back(new TestMediaFileSystemBackend( | 206 additional_providers.push_back(new TestMediaFileSystemBackend( |
205 profile_dir_.path(), | 207 profile_dir_.path(), |
206 new TestIPhotoFileUtil(media_path_filter_.get(), | 208 new TestIPhotoFileUtil(media_path_filter_.get(), |
207 iphoto_data_provider_.get()))); | 209 iphoto_data_provider_.get()))); |
208 | 210 |
209 file_system_context_ = new storage::FileSystemContext( | 211 file_system_context_ = new storage::FileSystemContext( |
210 base::MessageLoopProxy::current().get(), | 212 base::ThreadTaskRunnerHandle::Get(), |
211 base::MessageLoopProxy::current().get(), | 213 base::ThreadTaskRunnerHandle::Get(), |
212 storage::ExternalMountPoints::CreateRefCounted().get(), | 214 storage::ExternalMountPoints::CreateRefCounted().get(), |
213 storage_policy.get(), | 215 storage_policy.get(), |
214 NULL, | 216 NULL, |
215 additional_providers.Pass(), | 217 additional_providers.Pass(), |
216 std::vector<storage::URLRequestAutoMountHandler>(), | 218 std::vector<storage::URLRequestAutoMountHandler>(), |
217 profile_dir_.path(), | 219 profile_dir_.path(), |
218 content::CreateAllowFileAccessOptions()); | 220 content::CreateAllowFileAccessOptions()); |
219 } | 221 } |
220 | 222 |
221 protected: | 223 protected: |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
342 completed = false; | 344 completed = false; |
343 ReadDirectoryTestHelper(operation_runner(), url, &contents, &completed); | 345 ReadDirectoryTestHelper(operation_runner(), url, &contents, &completed); |
344 ASSERT_TRUE(completed); | 346 ASSERT_TRUE(completed); |
345 ASSERT_EQ(1u, contents.size()); | 347 ASSERT_EQ(1u, contents.size()); |
346 | 348 |
347 EXPECT_FALSE(contents.front().is_directory); | 349 EXPECT_FALSE(contents.front().is_directory); |
348 EXPECT_EQ("a.jpg", contents.front().name); | 350 EXPECT_EQ("a.jpg", contents.front().name); |
349 } | 351 } |
350 | 352 |
351 } // namespace iphoto | 353 } // namespace iphoto |
OLD | NEW |