| Index: base/system_monitor/system_monitor_unittest.cc
|
| diff --git a/base/system_monitor/system_monitor_unittest.cc b/base/system_monitor/system_monitor_unittest.cc
|
| index 10bd7e7acad0be85f7ce8bb5c5da932136680dbe..713b24b9ab6eb7fa60efa48fcc126ec5f7c2e093 100644
|
| --- a/base/system_monitor/system_monitor_unittest.cc
|
| +++ b/base/system_monitor/system_monitor_unittest.cc
|
| @@ -119,14 +119,6 @@ TEST_F(SystemMonitorTest, DeviceChangeNotifications) {
|
| OnDevicesChanged(SystemMonitor::DEVTYPE_UNKNOWN))
|
| .Times(3)
|
| .InSequence(mock_sequencer[index]);
|
| - EXPECT_CALL(observers[index], OnRemovableStorageAttached(kDeviceId1,
|
| - kDeviceName,
|
| - testing::_))
|
| - .InSequence(mock_sequencer[index]);
|
| - EXPECT_CALL(observers[index], OnRemovableStorageDetached(kDeviceId1))
|
| - .InSequence(mock_sequencer[index]);
|
| - EXPECT_CALL(observers[index], OnRemovableStorageDetached(kDeviceId2))
|
| - .Times(0).InSequence(mock_sequencer[index]);
|
| }
|
|
|
| system_monitor_->ProcessDevicesChanged(SystemMonitor::DEVTYPE_UNKNOWN);
|
| @@ -135,66 +127,6 @@ TEST_F(SystemMonitorTest, DeviceChangeNotifications) {
|
| system_monitor_->ProcessDevicesChanged(SystemMonitor::DEVTYPE_UNKNOWN);
|
| system_monitor_->ProcessDevicesChanged(SystemMonitor::DEVTYPE_UNKNOWN);
|
| message_loop_.RunUntilIdle();
|
| -
|
| - system_monitor_->ProcessRemovableStorageAttached(kDeviceId1,
|
| - kDeviceName,
|
| - FILE_PATH_LITERAL("path"));
|
| - message_loop_.RunUntilIdle();
|
| -
|
| - system_monitor_->ProcessRemovableStorageDetached(kDeviceId1);
|
| - system_monitor_->ProcessRemovableStorageDetached(kDeviceId2);
|
| - message_loop_.RunUntilIdle();
|
| -}
|
| -
|
| -TEST_F(SystemMonitorTest, GetAttachedRemovableStorageEmpty) {
|
| - std::vector<SystemMonitor::RemovableStorageInfo> devices =
|
| - system_monitor_->GetAttachedRemovableStorage();
|
| - EXPECT_EQ(0U, devices.size());
|
| -}
|
| -
|
| -TEST_F(SystemMonitorTest, GetAttachedRemovableStorageAttachDetach) {
|
| - const std::string kDeviceId1 = "42";
|
| - const string16 kDeviceName1 = ASCIIToUTF16("test");
|
| - const FilePath kDevicePath1(FILE_PATH_LITERAL("/testfoo"));
|
| - system_monitor_->ProcessRemovableStorageAttached(kDeviceId1,
|
| - kDeviceName1,
|
| - kDevicePath1.value());
|
| - message_loop_.RunUntilIdle();
|
| - std::vector<SystemMonitor::RemovableStorageInfo> devices =
|
| - system_monitor_->GetAttachedRemovableStorage();
|
| - ASSERT_EQ(1U, devices.size());
|
| - EXPECT_EQ(kDeviceId1, devices[0].device_id);
|
| - EXPECT_EQ(kDeviceName1, devices[0].name);
|
| - EXPECT_EQ(kDevicePath1.value(), devices[0].location);
|
| -
|
| - const std::string kDeviceId2 = "44";
|
| - const string16 kDeviceName2 = ASCIIToUTF16("test2");
|
| - const FilePath kDevicePath2(FILE_PATH_LITERAL("/testbar"));
|
| - system_monitor_->ProcessRemovableStorageAttached(kDeviceId2,
|
| - kDeviceName2,
|
| - kDevicePath2.value());
|
| - message_loop_.RunUntilIdle();
|
| - devices = system_monitor_->GetAttachedRemovableStorage();
|
| - ASSERT_EQ(2U, devices.size());
|
| - EXPECT_EQ(kDeviceId1, devices[0].device_id);
|
| - EXPECT_EQ(kDeviceName1, devices[0].name);
|
| - EXPECT_EQ(kDevicePath1.value(), devices[0].location);
|
| - EXPECT_EQ(kDeviceId2, devices[1].device_id);
|
| - EXPECT_EQ(kDeviceName2, devices[1].name);
|
| - EXPECT_EQ(kDevicePath2.value(), devices[1].location);
|
| -
|
| - system_monitor_->ProcessRemovableStorageDetached(kDeviceId1);
|
| - message_loop_.RunUntilIdle();
|
| - devices = system_monitor_->GetAttachedRemovableStorage();
|
| - ASSERT_EQ(1U, devices.size());
|
| - EXPECT_EQ(kDeviceId2, devices[0].device_id);
|
| - EXPECT_EQ(kDeviceName2, devices[0].name);
|
| - EXPECT_EQ(kDevicePath2.value(), devices[0].location);
|
| -
|
| - system_monitor_->ProcessRemovableStorageDetached(kDeviceId2);
|
| - message_loop_.RunUntilIdle();
|
| - devices = system_monitor_->GetAttachedRemovableStorage();
|
| - EXPECT_EQ(0U, devices.size());
|
| }
|
|
|
| } // namespace
|
|
|