| Index: chrome/browser/media_gallery/media_device_notification_window_win_unittest.cc
|
| diff --git a/content/browser/system_message_window_win_unittest.cc b/chrome/browser/media_gallery/media_device_notification_window_win_unittest.cc
|
| similarity index 78%
|
| copy from content/browser/system_message_window_win_unittest.cc
|
| copy to chrome/browser/media_gallery/media_device_notification_window_win_unittest.cc
|
| index 1db4c19f86863d80be8191a32440865adb021272..e6064b708057492e520f0d16a0e722d032aa3d0f 100644
|
| --- a/content/browser/system_message_window_win_unittest.cc
|
| +++ b/chrome/browser/media_gallery/media_device_notification_window_win_unittest.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "content/browser/system_message_window_win.h"
|
| +#include "chrome/browser/media_gallery/media_device_notification_window_win.h"
|
|
|
| #include <dbt.h>
|
| #include <string>
|
| @@ -29,10 +29,10 @@ LRESULT GetVolumeName(LPCWSTR drive,
|
|
|
| } // namespace
|
|
|
| -class SystemMessageWindowWinTest : public testing::Test {
|
| +class MediaDeviceNotificationWindowWinTest : public testing::Test {
|
| public:
|
| - SystemMessageWindowWinTest() : window_(&GetVolumeName) { }
|
| - virtual ~SystemMessageWindowWinTest() { }
|
| + MediaDeviceNotificationWindowWinTest() : window_(&GetVolumeName) { }
|
| + virtual ~MediaDeviceNotificationWindowWinTest() { }
|
|
|
| protected:
|
| virtual void SetUp() OVERRIDE {
|
| @@ -45,10 +45,10 @@ class SystemMessageWindowWinTest : public testing::Test {
|
| MessageLoop message_loop_;
|
| base::SystemMonitor system_monitor_;
|
| base::MockDevicesChangedObserver observer_;
|
| - SystemMessageWindowWin window_;
|
| + chrome::MediaDeviceNotificationWindowWin window_;
|
| };
|
|
|
| -void SystemMessageWindowWinTest::DoDevicesAttachedTest(
|
| +void MediaDeviceNotificationWindowWinTest::DoDevicesAttachedTest(
|
| const std::vector<int>& device_indices) {
|
| DEV_BROADCAST_VOLUME volume_broadcast;
|
| volume_broadcast.dbcv_size = sizeof(volume_broadcast);
|
| @@ -73,7 +73,7 @@ void SystemMessageWindowWinTest::DoDevicesAttachedTest(
|
| message_loop_.RunAllPending();
|
| };
|
|
|
| -void SystemMessageWindowWinTest::DoDevicesDetachedTest(
|
| +void MediaDeviceNotificationWindowWinTest::DoDevicesDetachedTest(
|
| const std::vector<int>& device_indices) {
|
| DEV_BROADCAST_VOLUME volume_broadcast;
|
| volume_broadcast.dbcv_size = sizeof(volume_broadcast);
|
| @@ -94,18 +94,12 @@ void SystemMessageWindowWinTest::DoDevicesDetachedTest(
|
| message_loop_.RunAllPending();
|
| };
|
|
|
| -TEST_F(SystemMessageWindowWinTest, DevicesChanged) {
|
| - EXPECT_CALL(observer_, OnDevicesChanged()).Times(1);
|
| - window_.OnDeviceChange(DBT_DEVNODES_CHANGED, NULL);
|
| - message_loop_.RunAllPending();
|
| -}
|
| -
|
| -TEST_F(SystemMessageWindowWinTest, RandomMessage) {
|
| +TEST_F(MediaDeviceNotificationWindowWinTest, RandomMessage) {
|
| window_.OnDeviceChange(DBT_DEVICEQUERYREMOVE, NULL);
|
| message_loop_.RunAllPending();
|
| }
|
|
|
| -TEST_F(SystemMessageWindowWinTest, DevicesAttached) {
|
| +TEST_F(MediaDeviceNotificationWindowWinTest, DevicesAttached) {
|
| std::vector<int> device_indices;
|
| device_indices.push_back(1);
|
| device_indices.push_back(5);
|
| @@ -114,21 +108,21 @@ TEST_F(SystemMessageWindowWinTest, DevicesAttached) {
|
| DoDevicesAttachedTest(device_indices);
|
| }
|
|
|
| -TEST_F(SystemMessageWindowWinTest, DevicesAttachedHighBoundary) {
|
| +TEST_F(MediaDeviceNotificationWindowWinTest, DevicesAttachedHighBoundary) {
|
| std::vector<int> device_indices;
|
| device_indices.push_back(25);
|
|
|
| DoDevicesAttachedTest(device_indices);
|
| }
|
|
|
| -TEST_F(SystemMessageWindowWinTest, DevicesAttachedLowBoundary) {
|
| +TEST_F(MediaDeviceNotificationWindowWinTest, DevicesAttachedLowBoundary) {
|
| std::vector<int> device_indices;
|
| device_indices.push_back(0);
|
|
|
| DoDevicesAttachedTest(device_indices);
|
| }
|
|
|
| -TEST_F(SystemMessageWindowWinTest, DevicesAttachedAdjacentBits) {
|
| +TEST_F(MediaDeviceNotificationWindowWinTest, DevicesAttachedAdjacentBits) {
|
| std::vector<int> device_indices;
|
| device_indices.push_back(0);
|
| device_indices.push_back(1);
|
| @@ -138,7 +132,7 @@ TEST_F(SystemMessageWindowWinTest, DevicesAttachedAdjacentBits) {
|
| DoDevicesAttachedTest(device_indices);
|
| }
|
|
|
| -TEST_F(SystemMessageWindowWinTest, DevicesDetached) {
|
| +TEST_F(MediaDeviceNotificationWindowWinTest, DevicesDetached) {
|
| std::vector<int> device_indices;
|
| device_indices.push_back(1);
|
| device_indices.push_back(5);
|
| @@ -147,21 +141,21 @@ TEST_F(SystemMessageWindowWinTest, DevicesDetached) {
|
| DoDevicesDetachedTest(device_indices);
|
| }
|
|
|
| -TEST_F(SystemMessageWindowWinTest, DevicesDetachedHighBoundary) {
|
| +TEST_F(MediaDeviceNotificationWindowWinTest, DevicesDetachedHighBoundary) {
|
| std::vector<int> device_indices;
|
| device_indices.push_back(25);
|
|
|
| DoDevicesDetachedTest(device_indices);
|
| }
|
|
|
| -TEST_F(SystemMessageWindowWinTest, DevicesDetachedLowBoundary) {
|
| +TEST_F(MediaDeviceNotificationWindowWinTest, DevicesDetachedLowBoundary) {
|
| std::vector<int> device_indices;
|
| device_indices.push_back(0);
|
|
|
| DoDevicesDetachedTest(device_indices);
|
| }
|
|
|
| -TEST_F(SystemMessageWindowWinTest, DevicesDetachedAdjacentBits) {
|
| +TEST_F(MediaDeviceNotificationWindowWinTest, DevicesDetachedAdjacentBits) {
|
| std::vector<int> device_indices;
|
| device_indices.push_back(0);
|
| device_indices.push_back(1);
|
|
|