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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 .InSequence(mock_sequencer[index]); | 124 .InSequence(mock_sequencer[index]); |
125 EXPECT_CALL(observers[index], | 125 EXPECT_CALL(observers[index], |
126 OnMediaDeviceAttached(kDeviceId1, | 126 OnMediaDeviceAttached(kDeviceId1, |
127 kDeviceName, | 127 kDeviceName, |
128 base::SystemMonitor::TYPE_PATH, | 128 base::SystemMonitor::TYPE_PATH, |
129 testing::_)) | 129 testing::_)) |
130 .InSequence(mock_sequencer[index]); | 130 .InSequence(mock_sequencer[index]); |
131 EXPECT_CALL(observers[index], OnMediaDeviceDetached(kDeviceId1)) | 131 EXPECT_CALL(observers[index], OnMediaDeviceDetached(kDeviceId1)) |
132 .InSequence(mock_sequencer[index]); | 132 .InSequence(mock_sequencer[index]); |
133 EXPECT_CALL(observers[index], OnMediaDeviceDetached(kDeviceId2)) | 133 EXPECT_CALL(observers[index], OnMediaDeviceDetached(kDeviceId2)) |
134 .InSequence(mock_sequencer[index]); | 134 .Times(0).InSequence(mock_sequencer[index]); |
135 } | 135 } |
136 | 136 |
137 system_monitor_->ProcessDevicesChanged(base::SystemMonitor::DEVTYPE_UNKNOWN); | 137 system_monitor_->ProcessDevicesChanged(base::SystemMonitor::DEVTYPE_UNKNOWN); |
138 message_loop_.RunAllPending(); | 138 message_loop_.RunAllPending(); |
139 | 139 |
140 system_monitor_->ProcessDevicesChanged(base::SystemMonitor::DEVTYPE_UNKNOWN); | 140 system_monitor_->ProcessDevicesChanged(base::SystemMonitor::DEVTYPE_UNKNOWN); |
141 system_monitor_->ProcessDevicesChanged(base::SystemMonitor::DEVTYPE_UNKNOWN); | 141 system_monitor_->ProcessDevicesChanged(base::SystemMonitor::DEVTYPE_UNKNOWN); |
142 message_loop_.RunAllPending(); | 142 message_loop_.RunAllPending(); |
143 | 143 |
144 system_monitor_->ProcessMediaDeviceAttached( | 144 system_monitor_->ProcessMediaDeviceAttached( |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 206 |
207 system_monitor_->ProcessMediaDeviceDetached(kDeviceId2); | 207 system_monitor_->ProcessMediaDeviceDetached(kDeviceId2); |
208 message_loop_.RunAllPending(); | 208 message_loop_.RunAllPending(); |
209 devices = system_monitor_->GetAttachedMediaDevices(); | 209 devices = system_monitor_->GetAttachedMediaDevices(); |
210 EXPECT_EQ(0U, devices.size()); | 210 EXPECT_EQ(0U, devices.size()); |
211 } | 211 } |
212 | 212 |
213 } // namespace | 213 } // namespace |
214 | 214 |
215 } // namespace base | 215 } // namespace base |
OLD | NEW |