| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/memory/scoped_vector.h" | 5 #include "base/memory/scoped_vector.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "chromeos/dbus/dbus_thread_manager.h" | 8 #include "chromeos/dbus/dbus_thread_manager.h" |
| 9 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" | 9 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" |
| 10 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" | 10 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 } | 161 } |
| 162 | 162 |
| 163 void ConnectErrorCallback(BluetoothDevice::ConnectErrorCode error) { | 163 void ConnectErrorCallback(BluetoothDevice::ConnectErrorCode error) { |
| 164 ++error_callback_count_; | 164 ++error_callback_count_; |
| 165 } | 165 } |
| 166 | 166 |
| 167 protected: | 167 protected: |
| 168 void QuitMessageLoop() { | 168 void QuitMessageLoop() { |
| 169 if (base::MessageLoop::current() && | 169 if (base::MessageLoop::current() && |
| 170 base::MessageLoop::current()->is_running()) | 170 base::MessageLoop::current()->is_running()) |
| 171 base::MessageLoop::current()->Quit(); | 171 base::MessageLoop::current()->QuitWhenIdle(); |
| 172 } | 172 } |
| 173 | 173 |
| 174 base::MessageLoop message_loop_; | 174 base::MessageLoop message_loop_; |
| 175 | 175 |
| 176 FakeBluetoothDeviceClient* fake_bluetooth_device_client_; | 176 FakeBluetoothDeviceClient* fake_bluetooth_device_client_; |
| 177 FakeBluetoothGattServiceClient* fake_bluetooth_gatt_service_client_; | 177 FakeBluetoothGattServiceClient* fake_bluetooth_gatt_service_client_; |
| 178 FakeBluetoothGattCharacteristicClient* | 178 FakeBluetoothGattCharacteristicClient* |
| 179 fake_bluetooth_gatt_characteristic_client_; | 179 fake_bluetooth_gatt_characteristic_client_; |
| 180 FakeBluetoothGattDescriptorClient* fake_bluetooth_gatt_descriptor_client_; | 180 FakeBluetoothGattDescriptorClient* fake_bluetooth_gatt_descriptor_client_; |
| 181 scoped_ptr<device::BluetoothGattConnection> gatt_conn_; | 181 scoped_ptr<device::BluetoothGattConnection> gatt_conn_; |
| (...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 | 1225 |
| 1226 EXPECT_EQ(1, success_callback_count_); | 1226 EXPECT_EQ(1, success_callback_count_); |
| 1227 EXPECT_EQ(0, error_callback_count_); | 1227 EXPECT_EQ(0, error_callback_count_); |
| 1228 EXPECT_EQ(1, observer.gatt_characteristic_value_changed_count()); | 1228 EXPECT_EQ(1, observer.gatt_characteristic_value_changed_count()); |
| 1229 EXPECT_TRUE(characteristic->IsNotifying()); | 1229 EXPECT_TRUE(characteristic->IsNotifying()); |
| 1230 EXPECT_EQ(1U, update_sessions_.size()); | 1230 EXPECT_EQ(1U, update_sessions_.size()); |
| 1231 EXPECT_TRUE(update_sessions_[0]->IsActive()); | 1231 EXPECT_TRUE(update_sessions_[0]->IsActive()); |
| 1232 } | 1232 } |
| 1233 | 1233 |
| 1234 } // namespace chromeos | 1234 } // namespace chromeos |
| OLD | NEW |