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

Unified Diff: device/bluetooth/bluetooth_service_record_win_unittest.cc

Issue 395633003: Enumerate Bluetooth LE services and expose them to chrome.bluetooth API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix x64 build. Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth_service_record_win.cc ('k') | device/bluetooth/bluetooth_socket_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_service_record_win_unittest.cc
diff --git a/device/bluetooth/bluetooth_service_record_win_unittest.cc b/device/bluetooth/bluetooth_service_record_win_unittest.cc
index c9d44c6ba00fb2315e3e3aa0d11579fc7c5e34ae..8128cb407c74c031f2aa2bdff919793ddd654066 100644
--- a/device/bluetooth/bluetooth_service_record_win_unittest.cc
+++ b/device/bluetooth/bluetooth_service_record_win_unittest.cc
@@ -31,47 +31,38 @@ namespace device {
class BluetoothServiceRecordWinTest : public testing::Test {
protected:
- void ConvertSdpBytes(const char* sdp_hex_char, uint8* sdp_bytes_array) {
- std::vector<uint8> sdp_bytes_vector;
- base::HexStringToBytes(sdp_hex_char, &sdp_bytes_vector);
- std::copy(sdp_bytes_vector.begin(),
- sdp_bytes_vector.end(),
- sdp_bytes_array);
+ void ConvertSdpBytes(const char* sdp_hex_char,
+ std::vector<uint8>* sdp_bytes_vector) {
+ base::HexStringToBytes(sdp_hex_char, sdp_bytes_vector);
}
};
TEST_F(BluetoothServiceRecordWinTest, NoRfcommSdp) {
- uint8 sdp_bytes_array[kTestNoRfcommSdpBytesSize];
- ConvertSdpBytes(kTestNoRfcommSdpBytes, sdp_bytes_array);
- BluetoothServiceRecordWin service_record("NoRfcommSdp",
- "01:02:03:0A:10:A0",
- kTestNoRfcommSdpBytesSize,
- sdp_bytes_array);
+ std::vector<uint8> sdp_bytes_array;
+ ConvertSdpBytes(kTestNoRfcommSdpBytes, &sdp_bytes_array);
+ BluetoothServiceRecordWin service_record(
+ "01:02:03:0A:10:A0", "NoRfcommSdp", sdp_bytes_array, BluetoothUUID());
EXPECT_EQ(kTestNoRfcommSdpUuid, service_record.uuid());
EXPECT_FALSE(service_record.SupportsRfcomm());
}
TEST_F(BluetoothServiceRecordWinTest, RfcommSdp) {
- uint8 sdp_bytes_array[kTestRfcommSdpBytesSize];
- ConvertSdpBytes(kTestRfcommSdpBytes, sdp_bytes_array);
- BluetoothServiceRecordWin service_record("RfcommSdp",
- "01:02:03:0A:10:A0",
- kTestRfcommSdpBytesSize,
- sdp_bytes_array);
+ std::vector<uint8> sdp_bytes_array;
+ ConvertSdpBytes(kTestRfcommSdpBytes, &sdp_bytes_array);
+ BluetoothServiceRecordWin service_record(
+ "01:02:03:0A:10:A0", "RfcommSdp", sdp_bytes_array, BluetoothUUID());
EXPECT_EQ(kTestRfcommSdpUuid, service_record.uuid());
EXPECT_TRUE(service_record.SupportsRfcomm());
EXPECT_EQ(kTestRfcommChannel, service_record.rfcomm_channel());
}
TEST_F(BluetoothServiceRecordWinTest, BthAddr) {
- uint8 sdp_bytes_array[kTestRfcommSdpBytesSize];
- ConvertSdpBytes(kTestRfcommSdpBytes, sdp_bytes_array);
- BluetoothServiceRecordWin service_record("Sdp",
- "01:02:03:0A:10:A0",
- kTestRfcommSdpBytesSize,
- sdp_bytes_array);
- EXPECT_EQ(1108152553632, service_record.bth_addr());
+ std::vector<uint8> sdp_bytes_array;
+ ConvertSdpBytes(kTestRfcommSdpBytes, &sdp_bytes_array);
+ BluetoothServiceRecordWin service_record(
+ "01:02:03:0A:10:A0", "Sdp", sdp_bytes_array, BluetoothUUID());
+ EXPECT_EQ(1108152553632, service_record.device_bth_addr());
}
} // namespace device
« no previous file with comments | « device/bluetooth/bluetooth_service_record_win.cc ('k') | device/bluetooth/bluetooth_socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698