| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <utility> |
| 7 #include <vector> | 8 #include <vector> |
| 8 | 9 |
| 9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 12 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 13 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 14 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/extensions/extension_service.h" | 16 #include "chrome/browser/extensions/extension_service.h" |
| 16 #include "chrome/browser/extensions/test_extension_system.h" | 17 #include "chrome/browser/extensions/test_extension_system.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 TestStorageMonitor::Destroy(); | 84 TestStorageMonitor::Destroy(); |
| 84 TestPortableDeviceWatcherWin* portable_device_watcher = | 85 TestPortableDeviceWatcherWin* portable_device_watcher = |
| 85 new TestPortableDeviceWatcherWin; | 86 new TestPortableDeviceWatcherWin; |
| 86 TestVolumeMountWatcherWin* mount_watcher = new TestVolumeMountWatcherWin; | 87 TestVolumeMountWatcherWin* mount_watcher = new TestVolumeMountWatcherWin; |
| 87 portable_device_watcher->set_use_dummy_mtp_storage_info(true); | 88 portable_device_watcher->set_use_dummy_mtp_storage_info(true); |
| 88 scoped_ptr<TestStorageMonitorWin> monitor( | 89 scoped_ptr<TestStorageMonitorWin> monitor( |
| 89 new TestStorageMonitorWin(mount_watcher, portable_device_watcher)); | 90 new TestStorageMonitorWin(mount_watcher, portable_device_watcher)); |
| 90 TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); | 91 TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); |
| 91 DCHECK(browser_process); | 92 DCHECK(browser_process); |
| 92 monitor_ = monitor.get(); | 93 monitor_ = monitor.get(); |
| 93 StorageMonitor::SetStorageMonitorForTesting(monitor.Pass()); | 94 StorageMonitor::SetStorageMonitorForTesting(std::move(monitor)); |
| 94 | 95 |
| 95 base::RunLoop runloop; | 96 base::RunLoop runloop; |
| 96 browser_process->media_file_system_registry()->GetPreferences(profile())-> | 97 browser_process->media_file_system_registry()->GetPreferences(profile())-> |
| 97 EnsureInitialized(runloop.QuitClosure()); | 98 EnsureInitialized(runloop.QuitClosure()); |
| 98 runloop.Run(); | 99 runloop.Run(); |
| 99 | 100 |
| 100 extensions::TestExtensionSystem* extension_system( | 101 extensions::TestExtensionSystem* extension_system( |
| 101 static_cast<extensions::TestExtensionSystem*>( | 102 static_cast<extensions::TestExtensionSystem*>( |
| 102 extensions::ExtensionSystem::Get(profile()))); | 103 extensions::ExtensionSystem::Get(profile()))); |
| 103 extension_system->CreateExtensionService( | 104 extension_system->CreateExtensionService( |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 for (FSInfoMap::iterator i = results.begin(); i != results.end(); ++i) { | 175 for (FSInfoMap::iterator i = results.begin(); i != results.end(); ++i) { |
| 175 MediaFileSystemInfo info = i->second; | 176 MediaFileSystemInfo info = i->second; |
| 176 if (info.path == location) { | 177 if (info.path == location) { |
| 177 CheckGalleryInfo(info, location.LossyDisplayName(), location, true, true); | 178 CheckGalleryInfo(info, location.LossyDisplayName(), location, true, true); |
| 178 checked = true; | 179 checked = true; |
| 179 break; | 180 break; |
| 180 } | 181 } |
| 181 } | 182 } |
| 182 EXPECT_TRUE(checked); | 183 EXPECT_TRUE(checked); |
| 183 } | 184 } |
| OLD | NEW |