| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/system_monitor/system_monitor.h" | 5 #include "base/system_monitor/system_monitor.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/test/mock_devices_changed_observer.h" | 9 #include "base/test/mock_devices_changed_observer.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 EXPECT_CALL(observers[index], OnDevicesChanged()) | 121 EXPECT_CALL(observers[index], OnDevicesChanged()) |
| 122 .Times(3) | 122 .Times(3) |
| 123 .InSequence(mock_sequencer[index]); | 123 .InSequence(mock_sequencer[index]); |
| 124 EXPECT_CALL(observers[index], | 124 EXPECT_CALL(observers[index], |
| 125 OnMediaDeviceAttached(kDeviceId1, | 125 OnMediaDeviceAttached(kDeviceId1, |
| 126 kDeviceName, | 126 kDeviceName, |
| 127 base::SystemMonitor::TYPE_PATH, | 127 base::SystemMonitor::TYPE_PATH, |
| 128 testing::_)) | 128 testing::_)) |
| 129 .InSequence(mock_sequencer[index]); | 129 .InSequence(mock_sequencer[index]); |
| 130 EXPECT_CALL(observers[index], OnMediaDeviceDetached(kDeviceId1)) | 130 EXPECT_CALL(observers[index], OnMediaDeviceDetached( |
| 131 .InSequence(mock_sequencer[index]); | 131 kDeviceId1, testing::_)).InSequence(mock_sequencer[index]); |
| 132 EXPECT_CALL(observers[index], OnMediaDeviceDetached(kDeviceId2)) | 132 EXPECT_CALL(observers[index], OnMediaDeviceDetached( |
| 133 .InSequence(mock_sequencer[index]); | 133 kDeviceId2, testing::_)).InSequence(mock_sequencer[index]); |
| 134 } | 134 } |
| 135 | 135 |
| 136 system_monitor_->ProcessDevicesChanged(); | 136 system_monitor_->ProcessDevicesChanged(); |
| 137 message_loop_.RunAllPending(); | 137 message_loop_.RunAllPending(); |
| 138 | 138 |
| 139 system_monitor_->ProcessDevicesChanged(); | 139 system_monitor_->ProcessDevicesChanged(); |
| 140 system_monitor_->ProcessDevicesChanged(); | 140 system_monitor_->ProcessDevicesChanged(); |
| 141 message_loop_.RunAllPending(); | 141 message_loop_.RunAllPending(); |
| 142 | 142 |
| 143 system_monitor_->ProcessMediaDeviceAttached( | 143 system_monitor_->ProcessMediaDeviceAttached( |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 205 |
| 206 system_monitor_->ProcessMediaDeviceDetached(kDeviceId2); | 206 system_monitor_->ProcessMediaDeviceDetached(kDeviceId2); |
| 207 message_loop_.RunAllPending(); | 207 message_loop_.RunAllPending(); |
| 208 devices = system_monitor_->GetAttachedMediaDevices(); | 208 devices = system_monitor_->GetAttachedMediaDevices(); |
| 209 EXPECT_EQ(0U, devices.size()); | 209 EXPECT_EQ(0U, devices.size()); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace | 212 } // namespace |
| 213 | 213 |
| 214 } // namespace base | 214 } // namespace base |
| OLD | NEW |