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

Side by Side Diff: device/bluetooth/bluetooth_adapter_devices_chromeos_unittest.cc

Issue 13416005: Bluetooth: clean up BluetoothDevice (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More win visible fixes Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter_chromeos_unittest.cc ('k') | device/bluetooth/bluetooth_adapter_experimental_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698