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

Unified Diff: chrome/browser/system_monitor/removable_device_notifications_linux_unittest.cc

Issue 10911234: Update Windows System Monitor Removable Device Impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Win compile Created 8 years, 3 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/removable_device_notifications_linux_unittest.cc
diff --git a/chrome/browser/system_monitor/removable_device_notifications_linux_unittest.cc b/chrome/browser/system_monitor/removable_device_notifications_linux_unittest.cc
index 2e6913582660318f126b439d66bb4185d743635f..fc1b8379ab4d931cb0b314774cc01eec3f0b2a20 100644
--- a/chrome/browser/system_monitor/removable_device_notifications_linux_unittest.cc
+++ b/chrome/browser/system_monitor/removable_device_notifications_linux_unittest.cc
@@ -564,92 +564,6 @@ TEST_F(RemovableDeviceNotificationLinuxTest,
WriteEmptyMtabAndRunLoop();
}
-TEST_F(RemovableDeviceNotificationLinuxTest, MountLookUp) {
- FilePath test_path_a = CreateMountPointWithDCIMDir(kMountPointA);
- FilePath test_path_b = CreateMountPointWithoutDCIMDir(kMountPointB);
- FilePath test_path_c = CreateMountPointWithoutDCIMDir(kMountPointC);
- ASSERT_FALSE(test_path_a.empty());
- ASSERT_FALSE(test_path_b.empty());
- ASSERT_FALSE(test_path_c.empty());
-
- // Attach to one first. (*'d mounts are those SystemMonitor knows about.)
- // kDeviceDCIM1 -> kMountPointA *
- // kDeviceNoDCIM -> kMountPointB *
- // kDeviceFixed -> kMountPointC
- MtabTestData test_data1[] = {
- MtabTestData(kDeviceDCIM1, test_path_a.value(), kValidFS),
- MtabTestData(kDeviceNoDCIM, test_path_b.value(), kValidFS),
- MtabTestData(kDeviceFixed, test_path_c.value(), kValidFS),
- };
- EXPECT_CALL(observer(), OnRemovableStorageAttached(_, _, _)).Times(2);
- EXPECT_CALL(observer(), OnRemovableStorageDetached(_)).Times(0);
- AppendToMtabAndRunLoop(test_data1, arraysize(test_data1));
-
- EXPECT_EQ(test_path_a,
- notifier()->GetDeviceMountPoint(GetDeviceId(kDeviceDCIM1)));
- EXPECT_EQ(test_path_b,
- notifier()->GetDeviceMountPoint(GetDeviceId(kDeviceNoDCIM)));
- EXPECT_EQ(test_path_c,
- notifier()->GetDeviceMountPoint(GetDeviceId(kDeviceFixed)));
- EXPECT_EQ(FilePath(),
- notifier()->GetDeviceMountPoint(GetDeviceId(kInvalidDevice)));
-
- // Make |kDeviceDCIM1| mounted in multiple places.
- // kDeviceDCIM1 -> kMountPointA *
- // kDeviceDCIM1 -> kMountPointB
- // kDeviceDCIM1 -> kMountPointC
- MtabTestData test_data2[] = {
- MtabTestData(kDeviceDCIM1, test_path_a.value(), kValidFS),
- MtabTestData(kDeviceDCIM1, test_path_b.value(), kValidFS),
- MtabTestData(kDeviceDCIM1, test_path_c.value(), kValidFS),
- };
- EXPECT_CALL(observer(), OnRemovableStorageAttached(_, _, _)).Times(0);
- EXPECT_CALL(observer(), OnRemovableStorageDetached(_)).Times(1);
- // Add DCIM dirs.
- CreateMountPointWithDCIMDir(kMountPointB);
- CreateMountPointWithDCIMDir(kMountPointC);
- OverwriteMtabAndRunLoop(test_data2, arraysize(test_data2));
-
- EXPECT_EQ(test_path_a,
- notifier()->GetDeviceMountPoint(GetDeviceId(kDeviceDCIM1)));
-
- // Unmount |kDeviceDCIM1| from |kMountPointA|.
- // kDeviceDCIM1 -> kMountPointB *
- // kDeviceDCIM1 -> kMountPointC
- // Either |kMountPointB| or |kMountPointC| is a valid new default, but
- // it turns out that it will be B.
- MtabTestData test_data3[] = {
- MtabTestData(kDeviceDCIM1, test_path_b.value(), kValidFS),
- };
- EXPECT_CALL(observer(), OnRemovableStorageAttached(_, _, _)).Times(1);
- EXPECT_CALL(observer(), OnRemovableStorageDetached(_)).Times(1);
- OverwriteMtabAndRunLoop(test_data3, arraysize(test_data3));
-
- EXPECT_EQ(test_path_b,
- notifier()->GetDeviceMountPoint(GetDeviceId(kDeviceDCIM1)));
-
- // Mount a non-removable device in multiple places.
- // kDeviceFixed -> kMountPointA
- // kDeviceFixed -> kMountPointB
- // kDeviceFixed -> kMountPointC
- MtabTestData test_data4[] = {
- MtabTestData(kDeviceFixed, test_path_a.value(), kValidFS),
- MtabTestData(kDeviceFixed, test_path_b.value(), kValidFS),
- MtabTestData(kDeviceFixed, test_path_c.value(), kValidFS),
- };
- EXPECT_CALL(observer(), OnRemovableStorageAttached(_, _, _)).Times(0);
- EXPECT_CALL(observer(), OnRemovableStorageDetached(_)).Times(1);
- // Remove DCIM dirs.
- RemoveDCIMDirFromMountPoint(kMountPointA);
- RemoveDCIMDirFromMountPoint(kMountPointB);
- RemoveDCIMDirFromMountPoint(kMountPointC);
- OverwriteMtabAndRunLoop(test_data4, arraysize(test_data4));
-
- // Any of the mount points would be valid.
- EXPECT_EQ(test_path_a.value(),
- notifier()->GetDeviceMountPoint(GetDeviceId(kDeviceFixed)).value());
-}
-
TEST_F(RemovableDeviceNotificationLinuxTest, DeviceLookUp) {
FilePath test_path_a = CreateMountPointWithDCIMDir(kMountPointA);
FilePath test_path_b = CreateMountPointWithoutDCIMDir(kMountPointB);

Powered by Google App Engine
This is Rietveld 408576698