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

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

Issue 148293003: Refactor to support default Bluetooth pairing delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wat Created 6 years, 10 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
« no previous file with comments | « device/bluetooth/bluetooth_device_chromeos.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_device_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698