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

Unified Diff: chrome/browser/media_gallery/media_device_notifications_linux_unittest.cc

Issue 10781014: Isolated FS for media devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 8 years, 5 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_gallery/media_device_notifications_linux_unittest.cc
diff --git a/chrome/browser/media_gallery/media_device_notifications_linux_unittest.cc b/chrome/browser/media_gallery/media_device_notifications_linux_unittest.cc
index 0493a70713394a40f74f26d02d6781c898493342..228408b61e39d381e87fa5ff73bb89c0272f01fd 100644
--- a/chrome/browser/media_gallery/media_device_notifications_linux_unittest.cc
+++ b/chrome/browser/media_gallery/media_device_notifications_linux_unittest.cc
@@ -247,8 +247,8 @@ TEST_F(MediaDeviceNotificationsLinuxTest, BasicAttachDetach) {
AppendToMtabAndRunLoop(test_data, arraysize(test_data));
// |kDevice2| should be detached here.
- EXPECT_CALL(observer(), OnMediaDeviceDetached(kDeviceId))
- .InSequence(mock_sequence);
+ EXPECT_CALL(observer(), OnMediaDeviceDetached(
+ kDeviceId, test_path.value())).InSequence(mock_sequence);
WriteEmptyMtabAndRunLoop();
}
@@ -279,8 +279,8 @@ TEST_F(MediaDeviceNotificationsLinuxTest, DCIM) {
AppendToMtabAndRunLoop(test_data2, arraysize(test_data2));
// |kDevice1| should be detached as expected.
- EXPECT_CALL(observer(), OnMediaDeviceDetached(kDeviceId))
- .InSequence(mock_sequence);
+ EXPECT_CALL(observer(), OnMediaDeviceDetached(
+ kDeviceId, test_path_a.value())).InSequence(mock_sequence);
WriteEmptyMtabAndRunLoop();
}
@@ -299,7 +299,7 @@ TEST_F(MediaDeviceNotificationsLinuxTest, MultiDevicesMultiMountPoints) {
MtabTestData(kDevice2, test_path_b.value(), kValidFS),
};
EXPECT_CALL(observer(), OnMediaDeviceAttached(_, _, _, _)).Times(2);
- EXPECT_CALL(observer(), OnMediaDeviceDetached(_)).Times(0);
+ EXPECT_CALL(observer(), OnMediaDeviceDetached(_, _)).Times(0);
AppendToMtabAndRunLoop(test_data1, arraysize(test_data1));
// Attach |kDevice1| to |kMountPointB|.
@@ -312,7 +312,7 @@ TEST_F(MediaDeviceNotificationsLinuxTest, MultiDevicesMultiMountPoints) {
MtabTestData(kDevice1, test_path_b.value(), kValidFS),
};
EXPECT_CALL(observer(), OnMediaDeviceAttached(_, _, _, _)).Times(1);
- EXPECT_CALL(observer(), OnMediaDeviceDetached(_)).Times(2);
+ EXPECT_CALL(observer(), OnMediaDeviceDetached(_, _)).Times(2);
AppendToMtabAndRunLoop(test_data2, arraysize(test_data2));
// Attach |kDevice2| to |kMountPointA|.
@@ -324,7 +324,7 @@ TEST_F(MediaDeviceNotificationsLinuxTest, MultiDevicesMultiMountPoints) {
MtabTestData(kDevice2, test_path_a.value(), kValidFS),
};
EXPECT_CALL(observer(), OnMediaDeviceAttached(_, _, _, _)).Times(1);
- EXPECT_CALL(observer(), OnMediaDeviceDetached(_)).Times(0);
+ EXPECT_CALL(observer(), OnMediaDeviceDetached(_, _)).Times(0);
AppendToMtabAndRunLoop(test_data3, arraysize(test_data3));
// Detach |kDevice2| from |kMountPointA|.
@@ -337,19 +337,19 @@ TEST_F(MediaDeviceNotificationsLinuxTest, MultiDevicesMultiMountPoints) {
MtabTestData(kDevice1, test_path_b.value(), kValidFS),
};
EXPECT_CALL(observer(), OnMediaDeviceAttached(_, _, _, _)).Times(0);
- EXPECT_CALL(observer(), OnMediaDeviceDetached(_)).Times(1);
+ EXPECT_CALL(observer(), OnMediaDeviceDetached(_, _)).Times(1);
OverwriteMtabAndRunLoop(test_data4, arraysize(test_data4));
// Detach |kDevice1| from |kMountPointB|.
// kDevice1 -> kMountPointA
// kDevice2 -> kMountPointB
EXPECT_CALL(observer(), OnMediaDeviceAttached(_, _, _, _)).Times(2);
- EXPECT_CALL(observer(), OnMediaDeviceDetached(_)).Times(1);
+ EXPECT_CALL(observer(), OnMediaDeviceDetached(_, _)).Times(1);
OverwriteMtabAndRunLoop(test_data1, arraysize(test_data1));
// Detach all devices.
EXPECT_CALL(observer(), OnMediaDeviceAttached(_, _, _, _)).Times(0);
- EXPECT_CALL(observer(), OnMediaDeviceDetached(_)).Times(2);
+ EXPECT_CALL(observer(), OnMediaDeviceDetached(_, _)).Times(2);
WriteEmptyMtabAndRunLoop();
}
@@ -377,7 +377,7 @@ TEST_F(MediaDeviceNotificationsLinuxTest, MultiDevicesOneMountPoint) {
base::SystemMonitor::TYPE_PATH,
test_path_b.value()))
.Times(1);
- EXPECT_CALL(observer(), OnMediaDeviceDetached(_)).Times(0);
+ EXPECT_CALL(observer(), OnMediaDeviceDetached(_, _)).Times(0);
OverwriteMtabAndRunLoop(test_data1, arraysize(test_data1));
// Attach |kDevice3| to |kMountPointB|.
@@ -391,7 +391,7 @@ TEST_F(MediaDeviceNotificationsLinuxTest, MultiDevicesOneMountPoint) {
MtabTestData test_data2[] = {
MtabTestData(kDevice3, test_path_b.value(), kValidFS),
};
- EXPECT_CALL(observer(), OnMediaDeviceDetached(kDeviceId0)).Times(1);
+ EXPECT_CALL(observer(), OnMediaDeviceDetached(kDeviceId0, _)).Times(1);
EXPECT_CALL(observer(),
OnMediaDeviceAttached(kDeviceId1,
ASCIIToUTF16(kDevice3),
@@ -402,7 +402,7 @@ TEST_F(MediaDeviceNotificationsLinuxTest, MultiDevicesOneMountPoint) {
// Detach all devices.
EXPECT_CALL(observer(), OnMediaDeviceAttached(_, _, _, _)).Times(0);
- EXPECT_CALL(observer(), OnMediaDeviceDetached(kDeviceId1)).Times(1);
+ EXPECT_CALL(observer(), OnMediaDeviceDetached(kDeviceId1, _)).Times(1);
WriteEmptyMtabAndRunLoop();
}

Powered by Google App Engine
This is Rietveld 408576698