| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "chromeos/dbus/bluetooth_profile_service_provider.h" | 7 #include "chromeos/dbus/bluetooth_profile_service_provider.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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 DBusThreadManager::Shutdown(); | 67 DBusThreadManager::Shutdown(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void AdapterCallback(scoped_refptr<BluetoothAdapter> adapter) { | 70 void AdapterCallback(scoped_refptr<BluetoothAdapter> adapter) { |
| 71 adapter_ = adapter; | 71 adapter_ = adapter; |
| 72 } | 72 } |
| 73 | 73 |
| 74 class FakeDelegate | 74 class FakeDelegate |
| 75 : public chromeos::BluetoothProfileServiceProvider::Delegate { | 75 : public chromeos::BluetoothProfileServiceProvider::Delegate { |
| 76 public: | 76 public: |
| 77 FakeDelegate(std::string device_path) : connections_(0) { | 77 FakeDelegate(const std::string& device_path) : connections_(0) { |
| 78 device_path_ = dbus::ObjectPath(device_path); | 78 device_path_ = dbus::ObjectPath(device_path); |
| 79 } | 79 } |
| 80 | 80 |
| 81 // BluetoothProfileServiceProvider::Delegate: | 81 // BluetoothProfileServiceProvider::Delegate: |
| 82 void Released() override { | 82 void Released() override { |
| 83 // noop | 83 // noop |
| 84 } | 84 } |
| 85 | 85 |
| 86 void NewConnection( | 86 void NewConnection( |
| 87 const dbus::ObjectPath& device_path, | 87 const dbus::ObjectPath& device_path, |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 base::Unretained(this))); | 374 base::Unretained(this))); |
| 375 | 375 |
| 376 message_loop_.RunUntilIdle(); | 376 message_loop_.RunUntilIdle(); |
| 377 | 377 |
| 378 EXPECT_FALSE(profile_user_ptr_); | 378 EXPECT_FALSE(profile_user_ptr_); |
| 379 EXPECT_EQ(0U, success_callback_count_); | 379 EXPECT_EQ(0U, success_callback_count_); |
| 380 EXPECT_EQ(2U, error_callback_count_); | 380 EXPECT_EQ(2U, error_callback_count_); |
| 381 } | 381 } |
| 382 | 382 |
| 383 } // namespace chromeos | 383 } // namespace chromeos |
| OLD | NEW |