Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: chrome/browser/media_galleries/fileapi/picasa_file_util_unittest.cc

Issue 1130993002: [chrome/browser/media_galleries/fileapi] Use ThreadTaskRunnerHandle instead of MessageLoopProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Build Break Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/files/file_util.h" 11 #include "base/files/file_util.h"
12 #include "base/files/scoped_temp_dir.h" 12 #include "base/files/scoped_temp_dir.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_vector.h" 14 #include "base/memory/scoped_vector.h"
15 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
16 #include "base/message_loop/message_loop_proxy.h"
17 #include "base/run_loop.h" 16 #include "base/run_loop.h"
17 #include "base/single_thread_task_runner.h"
18 #include "base/strings/stringprintf.h" 18 #include "base/strings/stringprintf.h"
19 #include "base/thread_task_runner_handle.h"
19 #include "base/time/time.h" 20 #include "base/time/time.h"
20 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" 21 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h"
21 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h" 22 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h"
22 #include "chrome/browser/media_galleries/fileapi/picasa_data_provider.h" 23 #include "chrome/browser/media_galleries/fileapi/picasa_data_provider.h"
23 #include "chrome/browser/media_galleries/fileapi/picasa_file_util.h" 24 #include "chrome/browser/media_galleries/fileapi/picasa_file_util.h"
24 #include "chrome/browser/media_galleries/imported_media_gallery_registry.h" 25 #include "chrome/browser/media_galleries/imported_media_gallery_registry.h"
25 #include "chrome/common/media_galleries/picasa_types.h" 26 #include "chrome/common/media_galleries/picasa_types.h"
26 #include "chrome/common/media_galleries/pmp_constants.h" 27 #include "chrome/common/media_galleries/pmp_constants.h"
27 #include "content/public/browser/browser_thread.h" 28 #include "content/public/browser/browser_thread.h"
28 #include "content/public/test/mock_special_storage_policy.h" 29 #include "content/public/test/mock_special_storage_policy.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 237
237 media_path_filter_.reset(new MediaPathFilter()); 238 media_path_filter_.reset(new MediaPathFilter());
238 239
239 ScopedVector<storage::FileSystemBackend> additional_providers; 240 ScopedVector<storage::FileSystemBackend> additional_providers;
240 additional_providers.push_back(new TestMediaFileSystemBackend( 241 additional_providers.push_back(new TestMediaFileSystemBackend(
241 profile_dir_.path(), 242 profile_dir_.path(),
242 new TestPicasaFileUtil(media_path_filter_.get(), 243 new TestPicasaFileUtil(media_path_filter_.get(),
243 picasa_data_provider_.get()))); 244 picasa_data_provider_.get())));
244 245
245 file_system_context_ = new storage::FileSystemContext( 246 file_system_context_ = new storage::FileSystemContext(
246 base::MessageLoopProxy::current().get(), 247 base::ThreadTaskRunnerHandle::Get().get(),
247 base::MessageLoopProxy::current().get(), 248 base::ThreadTaskRunnerHandle::Get().get(),
248 storage::ExternalMountPoints::CreateRefCounted().get(), 249 storage::ExternalMountPoints::CreateRefCounted().get(),
249 storage_policy.get(), 250 storage_policy.get(),
250 NULL, 251 NULL,
251 additional_providers.Pass(), 252 additional_providers.Pass(),
252 std::vector<storage::URLRequestAutoMountHandler>(), 253 std::vector<storage::URLRequestAutoMountHandler>(),
253 profile_dir_.path(), 254 profile_dir_.path(),
254 content::CreateAllowFileAccessOptions()); 255 content::CreateAllowFileAccessOptions());
255 } 256 }
256 257
257 void TearDown() override { 258 void TearDown() override {
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 operation_runner()->CreateSnapshotFile( 591 operation_runner()->CreateSnapshotFile(
591 CreateURL(std::string(kPicasaDirAlbums) + 592 CreateURL(std::string(kPicasaDirAlbums) +
592 "/albumname 2013-04-16/mapped_name.jpg"), 593 "/albumname 2013-04-16/mapped_name.jpg"),
593 snapshot_callback); 594 snapshot_callback);
594 loop.Run(); 595 loop.Run();
595 EXPECT_EQ(base::File::FILE_OK, error); 596 EXPECT_EQ(base::File::FILE_OK, error);
596 EXPECT_EQ(image_path, platform_path_result); 597 EXPECT_EQ(image_path, platform_path_result);
597 } 598 }
598 599
599 } // namespace picasa 600 } // namespace picasa
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698