| Index: chrome/browser/media_galleries/media_file_system_registry_unittest.cc
|
| diff --git a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc
|
| index 45e7fc2da9416eda5255fa2938e923351f183263..0609b8e74eb9f6bced44ceb4445ba9596962e85c 100644
|
| --- a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc
|
| +++ b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc
|
| @@ -17,6 +17,7 @@
|
| #include "base/run_loop.h"
|
| #include "base/stl_util.h"
|
| #include "base/stringprintf.h"
|
| +#include "base/synchronization/waitable_event.h"
|
| #include "base/threading/sequenced_worker_pool.h"
|
| #include "base/utf_string_conversions.h"
|
| #include "base/values.h"
|
| @@ -386,7 +387,7 @@ class MediaFileSystemRegistryTest : public ChromeRenderViewHostTestHarness {
|
| #if defined(OS_WIN)
|
| scoped_ptr<test::TestStorageMonitorWin> monitor_;
|
| #else
|
| - chrome::test::TestStorageMonitor monitor_;
|
| + scoped_ptr<chrome::test::TestStorageMonitor> monitor_;
|
| #endif
|
|
|
| MockProfileSharedRenderProcessHostFactory rph_factory_;
|
| @@ -724,7 +725,15 @@ MediaFileSystemRegistryTest::GetAutoAddedGalleries(
|
| }
|
|
|
| void MediaFileSystemRegistryTest::SetUp() {
|
| -#if defined(OS_WIN)
|
| +#if !defined(OS_WIN)
|
| + monitor_.reset(new test::TestStorageMonitor());
|
| + base::WaitableEvent wait_for_init(false, false);
|
| + monitor_->Initialize(base::Bind(&base::WaitableEvent::Signal,
|
| + base::Unretained(&wait_for_init)));
|
| + monitor_->MarkInitialized();
|
| + base::RunLoop().RunUntilIdle();
|
| + DCHECK(wait_for_init.IsSignaled());
|
| +#else
|
| test::TestPortableDeviceWatcherWin* portable_device_watcher =
|
| new test::TestPortableDeviceWatcherWin;
|
| test::TestVolumeMountWatcherWin* mount_watcher =
|
| @@ -732,7 +741,10 @@ void MediaFileSystemRegistryTest::SetUp() {
|
| portable_device_watcher->set_use_dummy_mtp_storage_info(true);
|
| monitor_.reset(new test::TestStorageMonitorWin(
|
| mount_watcher, portable_device_watcher));
|
| - monitor_->Init();
|
| + base::WaitableEvent wait_for_init(false, false);
|
| + wait_for_init.Reset();
|
| + monitor_->Initialize(base::Bind(&base::WaitableEvent::Signal,
|
| + base::Unretained(&wait_for_init)));
|
| // TODO(gbillock): Replace this with the correct event notification
|
| // on the storage monitor finishing the startup scan when that exists.
|
| base::RunLoop().RunUntilIdle();
|
| @@ -740,6 +752,7 @@ void MediaFileSystemRegistryTest::SetUp() {
|
| base::RunLoop().RunUntilIdle();
|
| mount_watcher->FlushWorkerPoolForTesting();
|
| base::RunLoop().RunUntilIdle();
|
| + DCHECK(wait_for_init.IsSignaled());
|
| #endif
|
|
|
| ChromeRenderViewHostTestHarness::SetUp();
|
| @@ -888,7 +901,7 @@ TEST_F(MediaFileSystemRegistryTest, GalleryNameDefault) {
|
|
|
| // TODO(gbillock): Put the platform-specific parts of this test in tests
|
| // for those classes, not here. This test, internally, ends up creating an
|
| -// MTP delegate.
|
| +// MTP delegate. (Probably ./win/mtp_device_delegate_impl_win_unittest)
|
| #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM)
|
| #if !defined(OS_MACOSX)
|
| TEST_F(MediaFileSystemRegistryTest, GalleryNameMTP) {
|
|
|