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

Side by Side Diff: chrome/browser/media_galleries/fileapi/itunes_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.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.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/run_loop.h" 13 #include "base/run_loop.h"
14 #include "base/single_thread_task_runner.h"
14 #include "base/synchronization/waitable_event.h" 15 #include "base/synchronization/waitable_event.h"
16 #include "base/thread_task_runner_handle.h"
15 #include "base/time/time.h" 17 #include "base/time/time.h"
16 #include "chrome/browser/media_galleries/fileapi/itunes_data_provider.h" 18 #include "chrome/browser/media_galleries/fileapi/itunes_data_provider.h"
17 #include "chrome/browser/media_galleries/fileapi/itunes_file_util.h" 19 #include "chrome/browser/media_galleries/fileapi/itunes_file_util.h"
18 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" 20 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h"
19 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h" 21 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h"
20 #include "chrome/browser/media_galleries/imported_media_gallery_registry.h" 22 #include "chrome/browser/media_galleries/imported_media_gallery_registry.h"
21 #include "content/public/browser/browser_thread.h" 23 #include "content/public/browser/browser_thread.h"
22 #include "content/public/test/mock_special_storage_policy.h" 24 #include "content/public/test/mock_special_storage_policy.h"
23 #include "content/public/test/test_browser_thread.h" 25 #include "content/public/test/test_browser_thread.h"
24 #include "content/public/test/test_file_system_options.h" 26 #include "content/public/test/test_file_system_options.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 event.Wait(); 170 event.Wait();
169 171
170 media_path_filter_.reset(new MediaPathFilter()); 172 media_path_filter_.reset(new MediaPathFilter());
171 ScopedVector<storage::FileSystemBackend> additional_providers; 173 ScopedVector<storage::FileSystemBackend> additional_providers;
172 additional_providers.push_back(new TestMediaFileSystemBackend( 174 additional_providers.push_back(new TestMediaFileSystemBackend(
173 profile_dir_.path(), 175 profile_dir_.path(),
174 new TestITunesFileUtil(media_path_filter_.get(), 176 new TestITunesFileUtil(media_path_filter_.get(),
175 itunes_data_provider_.get()))); 177 itunes_data_provider_.get())));
176 178
177 file_system_context_ = new storage::FileSystemContext( 179 file_system_context_ = new storage::FileSystemContext(
178 base::MessageLoopProxy::current().get(), 180 base::ThreadTaskRunnerHandle::Get().get(),
179 base::MessageLoopProxy::current().get(), 181 base::ThreadTaskRunnerHandle::Get().get(),
180 storage::ExternalMountPoints::CreateRefCounted().get(), 182 storage::ExternalMountPoints::CreateRefCounted().get(),
181 storage_policy.get(), 183 storage_policy.get(),
182 NULL, 184 NULL,
183 additional_providers.Pass(), 185 additional_providers.Pass(),
184 std::vector<storage::URLRequestAutoMountHandler>(), 186 std::vector<storage::URLRequestAutoMountHandler>(),
185 profile_dir_.path(), 187 profile_dir_.path(),
186 content::CreateAllowFileAccessOptions()); 188 content::CreateAllowFileAccessOptions());
187 } 189 }
188 190
189 protected: 191 protected:
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 completed = false; 342 completed = false;
341 ReadDirectoryTestHelper(operation_runner(), url, &contents, &completed); 343 ReadDirectoryTestHelper(operation_runner(), url, &contents, &completed);
342 ASSERT_TRUE(completed); 344 ASSERT_TRUE(completed);
343 ASSERT_EQ(1u, contents.size()); 345 ASSERT_EQ(1u, contents.size());
344 EXPECT_FALSE(contents.front().is_directory); 346 EXPECT_FALSE(contents.front().is_directory);
345 EXPECT_EQ(base::FilePath().AppendASCII("baz.ogg").value(), 347 EXPECT_EQ(base::FilePath().AppendASCII("baz.ogg").value(),
346 contents.front().name); 348 contents.front().name);
347 } 349 }
348 350
349 } // namespace itunes 351 } // namespace itunes
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698