summaryrefslogtreecommitdiff
path: root/device
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2013-08-05 13:57:33 +0100
committerTorne (Richard Coles) <torne@google.com>2013-08-05 13:57:33 +0100
commita36e5920737c6adbddd3e43b760e5de8431db6e0 (patch)
tree347d048bb8c8828d50113bf94ace40bf0613f2cd /device
parent34378da0e9429d394aafdaa771301aff58447cb1 (diff)
downloadchromium_org-a36e5920737c6adbddd3e43b760e5de8431db6e0.tar.gz
Merge from Chromium at DEPS revision r215573
This commit was generated by merge_to_master.py. Change-Id: Ib95814f98e5765b459dd32425f9bf9138edf2bca
Diffstat (limited to 'device')
-rw-r--r--device/bluetooth/bluetooth_device.h10
-rw-r--r--device/bluetooth/bluetooth_device_win.cc3
-rw-r--r--device/bluetooth/bluetooth_device_win.h2
-rw-r--r--device/bluetooth/bluetooth_device_win_unittest.cc17
4 files changed, 25 insertions, 7 deletions
diff --git a/device/bluetooth/bluetooth_device.h b/device/bluetooth/bluetooth_device.h
index 831e5e577b..aaf4e93c7f 100644
--- a/device/bluetooth/bluetooth_device.h
+++ b/device/bluetooth/bluetooth_device.h
@@ -108,7 +108,7 @@ class BluetoothDevice {
//
// This is used for Bluetooth 2.0 and earlier keyboard devices, the
// |pincode| will always be a six-digit numeric in the range 000000-999999
- // for compatibilty with later specifications.
+ // for compatibility with later specifications.
virtual void DisplayPinCode(BluetoothDevice* device,
const std::string& pincode) = 0;
@@ -186,7 +186,7 @@ class BluetoothDevice {
virtual uint16 GetDeviceID() const = 0;
// Returns the name of the device suitable for displaying, this may
- // be a synthesied string containing the address and localized type name
+ // be a synthesized string containing the address and localized type name
// if the device has no obtained name.
virtual string16 GetName() const;
@@ -323,10 +323,10 @@ class BluetoothDevice {
// Disconnects the device, terminating the low-level ACL connection
// and any application connections using it, and then discards link keys
- // and other pairing information. The device object remainds valid until
- // returing from the calling function, after which it should be assumed to
+ // and other pairing information. The device object remains valid until
+ // returning from the calling function, after which it should be assumed to
// have been deleted. If the request fails, |error_callback| will be called.
- // There is no callback for success beause this object is often deleted
+ // There is no callback for success because this object is often deleted
// before that callback would be called.
virtual void Forget(const ErrorCallback& error_callback) = 0;
diff --git a/device/bluetooth/bluetooth_device_win.cc b/device/bluetooth/bluetooth_device_win.cc
index 34b7b406b6..bfd9bc6129 100644
--- a/device/bluetooth/bluetooth_device_win.cc
+++ b/device/bluetooth/bluetooth_device_win.cc
@@ -221,7 +221,8 @@ const BluetoothServiceRecord* BluetoothDeviceWin::GetServiceRecord(
for (ServiceRecordList::const_iterator iter = service_record_list_.begin();
iter != service_record_list_.end();
++iter) {
- return *iter;
+ if ((*iter)->uuid().compare(uuid) == 0)
+ return *iter;
}
return NULL;
}
diff --git a/device/bluetooth/bluetooth_device_win.h b/device/bluetooth/bluetooth_device_win.h
index 7e208ed825..452f6f2b86 100644
--- a/device/bluetooth/bluetooth_device_win.h
+++ b/device/bluetooth/bluetooth_device_win.h
@@ -94,7 +94,7 @@ class BluetoothDeviceWin : public BluetoothDevice {
// The Bluetooth address of the device.
std::string address_;
- // Tracked device state, updated by the adapter managing the lifecyle of
+ // Tracked device state, updated by the adapter managing the lifecycle of
// the device.
bool paired_;
bool connected_;
diff --git a/device/bluetooth/bluetooth_device_win_unittest.cc b/device/bluetooth/bluetooth_device_win_unittest.cc
index 93fd990e29..20be2ada18 100644
--- a/device/bluetooth/bluetooth_device_win_unittest.cc
+++ b/device/bluetooth/bluetooth_device_win_unittest.cc
@@ -101,6 +101,23 @@ TEST_F(BluetoothDeviceWinTest, GetServiceRecords) {
EXPECT_EQ(2, service_records_->size());
EXPECT_STREQ(kTestAudioSdpUuid, (*service_records_)[0]->uuid().c_str());
EXPECT_STREQ(kTestVideoSdpUuid, (*service_records_)[1]->uuid().c_str());
+
+ BluetoothDeviceWin* device_win =
+ reinterpret_cast<BluetoothDeviceWin*>(device_.get());
+
+ const BluetoothServiceRecord* audio_device =
+ device_win->GetServiceRecord(kTestAudioSdpUuid);
+ ASSERT_TRUE(audio_device != NULL);
+ EXPECT_EQ((*service_records_)[0], audio_device);
+
+ const BluetoothServiceRecord* video_device =
+ device_win->GetServiceRecord(kTestVideoSdpUuid);
+ ASSERT_TRUE(video_device != NULL);
+ EXPECT_EQ((*service_records_)[1], video_device);
+
+ const BluetoothServiceRecord* invalid_device =
+ device_win->GetServiceRecord(kTestVideoSdpAddress);
+ EXPECT_TRUE(invalid_device == NULL);
}
TEST_F(BluetoothDeviceWinTest, ProvidesServiceWithName) {