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

Side by Side Diff: chrome/browser/media_galleries/win/mtp_device_delegate_impl_win_unittest.cc

Issue 24269007: Media Galleries API: Fix MediaGalleriesPreferences finders race. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
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 <vector> 5 #include <vector>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 TestVolumeMountWatcherWin* mount_watcher = new TestVolumeMountWatcherWin; 76 TestVolumeMountWatcherWin* mount_watcher = new TestVolumeMountWatcherWin;
77 portable_device_watcher->set_use_dummy_mtp_storage_info(true); 77 portable_device_watcher->set_use_dummy_mtp_storage_info(true);
78 scoped_ptr<TestStorageMonitorWin> monitor( 78 scoped_ptr<TestStorageMonitorWin> monitor(
79 new TestStorageMonitorWin(mount_watcher, portable_device_watcher)); 79 new TestStorageMonitorWin(mount_watcher, portable_device_watcher));
80 TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); 80 TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal();
81 DCHECK(browser_process); 81 DCHECK(browser_process);
82 monitor_ = monitor.get(); 82 monitor_ = monitor.get();
83 browser_process->SetStorageMonitor(monitor.Pass()); 83 browser_process->SetStorageMonitor(monitor.Pass());
84 84
85 base::RunLoop runloop; 85 base::RunLoop runloop;
86 monitor_->EnsureInitialized(runloop.QuitClosure()); 86 browser_process->media_file_system_registry()->GetPreferences(profile())->
87 EnsureInitialized(runloop.QuitClosure());
87 runloop.Run(); 88 runloop.Run();
88 89
89 extensions::TestExtensionSystem* extension_system( 90 extensions::TestExtensionSystem* extension_system(
90 static_cast<extensions::TestExtensionSystem*>( 91 static_cast<extensions::TestExtensionSystem*>(
91 extensions::ExtensionSystem::Get(profile()))); 92 extensions::ExtensionSystem::Get(profile())));
92 extension_system->CreateExtensionService( 93 extension_system->CreateExtensionService(
93 CommandLine::ForCurrentProcess(), base::FilePath(), false); 94 CommandLine::ForCurrentProcess(), base::FilePath(), false);
94 95
95 std::vector<std::string> all_permissions; 96 std::vector<std::string> all_permissions;
96 all_permissions.push_back("allAutoDetected"); 97 all_permissions.push_back("allAutoDetected");
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 for (FSInfoMap::iterator i = results.begin(); i != results.end(); ++i) { 165 for (FSInfoMap::iterator i = results.begin(); i != results.end(); ++i) {
165 MediaFileSystemInfo info = i->second; 166 MediaFileSystemInfo info = i->second;
166 if (info.path == location) { 167 if (info.path == location) {
167 CheckGalleryInfo(info, location.LossyDisplayName(), location, true, true); 168 CheckGalleryInfo(info, location.LossyDisplayName(), location, true, true);
168 checked = true; 169 checked = true;
169 break; 170 break;
170 } 171 }
171 } 172 }
172 EXPECT_TRUE(checked); 173 EXPECT_TRUE(checked);
173 } 174 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698