Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "device/bluetooth/bluetooth_gatt_characteristic.h" | 5 #include "device/bluetooth/bluetooth_gatt_characteristic.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 uint16_t expected_config_descriptor_value, | 65 uint16_t expected_config_descriptor_value, |
| 66 StartNotifySetupError error = StartNotifySetupError::NONE) { | 66 StartNotifySetupError error = StartNotifySetupError::NONE) { |
| 67 if (error == StartNotifySetupError::CHARACTERISTIC_PROPERTIES) { | 67 if (error == StartNotifySetupError::CHARACTERISTIC_PROPERTIES) { |
| 68 properties = 0; | 68 properties = 0; |
| 69 } | 69 } |
| 70 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate(properties)); | 70 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate(properties)); |
| 71 | 71 |
| 72 if (error != StartNotifySetupError::CONFIG_DESCRIPTOR_MISSING) { | 72 if (error != StartNotifySetupError::CONFIG_DESCRIPTOR_MISSING) { |
| 73 SimulateGattDescriptor( | 73 SimulateGattDescriptor( |
| 74 characteristic1_, | 74 characteristic1_, |
| 75 /* Client Characteristic Configuration descriptor's standard UUID: */ | 75 BluetoothGattDescriptor::ClientCharacteristicConfigurationUuid() |
| 76 "00002902-0000-1000-8000-00805F9B34FB"); | 76 .canonical_value()); |
| 77 ASSERT_EQ(1u, characteristic1_->GetDescriptors().size()); | 77 ASSERT_EQ(1u, characteristic1_->GetDescriptors().size()); |
| 78 } | 78 } |
| 79 | 79 |
| 80 if (error == StartNotifySetupError::SET_NOTIFY) { | 80 if (error == StartNotifySetupError::SET_NOTIFY) { |
| 81 SimulateGattCharacteristicSetNotifyWillFailSynchronouslyOnce( | 81 SimulateGattCharacteristicSetNotifyWillFailSynchronouslyOnce( |
| 82 characteristic1_); | 82 characteristic1_); |
| 83 } | 83 } |
| 84 | 84 |
| 85 if (error == StartNotifySetupError::WRITE_DESCRIPTOR) { | 85 if (error == StartNotifySetupError::WRITE_DESCRIPTOR) { |
| 86 SimulateGattDescriptorWriteWillFailSynchronouslyOnce( | 86 SimulateGattDescriptorWriteWillFailSynchronouslyOnce( |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 291 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| 292 BluetoothGattCharacteristic::PROPERTY_WRITE)); | 292 BluetoothGattCharacteristic::PROPERTY_WRITE)); |
| 293 | 293 |
| 294 std::vector<uint8_t> empty_vector; | 294 std::vector<uint8_t> empty_vector; |
| 295 characteristic1_->WriteRemoteCharacteristic( | 295 characteristic1_->WriteRemoteCharacteristic( |
| 296 empty_vector, GetCallback(Call::EXPECTED), | 296 empty_vector, GetCallback(Call::EXPECTED), |
| 297 GetGattErrorCallback(Call::NOT_EXPECTED)); | 297 GetGattErrorCallback(Call::NOT_EXPECTED)); |
| 298 EXPECT_EQ(1, gatt_write_characteristic_attempts_); | 298 EXPECT_EQ(1, gatt_write_characteristic_attempts_); |
| 299 SimulateGattCharacteristicWrite(characteristic1_); | 299 SimulateGattCharacteristicWrite(characteristic1_); |
| 300 | 300 |
| 301 // Duplicate write reported from OS shouldn't cause a problem: | |
| 302 SimulateGattCharacteristicWrite(characteristic1_); | |
| 303 | |
| 301 EXPECT_EQ(empty_vector, last_write_value_); | 304 EXPECT_EQ(empty_vector, last_write_value_); |
| 302 } | 305 } |
| 303 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 306 #endif // defined(OS_ANDROID) || defined(OS_WIN) |
| 304 | 307 |
| 305 #if defined(OS_ANDROID) || defined(OS_WIN) | 308 #if defined(OS_ANDROID) || defined(OS_WIN) |
| 306 // Tests ReadRemoteCharacteristic completing after Chrome objects are deleted. | 309 // Tests ReadRemoteCharacteristic completing after Chrome objects are deleted. |
| 307 TEST_F(BluetoothGattCharacteristicTest, ReadRemoteCharacteristic_AfterDeleted) { | 310 TEST_F(BluetoothGattCharacteristicTest, ReadRemoteCharacteristic_AfterDeleted) { |
| 308 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 311 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| 309 BluetoothGattCharacteristic::PROPERTY_READ)); | 312 BluetoothGattCharacteristic::PROPERTY_READ)); |
| 310 | 313 |
| 311 characteristic1_->ReadRemoteCharacteristic( | 314 characteristic1_->ReadRemoteCharacteristic( |
| 312 GetReadValueCallback(Call::NOT_EXPECTED), | 315 GetReadValueCallback(Call::NOT_EXPECTED), |
| 313 GetGattErrorCallback(Call::NOT_EXPECTED)); | 316 GetGattErrorCallback(Call::NOT_EXPECTED)); |
| 314 | 317 |
| 315 RememberCharacteristicForSubsequentAction(characteristic1_); | 318 RememberCharacteristicForSubsequentAction(characteristic1_); |
| 316 DeleteDevice(device_); | 319 DeleteDevice(device_); // TODO(576906) delete only the characteristic. |
|
ortuno
2016/03/13 22:45:03
nit: This should follow the same pattern as other
scheib
2016/03/14 20:00:16
Done, by fixing the other TODOs to the shorter for
| |
| 317 | 320 |
| 318 std::vector<uint8_t> empty_vector; | 321 std::vector<uint8_t> empty_vector; |
| 319 SimulateGattCharacteristicRead(/* use remembered characteristic */ nullptr, | 322 SimulateGattCharacteristicRead(/* use remembered characteristic */ nullptr, |
| 320 empty_vector); | 323 empty_vector); |
| 321 EXPECT_TRUE("Did not crash!"); | 324 EXPECT_TRUE("Did not crash!"); |
| 322 } | 325 } |
| 323 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 326 #endif // defined(OS_ANDROID) || defined(OS_WIN) |
| 324 | 327 |
| 325 #if defined(OS_ANDROID) || defined(OS_WIN) | 328 #if defined(OS_ANDROID) || defined(OS_WIN) |
| 326 // Tests WriteRemoteCharacteristic completing after Chrome objects are deleted. | 329 // Tests WriteRemoteCharacteristic completing after Chrome objects are deleted. |
| 327 TEST_F(BluetoothGattCharacteristicTest, | 330 TEST_F(BluetoothGattCharacteristicTest, |
| 328 WriteRemoteCharacteristic_AfterDeleted) { | 331 WriteRemoteCharacteristic_AfterDeleted) { |
| 329 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 332 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| 330 BluetoothGattCharacteristic::PROPERTY_WRITE)); | 333 BluetoothGattCharacteristic::PROPERTY_WRITE)); |
| 331 | 334 |
| 332 std::vector<uint8_t> empty_vector; | 335 std::vector<uint8_t> empty_vector; |
| 333 characteristic1_->WriteRemoteCharacteristic( | 336 characteristic1_->WriteRemoteCharacteristic( |
| 334 empty_vector, GetCallback(Call::NOT_EXPECTED), | 337 empty_vector, GetCallback(Call::NOT_EXPECTED), |
| 335 GetGattErrorCallback(Call::NOT_EXPECTED)); | 338 GetGattErrorCallback(Call::NOT_EXPECTED)); |
| 336 | 339 |
| 337 RememberCharacteristicForSubsequentAction(characteristic1_); | 340 RememberCharacteristicForSubsequentAction(characteristic1_); |
| 338 DeleteDevice(device_); | 341 DeleteDevice(device_); // TODO(576906) delete only the characteristic. |
|
ortuno
2016/03/13 22:45:03
Same here. TODO should follow same pattern as othe
scheib
2016/03/14 20:00:16
Done.
| |
| 339 | 342 |
| 340 SimulateGattCharacteristicWrite(/* use remembered characteristic */ nullptr); | 343 SimulateGattCharacteristicWrite(/* use remembered characteristic */ nullptr); |
| 341 EXPECT_TRUE("Did not crash!"); | 344 EXPECT_TRUE("Did not crash!"); |
| 342 } | 345 } |
| 343 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 346 #endif // defined(OS_ANDROID) || defined(OS_WIN) |
| 344 | 347 |
| 345 #if defined(OS_ANDROID) || defined(OS_WIN) | 348 #if defined(OS_ANDROID) || defined(OS_WIN) |
| 346 // Tests ReadRemoteCharacteristic and GetValue with non-empty value buffer. | 349 // Tests ReadRemoteCharacteristic and GetValue with non-empty value buffer. |
| 347 TEST_F(BluetoothGattCharacteristicTest, ReadRemoteCharacteristic) { | 350 TEST_F(BluetoothGattCharacteristicTest, ReadRemoteCharacteristic) { |
| 348 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 351 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 842 // Indicate. | 845 // Indicate. |
| 843 TEST_F(BluetoothGattCharacteristicTest, | 846 TEST_F(BluetoothGattCharacteristicTest, |
| 844 StartNotifySession_OnNotifyAndIndicate) { | 847 StartNotifySession_OnNotifyAndIndicate) { |
| 845 ASSERT_NO_FATAL_FAILURE(StartNotifyBoilerplate( | 848 ASSERT_NO_FATAL_FAILURE(StartNotifyBoilerplate( |
| 846 /* properties: NOTIFY and INDICATE bits set */ 0x30, | 849 /* properties: NOTIFY and INDICATE bits set */ 0x30, |
| 847 /* expected_config_descriptor_value: NOTIFY */ 1)); | 850 /* expected_config_descriptor_value: NOTIFY */ 1)); |
| 848 } | 851 } |
| 849 #endif // defined(OS_ANDROID) | 852 #endif // defined(OS_ANDROID) |
| 850 | 853 |
| 851 #if defined(OS_ANDROID) | 854 #if defined(OS_ANDROID) |
| 855 // Tests multiple StartNotifySession success. | |
| 856 TEST_F(BluetoothGattCharacteristicTest, StartNotifySession_Multiple) { | |
| 857 ASSERT_NO_FATAL_FAILURE( | |
| 858 FakeCharacteristicBoilerplate(/* properties: NOTIFY */ 0x10)); | |
| 859 SimulateGattDescriptor( | |
| 860 characteristic1_, | |
| 861 BluetoothGattDescriptor::ClientCharacteristicConfigurationUuid() | |
| 862 .canonical_value()); | |
| 863 ASSERT_EQ(1u, characteristic1_->GetDescriptors().size()); | |
| 864 | |
| 865 characteristic1_->StartNotifySession( | |
| 866 GetNotifyCallback(Call::EXPECTED), | |
| 867 GetGattErrorCallback(Call::NOT_EXPECTED)); | |
| 868 characteristic1_->StartNotifySession( | |
| 869 GetNotifyCallback(Call::EXPECTED), | |
| 870 GetGattErrorCallback(Call::NOT_EXPECTED)); | |
| 871 EXPECT_EQ(1, gatt_notify_characteristic_attempts_); | |
| 872 EXPECT_EQ(0, callback_count_); | |
| 873 SimulateGattNotifySessionStarted(characteristic1_); | |
| 874 EXPECT_EQ(2, callback_count_); | |
| 875 EXPECT_EQ(0, error_callback_count_); | |
| 876 ASSERT_EQ(2u, notify_sessions_.size()); | |
| 877 ASSERT_TRUE(notify_sessions_[0]); | |
| 878 ASSERT_TRUE(notify_sessions_[1]); | |
| 879 EXPECT_EQ(characteristic1_->GetIdentifier(), | |
| 880 notify_sessions_[0]->GetCharacteristicIdentifier()); | |
| 881 EXPECT_EQ(characteristic1_->GetIdentifier(), | |
| 882 notify_sessions_[1]->GetCharacteristicIdentifier()); | |
| 883 EXPECT_TRUE(notify_sessions_[0]->IsActive()); | |
| 884 EXPECT_TRUE(notify_sessions_[1]->IsActive()); | |
| 885 } | |
| 886 #endif // defined(OS_ANDROID) | |
| 887 | |
| 888 #if defined(OS_ANDROID) | |
| 889 // Tests multiple StartNotifySession success. | |
| 890 TEST_F(BluetoothGattCharacteristicTest, StartNotifySessionError_Multiple) { | |
| 891 ASSERT_NO_FATAL_FAILURE( | |
| 892 FakeCharacteristicBoilerplate(/* properties: NOTIFY */ 0x10)); | |
| 893 SimulateGattDescriptor( | |
| 894 characteristic1_, | |
| 895 BluetoothGattDescriptor::ClientCharacteristicConfigurationUuid() | |
| 896 .canonical_value()); | |
| 897 ASSERT_EQ(1u, characteristic1_->GetDescriptors().size()); | |
| 898 | |
| 899 characteristic1_->StartNotifySession(GetNotifyCallback(Call::NOT_EXPECTED), | |
| 900 GetGattErrorCallback(Call::EXPECTED)); | |
| 901 characteristic1_->StartNotifySession(GetNotifyCallback(Call::NOT_EXPECTED), | |
| 902 GetGattErrorCallback(Call::EXPECTED)); | |
| 903 EXPECT_EQ(1, gatt_notify_characteristic_attempts_); | |
| 904 EXPECT_EQ(0, callback_count_); | |
| 905 SimulateGattNotifySessionStartError(characteristic1_, | |
| 906 BluetoothGattService::GATT_ERROR_FAILED); | |
| 907 EXPECT_EQ(0, callback_count_); | |
| 908 EXPECT_EQ(2, error_callback_count_); | |
| 909 ASSERT_EQ(0u, notify_sessions_.size()); | |
| 910 EXPECT_EQ(BluetoothGattService::GATT_ERROR_FAILED, last_gatt_error_code_); | |
| 911 } | |
| 912 #endif // defined(OS_ANDROID) | |
| 913 | |
| 914 #if defined(OS_ANDROID) | |
| 915 // Tests multiple StartNotifySession success. | |
|
ortuno
2016/03/13 22:45:03
Wrong test description.
scheib
2016/03/14 20:00:16
Done.
| |
| 916 TEST_F(BluetoothGattCharacteristicTest, StartNotifySession_AfterDeleted) { | |
| 917 ASSERT_NO_FATAL_FAILURE( | |
| 918 FakeCharacteristicBoilerplate(/* properties: NOTIFY */ 0x10)); | |
| 919 SimulateGattDescriptor( | |
| 920 characteristic1_, | |
| 921 BluetoothGattDescriptor::ClientCharacteristicConfigurationUuid() | |
| 922 .canonical_value()); | |
| 923 ASSERT_EQ(1u, characteristic1_->GetDescriptors().size()); | |
| 924 | |
| 925 characteristic1_->StartNotifySession(GetNotifyCallback(Call::NOT_EXPECTED), | |
| 926 GetGattErrorCallback(Call::EXPECTED)); | |
| 927 EXPECT_EQ(1, gatt_notify_characteristic_attempts_); | |
| 928 EXPECT_EQ(0, callback_count_); | |
| 929 | |
| 930 RememberCharacteristicForSubsequentAction(characteristic1_); | |
| 931 RememberCCCDescriptorForSubsequentAction(characteristic1_); | |
| 932 DeleteDevice(device_); // TODO(576906) delete only the characteristic. | |
| 933 | |
| 934 SimulateGattNotifySessionStarted(/* use remembered characteristic */ nullptr); | |
| 935 EXPECT_EQ(0, callback_count_); | |
| 936 EXPECT_EQ(1, error_callback_count_); | |
| 937 ASSERT_EQ(0u, notify_sessions_.size()); | |
| 938 } | |
| 939 #endif // defined(OS_ANDROID) | |
| 940 | |
| 941 #if defined(OS_ANDROID) | |
| 852 // Tests Characteristic Value changes during a Notify Session. | 942 // Tests Characteristic Value changes during a Notify Session. |
| 853 TEST_F(BluetoothGattCharacteristicTest, GattCharacteristicValueChanged) { | 943 TEST_F(BluetoothGattCharacteristicTest, GattCharacteristicValueChanged) { |
| 854 ASSERT_NO_FATAL_FAILURE(StartNotifyBoilerplate( | 944 ASSERT_NO_FATAL_FAILURE(StartNotifyBoilerplate( |
| 855 /* properties: NOTIFY */ 0x10, | 945 /* properties: NOTIFY */ 0x10, |
| 856 /* expected_config_descriptor_value: NOTIFY */ 1)); | 946 /* expected_config_descriptor_value: NOTIFY */ 1)); |
| 857 | 947 |
| 858 TestBluetoothAdapterObserver observer(adapter_); | 948 TestBluetoothAdapterObserver observer(adapter_); |
| 859 | 949 |
| 860 std::vector<uint8_t> test_vector1, test_vector2; | 950 std::vector<uint8_t> test_vector1, test_vector2; |
| 861 test_vector1.push_back(111); | 951 test_vector1.push_back(111); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 874 #if defined(OS_ANDROID) | 964 #if defined(OS_ANDROID) |
| 875 // Tests Characteristic Value changing after a Notify Session and objects being | 965 // Tests Characteristic Value changing after a Notify Session and objects being |
| 876 // destroyed. | 966 // destroyed. |
| 877 TEST_F(BluetoothGattCharacteristicTest, | 967 TEST_F(BluetoothGattCharacteristicTest, |
| 878 GattCharacteristicValueChanged_AfterDeleted) { | 968 GattCharacteristicValueChanged_AfterDeleted) { |
| 879 ASSERT_NO_FATAL_FAILURE(StartNotifyBoilerplate( | 969 ASSERT_NO_FATAL_FAILURE(StartNotifyBoilerplate( |
| 880 /* properties: NOTIFY */ 0x10, | 970 /* properties: NOTIFY */ 0x10, |
| 881 /* expected_config_descriptor_value: NOTIFY */ 1)); | 971 /* expected_config_descriptor_value: NOTIFY */ 1)); |
| 882 | 972 |
| 883 RememberCharacteristicForSubsequentAction(characteristic1_); | 973 RememberCharacteristicForSubsequentAction(characteristic1_); |
| 884 DeleteDevice(device_); | 974 DeleteDevice(device_); // TODO(576906) delete only the characteristic. |
| 885 | 975 |
| 886 std::vector<uint8_t> empty_vector; | 976 std::vector<uint8_t> empty_vector; |
| 887 SimulateGattCharacteristicChanged(/* use remembered characteristic */ nullptr, | 977 SimulateGattCharacteristicChanged(/* use remembered characteristic */ nullptr, |
| 888 empty_vector); | 978 empty_vector); |
| 889 EXPECT_TRUE("Did not crash!"); | 979 EXPECT_TRUE("Did not crash!"); |
| 890 } | 980 } |
| 891 #endif // defined(OS_ANDROID) | 981 #endif // defined(OS_ANDROID) |
| 892 | 982 |
| 893 #if defined(OS_ANDROID) | |
| 894 // Tests multiple StartNotifySession success. | |
| 895 TEST_F(BluetoothGattCharacteristicTest, StartNotifySession_Multiple) { | |
| 896 ASSERT_NO_FATAL_FAILURE( | |
| 897 FakeCharacteristicBoilerplate(/* properties: NOTIFY */ 0x10)); | |
| 898 SimulateGattDescriptor( | |
| 899 characteristic1_, | |
| 900 BluetoothGattDescriptor::ClientCharacteristicConfigurationUuid() | |
| 901 .canonical_value()); | |
| 902 ASSERT_EQ(1u, characteristic1_->GetDescriptors().size()); | |
| 903 | |
| 904 characteristic1_->StartNotifySession( | |
| 905 GetNotifyCallback(Call::EXPECTED), | |
| 906 GetGattErrorCallback(Call::NOT_EXPECTED)); | |
| 907 characteristic1_->StartNotifySession( | |
| 908 GetNotifyCallback(Call::EXPECTED), | |
| 909 GetGattErrorCallback(Call::NOT_EXPECTED)); | |
| 910 EXPECT_EQ(1, gatt_notify_characteristic_attempts_); | |
| 911 EXPECT_EQ(0, callback_count_); | |
| 912 SimulateGattNotifySessionStarted(characteristic1_); | |
| 913 EXPECT_EQ(2, callback_count_); | |
| 914 EXPECT_EQ(0, error_callback_count_); | |
| 915 ASSERT_EQ(2u, notify_sessions_.size()); | |
| 916 ASSERT_TRUE(notify_sessions_[0]); | |
| 917 ASSERT_TRUE(notify_sessions_[1]); | |
| 918 EXPECT_EQ(characteristic1_->GetIdentifier(), | |
| 919 notify_sessions_[0]->GetCharacteristicIdentifier()); | |
| 920 EXPECT_EQ(characteristic1_->GetIdentifier(), | |
| 921 notify_sessions_[1]->GetCharacteristicIdentifier()); | |
| 922 EXPECT_TRUE(notify_sessions_[0]->IsActive()); | |
| 923 EXPECT_TRUE(notify_sessions_[1]->IsActive()); | |
| 924 } | |
| 925 #endif // defined(OS_ANDROID) | |
| 926 | |
| 927 #if defined(OS_ANDROID) || defined(OS_WIN) | 983 #if defined(OS_ANDROID) || defined(OS_WIN) |
| 928 TEST_F(BluetoothGattCharacteristicTest, GetDescriptors_FindNone) { | 984 TEST_F(BluetoothGattCharacteristicTest, GetDescriptors_FindNone) { |
| 929 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate()); | 985 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate()); |
| 930 | 986 |
| 931 EXPECT_EQ(0u, characteristic1_->GetDescriptors().size()); | 987 EXPECT_EQ(0u, characteristic1_->GetDescriptors().size()); |
| 932 } | 988 } |
| 933 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 989 #endif // defined(OS_ANDROID) || defined(OS_WIN) |
| 934 | 990 |
| 935 #if defined(OS_ANDROID) || defined(OS_WIN) | 991 #if defined(OS_ANDROID) || defined(OS_WIN) |
| 936 TEST_F(BluetoothGattCharacteristicTest, GetDescriptors_and_GetDescriptor) { | 992 TEST_F(BluetoothGattCharacteristicTest, GetDescriptors_and_GetDescriptor) { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 998 EXPECT_EQ(1u, characteristic1_->GetDescriptorsForUUID(id2).size()); | 1054 EXPECT_EQ(1u, characteristic1_->GetDescriptorsForUUID(id2).size()); |
| 999 EXPECT_EQ(2u, characteristic2_->GetDescriptorsForUUID(id3).size()); | 1055 EXPECT_EQ(2u, characteristic2_->GetDescriptorsForUUID(id3).size()); |
| 1000 | 1056 |
| 1001 EXPECT_EQ(0u, characteristic2_->GetDescriptorsForUUID(id1).size()); | 1057 EXPECT_EQ(0u, characteristic2_->GetDescriptorsForUUID(id1).size()); |
| 1002 EXPECT_EQ(0u, characteristic2_->GetDescriptorsForUUID(id2).size()); | 1058 EXPECT_EQ(0u, characteristic2_->GetDescriptorsForUUID(id2).size()); |
| 1003 EXPECT_EQ(0u, characteristic1_->GetDescriptorsForUUID(id3).size()); | 1059 EXPECT_EQ(0u, characteristic1_->GetDescriptorsForUUID(id3).size()); |
| 1004 } | 1060 } |
| 1005 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 1061 #endif // defined(OS_ANDROID) || defined(OS_WIN) |
| 1006 | 1062 |
| 1007 } // namespace device | 1063 } // namespace device |
| OLD | NEW |