| Index: chrome/browser/system_monitor/image_capture_device_manager_unittest.mm
|
| diff --git a/chrome/browser/system_monitor/image_capture_device_manager_unittest.mm b/chrome/browser/system_monitor/image_capture_device_manager_unittest.mm
|
| index 9cf3787bda8de67ccfe1399cc79a8c0b7de74698..3eadcdc78348875bff1934cf71bc362b52697fe5 100644
|
| --- a/chrome/browser/system_monitor/image_capture_device_manager_unittest.mm
|
| +++ b/chrome/browser/system_monitor/image_capture_device_manager_unittest.mm
|
| @@ -12,9 +12,9 @@
|
| #include "base/mac/foundation_util.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/message_loop.h"
|
| -#include "base/system_monitor/system_monitor.h"
|
| #include "chrome/browser/system_monitor/image_capture_device.h"
|
| #include "chrome/browser/system_monitor/image_capture_device_manager.h"
|
| +#include "chrome/browser/system_monitor/test_removable_storage_notifications.h"
|
| #include "content/public/test/test_browser_thread.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -217,8 +217,6 @@ class TestCameraListener
|
| class ImageCaptureDeviceManagerTest : public testing::Test {
|
| public:
|
| virtual void SetUp() OVERRIDE {
|
| - base::SystemMonitor::AllocateSystemIOPorts();
|
| - system_monitor_.reset(new base::SystemMonitor());
|
| ui_thread_.reset(new content::TestBrowserThread(
|
| content::BrowserThread::UI, &message_loop_));
|
| }
|
| @@ -242,26 +240,28 @@ class ImageCaptureDeviceManagerTest : public testing::Test {
|
| protected:
|
| MessageLoopForUI message_loop_;
|
| scoped_ptr<content::TestBrowserThread> ui_thread_;
|
| - scoped_ptr<base::SystemMonitor> system_monitor_;
|
| + chrome::test::TestRemovableStorageNotifications notifications_;
|
| TestCameraListener listener_;
|
| };
|
|
|
| TEST_F(ImageCaptureDeviceManagerTest, TestAttachDetach) {
|
| chrome::ImageCaptureDeviceManager manager;
|
| + manager.SetNotifications(notifications_.receiver());
|
| ICCameraDevice* device = AttachDevice(&manager);
|
| - std::vector<base::SystemMonitor::RemovableStorageInfo> devices =
|
| - system_monitor_->GetAttachedRemovableStorage();
|
| + std::vector<chrome::RemovableStorageNotifications::StorageInfo> devices =
|
| + notifications_.GetAttachedStorage();
|
|
|
| ASSERT_EQ(1U, devices.size());
|
| EXPECT_EQ(std::string("ic:") + kDeviceId, devices[0].device_id);
|
|
|
| DetachDevice(&manager, device);
|
| - devices = system_monitor_->GetAttachedRemovableStorage();
|
| + devices = notifications_.GetAttachedStorage();
|
| ASSERT_EQ(0U, devices.size());
|
| };
|
|
|
| TEST_F(ImageCaptureDeviceManagerTest, OpenCamera) {
|
| chrome::ImageCaptureDeviceManager manager;
|
| + manager.SetNotifications(notifications_.receiver());
|
| ICCameraDevice* device = AttachDevice(&manager);
|
|
|
| EXPECT_FALSE(chrome::ImageCaptureDeviceManager::deviceForUUID(
|
| @@ -298,6 +298,7 @@ TEST_F(ImageCaptureDeviceManagerTest, OpenCamera) {
|
|
|
| TEST_F(ImageCaptureDeviceManagerTest, RemoveCamera) {
|
| chrome::ImageCaptureDeviceManager manager;
|
| + manager.SetNotifications(notifications_.receiver());
|
| ICCameraDevice* device = AttachDevice(&manager);
|
|
|
| scoped_nsobject<ImageCaptureDevice> camera(
|
| @@ -317,6 +318,7 @@ TEST_F(ImageCaptureDeviceManagerTest, DownloadFile) {
|
| content::BrowserThread::FILE, &message_loop_));
|
|
|
| chrome::ImageCaptureDeviceManager manager;
|
| + manager.SetNotifications(notifications_.receiver());
|
| MockICCameraDevice* device = AttachDevice(&manager);
|
|
|
| scoped_nsobject<ImageCaptureDevice> camera(
|
|
|