| 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 "chrome/browser/media_galleries/fileapi/itunes_file_util.h" | 5 #include "chrome/browser/media_galleries/fileapi/itunes_file_util.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 ImportedMediaGalleryRegistry::GetInstance()->Initialize(); | 159 ImportedMediaGalleryRegistry::GetInstance()->Initialize(); |
| 160 | 160 |
| 161 scoped_refptr<storage::SpecialStoragePolicy> storage_policy = | 161 scoped_refptr<storage::SpecialStoragePolicy> storage_policy = |
| 162 new content::MockSpecialStoragePolicy(); | 162 new content::MockSpecialStoragePolicy(); |
| 163 | 163 |
| 164 // Initialize fake ItunesDataProvider on media task runner thread. | 164 // Initialize fake ItunesDataProvider on media task runner thread. |
| 165 MediaFileSystemBackend::MediaTaskRunner()->PostTask( | 165 MediaFileSystemBackend::MediaTaskRunner()->PostTask( |
| 166 FROM_HERE, | 166 FROM_HERE, |
| 167 base::Bind(&ItunesFileUtilTest::SetUpDataProvider, | 167 base::Bind(&ItunesFileUtilTest::SetUpDataProvider, |
| 168 base::Unretained(this))); | 168 base::Unretained(this))); |
| 169 base::WaitableEvent event(true, false /* initially_signalled */); | 169 base::WaitableEvent event(base::WaitableEvent::ResetPolicy::MANUAL, |
| 170 base::WaitableEvent::InitialState::NOT_SIGNALED); |
| 170 MediaFileSystemBackend::MediaTaskRunner()->PostTask( | 171 MediaFileSystemBackend::MediaTaskRunner()->PostTask( |
| 171 FROM_HERE, | 172 FROM_HERE, |
| 172 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&event))); | 173 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&event))); |
| 173 event.Wait(); | 174 event.Wait(); |
| 174 | 175 |
| 175 media_path_filter_.reset(new MediaPathFilter()); | 176 media_path_filter_.reset(new MediaPathFilter()); |
| 176 ScopedVector<storage::FileSystemBackend> additional_providers; | 177 ScopedVector<storage::FileSystemBackend> additional_providers; |
| 177 additional_providers.push_back(new TestMediaFileSystemBackend( | 178 additional_providers.push_back(new TestMediaFileSystemBackend( |
| 178 profile_dir_.path(), | 179 profile_dir_.path(), |
| 179 new TestITunesFileUtil(media_path_filter_.get(), | 180 new TestITunesFileUtil(media_path_filter_.get(), |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 completed = false; | 343 completed = false; |
| 343 ReadDirectoryTestHelper(operation_runner(), url, &contents, &completed); | 344 ReadDirectoryTestHelper(operation_runner(), url, &contents, &completed); |
| 344 ASSERT_TRUE(completed); | 345 ASSERT_TRUE(completed); |
| 345 ASSERT_EQ(1u, contents.size()); | 346 ASSERT_EQ(1u, contents.size()); |
| 346 EXPECT_FALSE(contents.front().is_directory); | 347 EXPECT_FALSE(contents.front().is_directory); |
| 347 EXPECT_EQ(base::FilePath().AppendASCII("baz.ogg").value(), | 348 EXPECT_EQ(base::FilePath().AppendASCII("baz.ogg").value(), |
| 348 contents.front().name); | 349 contents.front().name); |
| 349 } | 350 } |
| 350 | 351 |
| 351 } // namespace itunes | 352 } // namespace itunes |
| OLD | NEW |