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

Unified Diff: chrome/browser/system_monitor/image_capture_device_manager_unittest.mm

Issue 12147002: Add a receiver interface to RemovableStorageNotifications. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merging Created 7 years, 10 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/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(
« no previous file with comments | « chrome/browser/system_monitor/image_capture_device_manager.mm ('k') | chrome/browser/system_monitor/media_storage_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698