| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" | 6 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" |
| 7 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" |
| 7 #include "chromeos/dbus/fake_bluetooth_device_client.h" | 8 #include "chromeos/dbus/fake_bluetooth_device_client.h" |
| 8 #include "chromeos/dbus/fake_bluetooth_input_client.h" | 9 #include "chromeos/dbus/fake_bluetooth_input_client.h" |
| 9 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h" | 10 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h" |
| 10 #include "chromeos/dbus/fake_bluetooth_profile_service_provider.h" | 11 #include "chromeos/dbus/fake_bluetooth_profile_service_provider.h" |
| 11 #include "chromeos/dbus/fake_dbus_thread_manager.h" | 12 #include "chromeos/dbus/fake_dbus_thread_manager.h" |
| 12 #include "device/bluetooth/bluetooth_adapter.h" | 13 #include "device/bluetooth/bluetooth_adapter.h" |
| 13 #include "device/bluetooth/bluetooth_adapter_chromeos.h" | 14 #include "device/bluetooth/bluetooth_adapter_chromeos.h" |
| 14 #include "device/bluetooth/bluetooth_adapter_factory.h" | 15 #include "device/bluetooth/bluetooth_adapter_factory.h" |
| 15 #include "device/bluetooth/bluetooth_device.h" | 16 #include "device/bluetooth/bluetooth_device.h" |
| 16 #include "device/bluetooth/bluetooth_device_chromeos.h" | 17 #include "device/bluetooth/bluetooth_device_chromeos.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 38 last_profile_(NULL), | 39 last_profile_(NULL), |
| 39 last_device_(NULL) {} | 40 last_device_(NULL) {} |
| 40 | 41 |
| 41 virtual void SetUp() { | 42 virtual void SetUp() { |
| 42 FakeDBusThreadManager* fake_dbus_thread_manager = new FakeDBusThreadManager; | 43 FakeDBusThreadManager* fake_dbus_thread_manager = new FakeDBusThreadManager; |
| 43 fake_bluetooth_profile_manager_client_ = | 44 fake_bluetooth_profile_manager_client_ = |
| 44 new FakeBluetoothProfileManagerClient; | 45 new FakeBluetoothProfileManagerClient; |
| 45 fake_dbus_thread_manager->SetBluetoothProfileManagerClient( | 46 fake_dbus_thread_manager->SetBluetoothProfileManagerClient( |
| 46 scoped_ptr<BluetoothProfileManagerClient>( | 47 scoped_ptr<BluetoothProfileManagerClient>( |
| 47 fake_bluetooth_profile_manager_client_)); | 48 fake_bluetooth_profile_manager_client_)); |
| 49 fake_dbus_thread_manager->SetBluetoothAgentManagerClient( |
| 50 scoped_ptr<BluetoothAgentManagerClient>( |
| 51 new FakeBluetoothAgentManagerClient)); |
| 48 fake_dbus_thread_manager->SetBluetoothAdapterClient( | 52 fake_dbus_thread_manager->SetBluetoothAdapterClient( |
| 49 scoped_ptr<BluetoothAdapterClient>(new FakeBluetoothAdapterClient)); | 53 scoped_ptr<BluetoothAdapterClient>(new FakeBluetoothAdapterClient)); |
| 50 fake_dbus_thread_manager->SetBluetoothDeviceClient( | 54 fake_dbus_thread_manager->SetBluetoothDeviceClient( |
| 51 scoped_ptr<BluetoothDeviceClient>(new FakeBluetoothDeviceClient)); | 55 scoped_ptr<BluetoothDeviceClient>(new FakeBluetoothDeviceClient)); |
| 52 fake_dbus_thread_manager->SetBluetoothInputClient( | 56 fake_dbus_thread_manager->SetBluetoothInputClient( |
| 53 scoped_ptr<BluetoothInputClient>(new FakeBluetoothInputClient)); | 57 scoped_ptr<BluetoothInputClient>(new FakeBluetoothInputClient)); |
| 54 DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager); | 58 DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager); |
| 55 | 59 |
| 56 device::BluetoothAdapterFactory::GetAdapter( | 60 device::BluetoothAdapterFactory::GetAdapter( |
| 57 base::Bind(&BluetoothProfileChromeOSTest::AdapterCallback, | 61 base::Bind(&BluetoothProfileChromeOSTest::AdapterCallback, |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 // Unregister the profile, make sure it's no longer registered. | 363 // Unregister the profile, make sure it's no longer registered. |
| 360 last_profile_->Unregister(); | 364 last_profile_->Unregister(); |
| 361 | 365 |
| 362 profile_service_provider = | 366 profile_service_provider = |
| 363 fake_bluetooth_profile_manager_client_->GetProfileServiceProvider( | 367 fake_bluetooth_profile_manager_client_->GetProfileServiceProvider( |
| 364 FakeBluetoothProfileManagerClient::kRfcommUuid); | 368 FakeBluetoothProfileManagerClient::kRfcommUuid); |
| 365 EXPECT_TRUE(profile_service_provider == NULL); | 369 EXPECT_TRUE(profile_service_provider == NULL); |
| 366 } | 370 } |
| 367 | 371 |
| 368 } // namespace chromeos | 372 } // namespace chromeos |
| OLD | NEW |