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

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

Issue 10829384: SystemMonitor: Pull device type into the device id (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 4 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_window_win_unittest.cc
diff --git a/chrome/browser/media_gallery/media_device_notifications_window_win_unittest.cc b/chrome/browser/media_gallery/media_device_notifications_window_win_unittest.cc
index a0c66aa0b26a93f9cd18d4ab066cc8d0d2bd5322..cf98db2fa0099c8d8f113d4ff4796d869ea7766d 100644
--- a/chrome/browser/media_gallery/media_device_notifications_window_win_unittest.cc
+++ b/chrome/browser/media_gallery/media_device_notifications_window_win_unittest.cc
@@ -16,6 +16,7 @@
#include "base/string_number_conversions.h"
#include "base/system_monitor/system_monitor.h"
#include "base/test/mock_devices_changed_observer.h"
+#include "chrome/browser/media_gallery/media_storage_util.h"
#include "content/public/test/test_browser_thread.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -35,6 +36,8 @@ LRESULT GetVolumeName(LPCWSTR drive,
} // namespace
+namespace chrome {
+
using chrome::MediaDeviceNotificationsWindowWin;
using testing::_;
@@ -99,11 +102,9 @@ void MediaDeviceNotificationsWindowWinTest::DoDevicesAttachedTest(
std::wstring drive(L"_:\\");
drive[0] = 'A' + *it;
FilePath::StringType name = L"V" + drive;
- EXPECT_CALL(observer_,
- OnMediaDeviceAttached(base::IntToString(*it),
- name,
- base::SystemMonitor::TYPE_PATH,
- drive))
+ std::string device_id = MediaStorageUtil::MakeDeviceId(
+ MediaStorageUtil::USB_MASS_STORAGE_WITH_DCIM, base::IntToString(*it));
+ EXPECT_CALL(observer_, OnMediaDeviceAttached(device_id, name, drive))
.Times(0);
}
}
@@ -125,8 +126,9 @@ void MediaDeviceNotificationsWindowWinTest::DoDevicesDetachedTest(
it != device_indices.end();
++it) {
volume_broadcast.dbcv_unitmask |= 0x1 << *it;
- EXPECT_CALL(observer_, OnMediaDeviceDetached(base::IntToString(*it)))
- .Times(0);
+ std::string device_id = MediaStorageUtil::MakeDeviceId(
+ MediaStorageUtil::USB_MASS_STORAGE_WITH_DCIM, base::IntToString(*it));
+ EXPECT_CALL(observer_, OnMediaDeviceDetached(device_id)).Times(0);
}
}
window_->OnDeviceChange(DBT_DEVICEREMOVECOMPLETE,
@@ -204,3 +206,5 @@ TEST_F(MediaDeviceNotificationsWindowWinTest, DevicesDetachedAdjacentBits) {
DoDevicesDetachedTest(device_indices);
}
+
+} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698