| 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 "chromeos/dbus/mock_bluetooth_adapter_client.h" | 5 #include "chromeos/dbus/mock_bluetooth_adapter_client.h" |
| 6 #include "chromeos/dbus/mock_bluetooth_device_client.h" | 6 #include "chromeos/dbus/mock_bluetooth_device_client.h" |
| 7 #include "chromeos/dbus/mock_bluetooth_manager_client.h" | 7 #include "chromeos/dbus/mock_bluetooth_manager_client.h" |
| 8 #include "chromeos/dbus/mock_dbus_thread_manager.h" | 8 #include "chromeos/dbus/mock_dbus_thread_manager.h" |
| 9 #include "dbus/object_path.h" | 9 #include "dbus/object_path.h" |
| 10 #include "device/bluetooth/bluetooth_adapter.h" | 10 #include "device/bluetooth/bluetooth_adapter.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // the same device object as before. | 148 // the same device object as before. |
| 149 EXPECT_CALL(*mock_device_client_, GetProperties(device_path)) | 149 EXPECT_CALL(*mock_device_client_, GetProperties(device_path)) |
| 150 .WillRepeatedly(Return(&device_properties)); | 150 .WillRepeatedly(Return(&device_properties)); |
| 151 | 151 |
| 152 EXPECT_CALL(adapter_observer_, DeviceChanged(adapter_chromeos, device)) | 152 EXPECT_CALL(adapter_observer_, DeviceChanged(adapter_chromeos, device)) |
| 153 .Times(1); | 153 .Times(1); |
| 154 | 154 |
| 155 static_cast<BluetoothAdapterClient::Observer*>(adapter_chromeos) | 155 static_cast<BluetoothAdapterClient::Observer*>(adapter_chromeos) |
| 156 ->DeviceCreated(adapter_path_, device_path); | 156 ->DeviceCreated(adapter_path_, device_path); |
| 157 | 157 |
| 158 // Finally remove the adapter again; | 158 // Finally remove the device again; |
| 159 // BluetoothAdapterClient::Observer::DeviceRemoved should be not called, | 159 // BluetoothAdapterClient::Observer::DeviceRemoved should be not called, |
| 160 // instead BluetoothAdapterClient::Observer::DeviceChanged will be called. | 160 // instead BluetoothAdapterClient::Observer::DeviceChanged will be called. |
| 161 EXPECT_CALL(adapter_observer_, DeviceRemoved(adapter_.get(), device)) | 161 EXPECT_CALL(adapter_observer_, DeviceRemoved(adapter_.get(), device)) |
| 162 .Times(0); | 162 .Times(0); |
| 163 EXPECT_CALL(adapter_observer_, DeviceChanged(adapter_.get(), device)) | 163 EXPECT_CALL(adapter_observer_, DeviceChanged(adapter_.get(), device)) |
| 164 .Times(1); | 164 .Times(1); |
| 165 | 165 |
| 166 static_cast<BluetoothAdapterClient::Observer*>(adapter_chromeos) | 166 static_cast<BluetoothAdapterClient::Observer*>(adapter_chromeos) |
| 167 ->DeviceRemoved(adapter_path_, device_path); | 167 ->DeviceRemoved(adapter_path_, device_path); |
| 168 | 168 |
| 169 // Verify that the device is still visible, just no longer paired. | 169 // Verify that the device is still visible, just no longer paired. |
| 170 EXPECT_TRUE(device->IsVisible()); | |
| 171 EXPECT_FALSE(device->IsPaired()); | 170 EXPECT_FALSE(device->IsPaired()); |
| 172 } | 171 } |
| 173 | 172 |
| 174 } // namespace chromeos | 173 } // namespace chromeos |
| OLD | NEW |