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

Unified Diff: chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm

Issue 16703025: [StorageMonitor] Move StorageMonitor ownership to BrowserProcessImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm
diff --git a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm
index c88493b8d900755fef294613abf8ea201746a0ec..f218de067f229d59571729e85872271c876608e4 100644
--- a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm
+++ b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm
@@ -19,6 +19,7 @@
#include "chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h"
#include "chrome/browser/storage_monitor/image_capture_device_manager.h"
#include "chrome/browser/storage_monitor/test_storage_monitor.h"
+#include "chrome/test/base/testing_browser_process.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -184,7 +185,11 @@ class MTPDeviceDelegateImplMacTest : public testing::Test {
content::BrowserThread::IO));
ASSERT_TRUE(io_thread_->Start());
- manager_.SetNotifications(monitor_.receiver());
+ chrome::test::TestStorageMonitor::RemoveSingleton();
+ chrome::test::TestStorageMonitor* monitor =
+ new chrome::test::TestStorageMonitor();
+ TestingBrowserProcess::GetGlobal()->SetStorageMonitor(monitor);
+ manager_.SetNotifications(monitor->receiver());
camera_ = [MockMTPICCameraDevice alloc];
id<ICDeviceBrowserDelegate> delegate = manager_.device_browser();
@@ -304,7 +309,6 @@ class MTPDeviceDelegateImplMacTest : public testing::Test {
scoped_ptr<content::TestBrowserThread> file_thread_;
scoped_ptr<content::TestBrowserThread> io_thread_;
base::ScopedTempDir temp_dir_;
- chrome::test::TestStorageMonitor monitor_;
chrome::ImageCaptureDeviceManager manager_;
MockMTPICCameraDevice* camera_;

Powered by Google App Engine
This is Rietveld 408576698