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

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

Issue 220323004: device/bluetooth: Rename device::bluetooth_utils::UUID to device::BluetoothUUID (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initialized |empty_device_| in BluetoothDeviceWinTest. Created 6 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) 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_agent_manager_client.h"
8 #include "chromeos/dbus/fake_bluetooth_device_client.h" 8 #include "chromeos/dbus/fake_bluetooth_device_client.h"
9 #include "chromeos/dbus/fake_bluetooth_input_client.h" 9 #include "chromeos/dbus/fake_bluetooth_input_client.h"
10 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h" 10 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h"
11 #include "chromeos/dbus/fake_bluetooth_profile_service_provider.h" 11 #include "chromeos/dbus/fake_bluetooth_profile_service_provider.h"
12 #include "chromeos/dbus/fake_dbus_thread_manager.h" 12 #include "chromeos/dbus/fake_dbus_thread_manager.h"
13 #include "device/bluetooth/bluetooth_adapter.h" 13 #include "device/bluetooth/bluetooth_adapter.h"
14 #include "device/bluetooth/bluetooth_adapter_chromeos.h" 14 #include "device/bluetooth/bluetooth_adapter_chromeos.h"
15 #include "device/bluetooth/bluetooth_adapter_factory.h" 15 #include "device/bluetooth/bluetooth_adapter_factory.h"
16 #include "device/bluetooth/bluetooth_device.h" 16 #include "device/bluetooth/bluetooth_device.h"
17 #include "device/bluetooth/bluetooth_device_chromeos.h" 17 #include "device/bluetooth/bluetooth_device_chromeos.h"
18 #include "device/bluetooth/bluetooth_profile.h" 18 #include "device/bluetooth/bluetooth_profile.h"
19 #include "device/bluetooth/bluetooth_profile_chromeos.h" 19 #include "device/bluetooth/bluetooth_profile_chromeos.h"
20 #include "device/bluetooth/bluetooth_socket.h" 20 #include "device/bluetooth/bluetooth_socket.h"
21 #include "device/bluetooth/bluetooth_socket_chromeos.h" 21 #include "device/bluetooth/bluetooth_socket_chromeos.h"
22 #include "device/bluetooth/bluetooth_uuid.h"
22 #include "net/base/io_buffer.h" 23 #include "net/base/io_buffer.h"
23 #include "testing/gtest/include/gtest/gtest.h" 24 #include "testing/gtest/include/gtest/gtest.h"
24 25
25 using device::BluetoothAdapter; 26 using device::BluetoothAdapter;
26 using device::BluetoothDevice; 27 using device::BluetoothDevice;
27 using device::BluetoothProfile; 28 using device::BluetoothProfile;
28 using device::BluetoothSocket; 29 using device::BluetoothSocket;
30 using device::BluetoothUUID;
29 31
30 namespace chromeos { 32 namespace chromeos {
31 33
32 class BluetoothProfileChromeOSTest : public testing::Test { 34 class BluetoothProfileChromeOSTest : public testing::Test {
33 public: 35 public:
34 BluetoothProfileChromeOSTest() 36 BluetoothProfileChromeOSTest()
35 : callback_count_(0), 37 : callback_count_(0),
36 error_callback_count_(0), 38 error_callback_count_(0),
37 profile_callback_count_(0), 39 profile_callback_count_(0),
38 connection_callback_count_(0), 40 connection_callback_count_(0),
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 BluetoothProfile* last_profile_; 119 BluetoothProfile* last_profile_;
118 const BluetoothDevice* last_device_; 120 const BluetoothDevice* last_device_;
119 scoped_refptr<BluetoothSocket> last_socket_; 121 scoped_refptr<BluetoothSocket> last_socket_;
120 }; 122 };
121 123
122 TEST_F(BluetoothProfileChromeOSTest, L2capEndToEnd) { 124 TEST_F(BluetoothProfileChromeOSTest, L2capEndToEnd) {
123 // Register the profile and expect the profile object to be passed to the 125 // Register the profile and expect the profile object to be passed to the
124 // callback. 126 // callback.
125 BluetoothProfile::Options options; 127 BluetoothProfile::Options options;
126 BluetoothProfile::Register( 128 BluetoothProfile::Register(
127 FakeBluetoothProfileManagerClient::kL2capUuid, 129 BluetoothUUID(FakeBluetoothProfileManagerClient::kL2capUuid),
128 options, 130 options,
129 base::Bind(&BluetoothProfileChromeOSTest::ProfileCallback, 131 base::Bind(&BluetoothProfileChromeOSTest::ProfileCallback,
130 base::Unretained(this))); 132 base::Unretained(this)));
131 133
132 EXPECT_EQ(1U, profile_callback_count_); 134 EXPECT_EQ(1U, profile_callback_count_);
133 EXPECT_TRUE(last_profile_ != NULL); 135 EXPECT_TRUE(last_profile_ != NULL);
134 BluetoothProfile* profile = last_profile_; 136 BluetoothProfile* profile = last_profile_;
135 137
136 // Make sure we have a profile service provider for it. 138 // Make sure we have a profile service provider for it.
137 FakeBluetoothProfileServiceProvider* profile_service_provider = 139 FakeBluetoothProfileServiceProvider* profile_service_provider =
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 fake_bluetooth_profile_manager_client_->GetProfileServiceProvider( 245 fake_bluetooth_profile_manager_client_->GetProfileServiceProvider(
244 FakeBluetoothProfileManagerClient::kL2capUuid); 246 FakeBluetoothProfileManagerClient::kL2capUuid);
245 EXPECT_TRUE(profile_service_provider == NULL); 247 EXPECT_TRUE(profile_service_provider == NULL);
246 } 248 }
247 249
248 TEST_F(BluetoothProfileChromeOSTest, RfcommEndToEnd) { 250 TEST_F(BluetoothProfileChromeOSTest, RfcommEndToEnd) {
249 // Register the profile and expect the profile object to be passed to the 251 // Register the profile and expect the profile object to be passed to the
250 // callback. 252 // callback.
251 BluetoothProfile::Options options; 253 BluetoothProfile::Options options;
252 BluetoothProfile::Register( 254 BluetoothProfile::Register(
253 FakeBluetoothProfileManagerClient::kRfcommUuid, 255 BluetoothUUID(FakeBluetoothProfileManagerClient::kRfcommUuid),
254 options, 256 options,
255 base::Bind(&BluetoothProfileChromeOSTest::ProfileCallback, 257 base::Bind(&BluetoothProfileChromeOSTest::ProfileCallback,
256 base::Unretained(this))); 258 base::Unretained(this)));
257 259
258 EXPECT_EQ(1U, profile_callback_count_); 260 EXPECT_EQ(1U, profile_callback_count_);
259 EXPECT_TRUE(last_profile_ != NULL); 261 EXPECT_TRUE(last_profile_ != NULL);
260 BluetoothProfile* profile = last_profile_; 262 BluetoothProfile* profile = last_profile_;
261 263
262 // Make sure we have a profile service provider for it. 264 // Make sure we have a profile service provider for it.
263 FakeBluetoothProfileServiceProvider* profile_service_provider = 265 FakeBluetoothProfileServiceProvider* profile_service_provider =
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 // Unregister the profile, make sure it's no longer registered. 365 // Unregister the profile, make sure it's no longer registered.
364 last_profile_->Unregister(); 366 last_profile_->Unregister();
365 367
366 profile_service_provider = 368 profile_service_provider =
367 fake_bluetooth_profile_manager_client_->GetProfileServiceProvider( 369 fake_bluetooth_profile_manager_client_->GetProfileServiceProvider(
368 FakeBluetoothProfileManagerClient::kRfcommUuid); 370 FakeBluetoothProfileManagerClient::kRfcommUuid);
369 EXPECT_TRUE(profile_service_provider == NULL); 371 EXPECT_TRUE(profile_service_provider == NULL);
370 } 372 }
371 373
372 } // namespace chromeos 374 } // namespace chromeos
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_profile_chromeos.cc ('k') | device/bluetooth/bluetooth_profile_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698