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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "device/bluetooth/bluetooth_device_win.h" | 10 #include "device/bluetooth/bluetooth_device_win.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 protected: | 79 protected: |
80 scoped_ptr<BluetoothDevice> device_; | 80 scoped_ptr<BluetoothDevice> device_; |
81 scoped_ptr<BluetoothDevice> empty_device_; | 81 scoped_ptr<BluetoothDevice> empty_device_; |
82 const BluetoothDevice::ServiceRecordList* service_records_; | 82 const BluetoothDevice::ServiceRecordList* service_records_; |
83 bool error_called_; | 83 bool error_called_; |
84 bool provides_service_with_name_; | 84 bool provides_service_with_name_; |
85 }; | 85 }; |
86 | 86 |
87 TEST_F(BluetoothDeviceWinTest, GetServices) { | 87 TEST_F(BluetoothDeviceWinTest, GetServices) { |
88 const BluetoothDevice::ServiceList& service_list = device_->GetServices(); | 88 BluetoothDevice::ServiceList service_list = device_->GetServices(); |
89 | 89 |
90 EXPECT_EQ(2, service_list.size()); | 90 EXPECT_EQ(2, service_list.size()); |
91 EXPECT_STREQ(kTestAudioSdpUuid, service_list[0].c_str()); | 91 EXPECT_STREQ(kTestAudioSdpUuid, service_list[0].c_str()); |
92 EXPECT_STREQ(kTestVideoSdpUuid, service_list[1].c_str()); | 92 EXPECT_STREQ(kTestVideoSdpUuid, service_list[1].c_str()); |
93 } | 93 } |
94 | 94 |
95 TEST_F(BluetoothDeviceWinTest, GetServiceRecords) { | 95 TEST_F(BluetoothDeviceWinTest, GetServiceRecords) { |
96 device_->GetServiceRecords( | 96 device_->GetServiceRecords( |
97 base::Bind(&BluetoothDeviceWinTest::GetServiceRecords, | 97 base::Bind(&BluetoothDeviceWinTest::GetServiceRecords, |
98 base::Unretained(this)), | 98 base::Unretained(this)), |
(...skipping 18 matching lines...) Expand all Loading... |
117 EXPECT_TRUE(provides_service_with_name_); | 117 EXPECT_TRUE(provides_service_with_name_); |
118 | 118 |
119 device_->ProvidesServiceWithName( | 119 device_->ProvidesServiceWithName( |
120 "name that does not exist", | 120 "name that does not exist", |
121 base::Bind(&BluetoothDeviceWinTest::SetProvidesServiceWithName, | 121 base::Bind(&BluetoothDeviceWinTest::SetProvidesServiceWithName, |
122 base::Unretained(this))); | 122 base::Unretained(this))); |
123 EXPECT_FALSE(provides_service_with_name_); | 123 EXPECT_FALSE(provides_service_with_name_); |
124 } | 124 } |
125 | 125 |
126 } // namespace device | 126 } // namespace device |
OLD | NEW |