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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 309 | 309 |
| 310 // Duplicate read reported from OS shouldn't cause a problem: | 310 // Duplicate read reported from OS shouldn't cause a problem: |
| 311 SimulateGattCharacteristicRead(characteristic1_, empty_vector); | 311 SimulateGattCharacteristicRead(characteristic1_, empty_vector); |
| 312 | 312 |
| 313 EXPECT_EQ(1, gatt_read_characteristic_attempts_); | 313 EXPECT_EQ(1, gatt_read_characteristic_attempts_); |
| 314 EXPECT_EQ(empty_vector, last_read_value_); | 314 EXPECT_EQ(empty_vector, last_read_value_); |
| 315 EXPECT_EQ(empty_vector, characteristic1_->GetValue()); | 315 EXPECT_EQ(empty_vector, characteristic1_->GetValue()); |
| 316 } | 316 } |
| 317 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) | 317 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 318 | 318 |
| 319 #if defined(OS_ANDROID) || defined(OS_WIN) | 319 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 320 // Tests WriteRemoteCharacteristic with empty value buffer. | 320 // Tests WriteRemoteCharacteristic with empty value buffer. |
| 321 TEST_F(BluetoothRemoteGattCharacteristicTest, WriteRemoteCharacteristic_Empty) { | 321 TEST_F(BluetoothRemoteGattCharacteristicTest, WriteRemoteCharacteristic_Empty) { |
| 322 if (!PlatformSupportsLowEnergy()) { | |
| 323 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; | |
| 324 return; | |
| 325 } | |
| 322 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 326 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| 323 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); | 327 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); |
| 324 | 328 |
| 325 std::vector<uint8_t> empty_vector; | 329 std::vector<uint8_t> empty_vector; |
| 326 characteristic1_->WriteRemoteCharacteristic( | 330 characteristic1_->WriteRemoteCharacteristic( |
| 327 empty_vector, GetCallback(Call::EXPECTED), | 331 empty_vector, GetCallback(Call::EXPECTED), |
| 328 GetGattErrorCallback(Call::NOT_EXPECTED)); | 332 GetGattErrorCallback(Call::NOT_EXPECTED)); |
| 329 SimulateGattCharacteristicWrite(characteristic1_); | 333 SimulateGattCharacteristicWrite(characteristic1_); |
| 330 EXPECT_EQ(1, gatt_write_characteristic_attempts_); | 334 EXPECT_EQ(1, gatt_write_characteristic_attempts_); |
| 331 | 335 |
| 332 // Duplicate write reported from OS shouldn't cause a problem: | 336 // Duplicate write reported from OS shouldn't cause a problem: |
| 333 SimulateGattCharacteristicWrite(characteristic1_); | 337 SimulateGattCharacteristicWrite(characteristic1_); |
| 334 | 338 |
| 335 EXPECT_EQ(empty_vector, last_write_value_); | 339 EXPECT_EQ(empty_vector, last_write_value_); |
| 336 } | 340 } |
| 337 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 341 #endif // defined(OS_ANDROID) || defined(OS_WIN) |
|
ortuno
2016/06/22 21:37:45
Add "|| defined(OS_MACOSX)"
jlebel
2016/06/23 18:33:01
Done.
| |
| 338 | 342 |
| 339 #if defined(OS_ANDROID) || defined(OS_WIN) | 343 #if defined(OS_ANDROID) || defined(OS_WIN) |
| 340 // Tests ReadRemoteCharacteristic completing after Chrome objects are deleted. | 344 // Tests ReadRemoteCharacteristic completing after Chrome objects are deleted. |
| 341 // This test is not relevant for macOS. This can never happen if CBPeripheral | 345 // This test is not relevant for macOS. This can never happen if CBPeripheral |
| 342 // delegate is set to nil. | 346 // delegate is set to nil. |
| 343 TEST_F(BluetoothRemoteGattCharacteristicTest, | 347 TEST_F(BluetoothRemoteGattCharacteristicTest, |
| 344 ReadRemoteCharacteristic_AfterDeleted) { | 348 ReadRemoteCharacteristic_AfterDeleted) { |
| 345 if (!PlatformSupportsLowEnergy()) { | 349 if (!PlatformSupportsLowEnergy()) { |
| 346 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; | 350 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; |
| 347 return; | 351 return; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 362 EXPECT_TRUE("Did not crash!"); | 366 EXPECT_TRUE("Did not crash!"); |
| 363 } | 367 } |
| 364 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 368 #endif // defined(OS_ANDROID) || defined(OS_WIN) |
| 365 | 369 |
| 366 #if defined(OS_ANDROID) || defined(OS_WIN) | 370 #if defined(OS_ANDROID) || defined(OS_WIN) |
| 367 // Tests WriteRemoteCharacteristic completing after Chrome objects are deleted. | 371 // Tests WriteRemoteCharacteristic completing after Chrome objects are deleted. |
| 368 // This test is not relevant for macOS. This can never happen if CBPeripheral | 372 // This test is not relevant for macOS. This can never happen if CBPeripheral |
| 369 // delegate is set to nil. | 373 // delegate is set to nil. |
| 370 TEST_F(BluetoothRemoteGattCharacteristicTest, | 374 TEST_F(BluetoothRemoteGattCharacteristicTest, |
| 371 WriteRemoteCharacteristic_AfterDeleted) { | 375 WriteRemoteCharacteristic_AfterDeleted) { |
| 376 if (!PlatformSupportsLowEnergy()) { | |
| 377 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; | |
| 378 return; | |
| 379 } | |
| 372 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 380 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| 373 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); | 381 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); |
| 374 | 382 |
| 375 std::vector<uint8_t> empty_vector; | 383 std::vector<uint8_t> empty_vector; |
| 376 characteristic1_->WriteRemoteCharacteristic( | 384 characteristic1_->WriteRemoteCharacteristic( |
| 377 empty_vector, GetCallback(Call::NOT_EXPECTED), | 385 empty_vector, GetCallback(Call::NOT_EXPECTED), |
| 378 GetGattErrorCallback(Call::NOT_EXPECTED)); | 386 GetGattErrorCallback(Call::NOT_EXPECTED)); |
| 379 | 387 |
| 380 RememberCharacteristicForSubsequentAction(characteristic1_); | 388 RememberCharacteristicForSubsequentAction(characteristic1_); |
| 381 DeleteDevice(device_); // TODO(576906) delete only the characteristic. | 389 DeleteDevice(device_); // TODO(576906) delete only the characteristic. |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 406 // Duplicate read reported from OS shouldn't cause a problem: | 414 // Duplicate read reported from OS shouldn't cause a problem: |
| 407 std::vector<uint8_t> empty_vector; | 415 std::vector<uint8_t> empty_vector; |
| 408 SimulateGattCharacteristicRead(characteristic1_, empty_vector); | 416 SimulateGattCharacteristicRead(characteristic1_, empty_vector); |
| 409 | 417 |
| 410 EXPECT_EQ(1, gatt_read_characteristic_attempts_); | 418 EXPECT_EQ(1, gatt_read_characteristic_attempts_); |
| 411 EXPECT_EQ(test_vector, last_read_value_); | 419 EXPECT_EQ(test_vector, last_read_value_); |
| 412 EXPECT_EQ(test_vector, characteristic1_->GetValue()); | 420 EXPECT_EQ(test_vector, characteristic1_->GetValue()); |
| 413 } | 421 } |
| 414 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) | 422 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 415 | 423 |
| 416 #if defined(OS_ANDROID) || defined(OS_WIN) | 424 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 417 // Tests WriteRemoteCharacteristic with non-empty value buffer. | 425 // Tests WriteRemoteCharacteristic with non-empty value buffer. |
| 418 TEST_F(BluetoothRemoteGattCharacteristicTest, WriteRemoteCharacteristic) { | 426 TEST_F(BluetoothRemoteGattCharacteristicTest, WriteRemoteCharacteristic) { |
| 427 if (!PlatformSupportsLowEnergy()) { | |
| 428 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; | |
| 429 return; | |
| 430 } | |
| 419 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 431 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| 420 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); | 432 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); |
| 421 | 433 |
| 422 uint8_t values[] = {0, 1, 2, 3, 4, 0xf, 0xf0, 0xff}; | 434 uint8_t values[] = {0, 1, 2, 3, 4, 0xf, 0xf0, 0xff}; |
| 423 std::vector<uint8_t> test_vector(values, values + arraysize(values)); | 435 std::vector<uint8_t> test_vector(values, values + arraysize(values)); |
| 424 characteristic1_->WriteRemoteCharacteristic( | 436 characteristic1_->WriteRemoteCharacteristic( |
| 425 test_vector, GetCallback(Call::EXPECTED), | 437 test_vector, GetCallback(Call::EXPECTED), |
| 426 GetGattErrorCallback(Call::NOT_EXPECTED)); | 438 GetGattErrorCallback(Call::NOT_EXPECTED)); |
| 427 | 439 |
| 428 SimulateGattCharacteristicWrite(characteristic1_); | 440 SimulateGattCharacteristicWrite(characteristic1_); |
| 429 | 441 |
| 430 EXPECT_EQ(1, gatt_write_characteristic_attempts_); | 442 EXPECT_EQ(1, gatt_write_characteristic_attempts_); |
| 431 EXPECT_EQ(test_vector, last_write_value_); | 443 EXPECT_EQ(test_vector, last_write_value_); |
| 432 } | 444 } |
| 433 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 445 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 434 | 446 |
| 435 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) | 447 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 436 // Tests ReadRemoteCharacteristic and GetValue multiple times. | 448 // Tests ReadRemoteCharacteristic and GetValue multiple times. |
| 437 TEST_F(BluetoothRemoteGattCharacteristicTest, ReadRemoteCharacteristic_Twice) { | 449 TEST_F(BluetoothRemoteGattCharacteristicTest, ReadRemoteCharacteristic_Twice) { |
| 438 if (!PlatformSupportsLowEnergy()) { | 450 if (!PlatformSupportsLowEnergy()) { |
| 439 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; | 451 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; |
| 440 return; | 452 return; |
| 441 } | 453 } |
| 442 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 454 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| 443 BluetoothRemoteGattCharacteristic::PROPERTY_READ)); | 455 BluetoothRemoteGattCharacteristic::PROPERTY_READ)); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 463 std::vector<uint8_t> empty_vector; | 475 std::vector<uint8_t> empty_vector; |
| 464 SimulateGattCharacteristicRead(characteristic1_, empty_vector); | 476 SimulateGattCharacteristicRead(characteristic1_, empty_vector); |
| 465 EXPECT_EQ(1, gatt_read_characteristic_attempts_); | 477 EXPECT_EQ(1, gatt_read_characteristic_attempts_); |
| 466 EXPECT_EQ(1, callback_count_); | 478 EXPECT_EQ(1, callback_count_); |
| 467 EXPECT_EQ(0, error_callback_count_); | 479 EXPECT_EQ(0, error_callback_count_); |
| 468 EXPECT_EQ(empty_vector, last_read_value_); | 480 EXPECT_EQ(empty_vector, last_read_value_); |
| 469 EXPECT_EQ(empty_vector, characteristic1_->GetValue()); | 481 EXPECT_EQ(empty_vector, characteristic1_->GetValue()); |
| 470 } | 482 } |
| 471 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) | 483 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 472 | 484 |
| 473 #if defined(OS_ANDROID) || defined(OS_WIN) | 485 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 474 // Tests WriteRemoteCharacteristic multiple times. | 486 // Tests WriteRemoteCharacteristic multiple times. |
| 475 TEST_F(BluetoothRemoteGattCharacteristicTest, WriteRemoteCharacteristic_Twice) { | 487 TEST_F(BluetoothRemoteGattCharacteristicTest, WriteRemoteCharacteristic_Twice) { |
| 488 if (!PlatformSupportsLowEnergy()) { | |
| 489 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; | |
| 490 return; | |
| 491 } | |
| 476 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 492 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| 477 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); | 493 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); |
| 478 | 494 |
| 479 uint8_t values[] = {0, 1, 2, 3, 4, 0xf, 0xf0, 0xff}; | 495 uint8_t values[] = {0, 1, 2, 3, 4, 0xf, 0xf0, 0xff}; |
| 480 std::vector<uint8_t> test_vector(values, values + arraysize(values)); | 496 std::vector<uint8_t> test_vector(values, values + arraysize(values)); |
| 481 characteristic1_->WriteRemoteCharacteristic( | 497 characteristic1_->WriteRemoteCharacteristic( |
| 482 test_vector, GetCallback(Call::EXPECTED), | 498 test_vector, GetCallback(Call::EXPECTED), |
| 483 GetGattErrorCallback(Call::NOT_EXPECTED)); | 499 GetGattErrorCallback(Call::NOT_EXPECTED)); |
| 484 | 500 |
| 485 SimulateGattCharacteristicWrite(characteristic1_); | 501 SimulateGattCharacteristicWrite(characteristic1_); |
| 486 EXPECT_EQ(1, gatt_write_characteristic_attempts_); | 502 EXPECT_EQ(1, gatt_write_characteristic_attempts_); |
| 487 EXPECT_EQ(1, callback_count_); | 503 EXPECT_EQ(1, callback_count_); |
| 488 EXPECT_EQ(0, error_callback_count_); | 504 EXPECT_EQ(0, error_callback_count_); |
| 489 EXPECT_EQ(test_vector, last_write_value_); | 505 EXPECT_EQ(test_vector, last_write_value_); |
| 490 | 506 |
| 491 // Write again, with different value: | 507 // Write again, with different value: |
| 492 ResetEventCounts(); | 508 ResetEventCounts(); |
| 493 std::vector<uint8_t> empty_vector; | 509 std::vector<uint8_t> empty_vector; |
| 494 characteristic1_->WriteRemoteCharacteristic( | 510 characteristic1_->WriteRemoteCharacteristic( |
| 495 empty_vector, GetCallback(Call::EXPECTED), | 511 empty_vector, GetCallback(Call::EXPECTED), |
| 496 GetGattErrorCallback(Call::NOT_EXPECTED)); | 512 GetGattErrorCallback(Call::NOT_EXPECTED)); |
| 497 | 513 |
| 498 SimulateGattCharacteristicWrite(characteristic1_); | 514 SimulateGattCharacteristicWrite(characteristic1_); |
| 499 EXPECT_EQ(1, gatt_write_characteristic_attempts_); | 515 EXPECT_EQ(1, gatt_write_characteristic_attempts_); |
| 500 EXPECT_EQ(1, callback_count_); | 516 EXPECT_EQ(1, callback_count_); |
| 501 EXPECT_EQ(0, error_callback_count_); | 517 EXPECT_EQ(0, error_callback_count_); |
| 502 EXPECT_EQ(empty_vector, last_write_value_); | 518 EXPECT_EQ(empty_vector, last_write_value_); |
| 503 } | 519 } |
| 504 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 520 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 505 | 521 |
| 506 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) | 522 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 507 // Tests ReadRemoteCharacteristic on two characteristics. | 523 // Tests ReadRemoteCharacteristic on two characteristics. |
| 508 TEST_F(BluetoothRemoteGattCharacteristicTest, | 524 TEST_F(BluetoothRemoteGattCharacteristicTest, |
| 509 ReadRemoteCharacteristic_MultipleCharacteristics) { | 525 ReadRemoteCharacteristic_MultipleCharacteristics) { |
| 510 if (!PlatformSupportsLowEnergy()) { | 526 if (!PlatformSupportsLowEnergy()) { |
| 511 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; | 527 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; |
| 512 return; | 528 return; |
| 513 } | 529 } |
| 514 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 530 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 534 EXPECT_EQ(test_vector2, last_read_value_); | 550 EXPECT_EQ(test_vector2, last_read_value_); |
| 535 | 551 |
| 536 EXPECT_EQ(2, gatt_read_characteristic_attempts_); | 552 EXPECT_EQ(2, gatt_read_characteristic_attempts_); |
| 537 EXPECT_EQ(2, callback_count_); | 553 EXPECT_EQ(2, callback_count_); |
| 538 EXPECT_EQ(0, error_callback_count_); | 554 EXPECT_EQ(0, error_callback_count_); |
| 539 EXPECT_EQ(test_vector1, characteristic1_->GetValue()); | 555 EXPECT_EQ(test_vector1, characteristic1_->GetValue()); |
| 540 EXPECT_EQ(test_vector2, characteristic2_->GetValue()); | 556 EXPECT_EQ(test_vector2, characteristic2_->GetValue()); |
| 541 } | 557 } |
| 542 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) | 558 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 543 | 559 |
| 544 #if defined(OS_ANDROID) || defined(OS_WIN) | 560 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 545 // Tests WriteRemoteCharacteristic on two characteristics. | 561 // Tests WriteRemoteCharacteristic on two characteristics. |
| 546 TEST_F(BluetoothRemoteGattCharacteristicTest, | 562 TEST_F(BluetoothRemoteGattCharacteristicTest, |
| 547 WriteRemoteCharacteristic_MultipleCharacteristics) { | 563 WriteRemoteCharacteristic_MultipleCharacteristics) { |
| 564 if (!PlatformSupportsLowEnergy()) { | |
| 565 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; | |
| 566 return; | |
| 567 } | |
| 548 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 568 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| 549 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); | 569 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); |
| 550 | 570 |
| 551 std::vector<uint8_t> test_vector1; | 571 std::vector<uint8_t> test_vector1; |
| 552 test_vector1.push_back(111); | 572 test_vector1.push_back(111); |
| 553 characteristic1_->WriteRemoteCharacteristic( | 573 characteristic1_->WriteRemoteCharacteristic( |
| 554 test_vector1, GetCallback(Call::EXPECTED), | 574 test_vector1, GetCallback(Call::EXPECTED), |
| 555 GetGattErrorCallback(Call::NOT_EXPECTED)); | 575 GetGattErrorCallback(Call::NOT_EXPECTED)); |
| 556 #ifdef OS_ANDROID | 576 #if defined(OS_ANDROID) || defined(OS_MACOSX) |
| 557 EXPECT_EQ(test_vector1, last_write_value_); | 577 EXPECT_EQ(test_vector1, last_write_value_); |
| 558 #endif | 578 #endif |
| 559 | 579 |
| 560 std::vector<uint8_t> test_vector2; | 580 std::vector<uint8_t> test_vector2; |
| 561 test_vector2.push_back(222); | 581 test_vector2.push_back(222); |
| 562 characteristic2_->WriteRemoteCharacteristic( | 582 characteristic2_->WriteRemoteCharacteristic( |
| 563 test_vector2, GetCallback(Call::EXPECTED), | 583 test_vector2, GetCallback(Call::EXPECTED), |
| 564 GetGattErrorCallback(Call::NOT_EXPECTED)); | 584 GetGattErrorCallback(Call::NOT_EXPECTED)); |
| 565 #ifdef OS_ANDROID | 585 #if defined(OS_ANDROID) || defined(OS_MACOSX) |
| 566 EXPECT_EQ(test_vector2, last_write_value_); | 586 EXPECT_EQ(test_vector2, last_write_value_); |
| 567 #endif | 587 #endif |
| 568 | 588 |
| 569 EXPECT_EQ(0, callback_count_); | 589 EXPECT_EQ(0, callback_count_); |
| 570 EXPECT_EQ(0, error_callback_count_); | 590 EXPECT_EQ(0, error_callback_count_); |
| 571 | 591 |
| 572 SimulateGattCharacteristicWrite(characteristic1_); | 592 SimulateGattCharacteristicWrite(characteristic1_); |
| 573 #ifndef OS_ANDROID | 593 #if !(defined(OS_ANDROID) || defined(OS_MACOSX)) |
| 574 EXPECT_EQ(test_vector1, last_write_value_); | 594 EXPECT_EQ(test_vector1, last_write_value_); |
| 575 #endif | 595 #endif |
| 576 | 596 |
| 577 SimulateGattCharacteristicWrite(characteristic2_); | 597 SimulateGattCharacteristicWrite(characteristic2_); |
| 578 #ifndef OS_ANDROID | 598 #if !(defined(OS_ANDROID) || defined(OS_MACOSX)) |
| 579 EXPECT_EQ(test_vector2, last_write_value_); | 599 EXPECT_EQ(test_vector2, last_write_value_); |
| 580 #endif | 600 #endif |
| 581 | 601 |
| 582 EXPECT_EQ(2, gatt_write_characteristic_attempts_); | 602 EXPECT_EQ(2, gatt_write_characteristic_attempts_); |
| 583 EXPECT_EQ(2, callback_count_); | 603 EXPECT_EQ(2, callback_count_); |
| 584 EXPECT_EQ(0, error_callback_count_); | 604 EXPECT_EQ(0, error_callback_count_); |
| 585 | 605 |
| 586 // TODO(591740): Remove if define for OS_ANDROID in this test. | 606 // TODO(591740): Remove if define for OS_ANDROID in this test. |
| 587 } | 607 } |
| 588 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 608 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 589 | 609 |
| 590 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) | 610 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 591 // Tests ReadRemoteCharacteristic asynchronous error. | 611 // Tests ReadRemoteCharacteristic asynchronous error. |
| 592 TEST_F(BluetoothRemoteGattCharacteristicTest, ReadError) { | 612 TEST_F(BluetoothRemoteGattCharacteristicTest, ReadError) { |
| 593 if (!PlatformSupportsLowEnergy()) { | 613 if (!PlatformSupportsLowEnergy()) { |
| 594 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; | 614 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; |
| 595 return; | 615 return; |
| 596 } | 616 } |
| 597 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 617 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| 598 BluetoothRemoteGattCharacteristic::PROPERTY_READ)); | 618 BluetoothRemoteGattCharacteristic::PROPERTY_READ)); |
| 599 | 619 |
| 600 TestBluetoothAdapterObserver observer(adapter_); | 620 TestBluetoothAdapterObserver observer(adapter_); |
| 601 | 621 |
| 602 characteristic1_->ReadRemoteCharacteristic( | 622 characteristic1_->ReadRemoteCharacteristic( |
| 603 GetReadValueCallback(Call::NOT_EXPECTED), | 623 GetReadValueCallback(Call::NOT_EXPECTED), |
| 604 GetGattErrorCallback(Call::EXPECTED)); | 624 GetGattErrorCallback(Call::EXPECTED)); |
| 605 SimulateGattCharacteristicReadError( | 625 SimulateGattCharacteristicReadError( |
| 606 characteristic1_, BluetoothRemoteGattService::GATT_ERROR_INVALID_LENGTH); | 626 characteristic1_, BluetoothRemoteGattService::GATT_ERROR_INVALID_LENGTH); |
| 607 SimulateGattCharacteristicReadError( | 627 SimulateGattCharacteristicReadError( |
| 608 characteristic1_, BluetoothRemoteGattService::GATT_ERROR_FAILED); | 628 characteristic1_, BluetoothRemoteGattService::GATT_ERROR_FAILED); |
| 609 EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_INVALID_LENGTH, | 629 EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_INVALID_LENGTH, |
| 610 last_gatt_error_code_); | 630 last_gatt_error_code_); |
| 611 EXPECT_EQ(0, observer.gatt_characteristic_value_changed_count()); | 631 EXPECT_EQ(0, observer.gatt_characteristic_value_changed_count()); |
| 612 } | 632 } |
| 613 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) | 633 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 614 | 634 |
| 615 #if defined(OS_ANDROID) || defined(OS_WIN) | 635 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 616 // Tests WriteRemoteCharacteristic asynchronous error. | 636 // Tests WriteRemoteCharacteristic asynchronous error. |
| 617 TEST_F(BluetoothRemoteGattCharacteristicTest, WriteError) { | 637 TEST_F(BluetoothRemoteGattCharacteristicTest, WriteError) { |
| 638 if (!PlatformSupportsLowEnergy()) { | |
| 639 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; | |
| 640 return; | |
| 641 } | |
| 618 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 642 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| 619 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); | 643 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); |
| 620 | 644 |
| 621 std::vector<uint8_t> empty_vector; | 645 std::vector<uint8_t> empty_vector; |
| 622 characteristic1_->WriteRemoteCharacteristic( | 646 characteristic1_->WriteRemoteCharacteristic( |
| 623 empty_vector, GetCallback(Call::NOT_EXPECTED), | 647 empty_vector, GetCallback(Call::NOT_EXPECTED), |
| 624 GetGattErrorCallback(Call::EXPECTED)); | 648 GetGattErrorCallback(Call::EXPECTED)); |
| 625 SimulateGattCharacteristicWriteError( | 649 SimulateGattCharacteristicWriteError( |
| 626 characteristic1_, BluetoothRemoteGattService::GATT_ERROR_INVALID_LENGTH); | 650 characteristic1_, BluetoothRemoteGattService::GATT_ERROR_INVALID_LENGTH); |
| 627 SimulateGattCharacteristicWriteError( | 651 SimulateGattCharacteristicWriteError( |
| 628 characteristic1_, BluetoothRemoteGattService::GATT_ERROR_FAILED); | 652 characteristic1_, BluetoothRemoteGattService::GATT_ERROR_FAILED); |
| 629 | 653 |
| 630 EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_INVALID_LENGTH, | 654 EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_INVALID_LENGTH, |
| 631 last_gatt_error_code_); | 655 last_gatt_error_code_); |
| 632 } | 656 } |
| 633 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 657 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 634 | 658 |
| 635 #if defined(OS_ANDROID) | 659 #if defined(OS_ANDROID) |
| 636 // Tests ReadRemoteCharacteristic synchronous error. | 660 // Tests ReadRemoteCharacteristic synchronous error. |
| 637 // Test not relevant for macOS since characteristic read cannot generate | 661 // Test not relevant for macOS since characteristic read cannot generate |
| 638 // synchronous error. | 662 // synchronous error. |
| 639 TEST_F(BluetoothRemoteGattCharacteristicTest, ReadSynchronousError) { | 663 TEST_F(BluetoothRemoteGattCharacteristicTest, ReadSynchronousError) { |
| 640 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate()); | 664 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate()); |
| 641 | 665 |
| 642 SimulateGattCharacteristicReadWillFailSynchronouslyOnce(characteristic1_); | 666 SimulateGattCharacteristicReadWillFailSynchronouslyOnce(characteristic1_); |
| 643 characteristic1_->ReadRemoteCharacteristic( | 667 characteristic1_->ReadRemoteCharacteristic( |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 657 GetGattErrorCallback(Call::NOT_EXPECTED)); | 681 GetGattErrorCallback(Call::NOT_EXPECTED)); |
| 658 EXPECT_EQ(1, gatt_read_characteristic_attempts_); | 682 EXPECT_EQ(1, gatt_read_characteristic_attempts_); |
| 659 std::vector<uint8_t> empty_vector; | 683 std::vector<uint8_t> empty_vector; |
| 660 SimulateGattCharacteristicRead(characteristic1_, empty_vector); | 684 SimulateGattCharacteristicRead(characteristic1_, empty_vector); |
| 661 EXPECT_EQ(1, callback_count_); | 685 EXPECT_EQ(1, callback_count_); |
| 662 EXPECT_EQ(0, error_callback_count_); | 686 EXPECT_EQ(0, error_callback_count_); |
| 663 } | 687 } |
| 664 #endif // defined(OS_ANDROID) | 688 #endif // defined(OS_ANDROID) |
| 665 | 689 |
| 666 #if defined(OS_ANDROID) | 690 #if defined(OS_ANDROID) |
| 667 // Tests WriteRemoteCharacteristic synchronous error. | 691 // Tests WriteRemoteCharacteristic synchronous error. |
|
ortuno
2016/06/22 21:37:45
Add a comment explaining why this test doesn't app
jlebel
2016/06/23 18:33:01
Done.
| |
| 668 TEST_F(BluetoothRemoteGattCharacteristicTest, WriteSynchronousError) { | 692 TEST_F(BluetoothRemoteGattCharacteristicTest, WriteSynchronousError) { |
| 669 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate()); | 693 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate()); |
| 670 | 694 |
| 671 SimulateGattCharacteristicWriteWillFailSynchronouslyOnce(characteristic1_); | 695 SimulateGattCharacteristicWriteWillFailSynchronouslyOnce(characteristic1_); |
| 672 std::vector<uint8_t> empty_vector; | 696 std::vector<uint8_t> empty_vector; |
| 673 characteristic1_->WriteRemoteCharacteristic( | 697 characteristic1_->WriteRemoteCharacteristic( |
| 674 empty_vector, GetCallback(Call::NOT_EXPECTED), | 698 empty_vector, GetCallback(Call::NOT_EXPECTED), |
| 675 GetGattErrorCallback(Call::EXPECTED)); | 699 GetGattErrorCallback(Call::EXPECTED)); |
| 676 EXPECT_EQ(0, gatt_write_characteristic_attempts_); | 700 EXPECT_EQ(0, gatt_write_characteristic_attempts_); |
| 677 base::RunLoop().RunUntilIdle(); | 701 base::RunLoop().RunUntilIdle(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 719 | 743 |
| 720 // Initial read should still succeed: | 744 // Initial read should still succeed: |
| 721 ResetEventCounts(); | 745 ResetEventCounts(); |
| 722 std::vector<uint8_t> empty_vector; | 746 std::vector<uint8_t> empty_vector; |
| 723 SimulateGattCharacteristicRead(characteristic1_, empty_vector); | 747 SimulateGattCharacteristicRead(characteristic1_, empty_vector); |
| 724 EXPECT_EQ(1, callback_count_); | 748 EXPECT_EQ(1, callback_count_); |
| 725 EXPECT_EQ(0, error_callback_count_); | 749 EXPECT_EQ(0, error_callback_count_); |
| 726 } | 750 } |
| 727 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) | 751 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 728 | 752 |
| 729 #if defined(OS_ANDROID) || defined(OS_WIN) | 753 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 730 // Tests WriteRemoteCharacteristic error with a pending write operation. | 754 // Tests WriteRemoteCharacteristic error with a pending write operation. |
| 731 TEST_F(BluetoothRemoteGattCharacteristicTest, | 755 TEST_F(BluetoothRemoteGattCharacteristicTest, |
| 732 WriteRemoteCharacteristic_WritePending) { | 756 WriteRemoteCharacteristic_WritePending) { |
| 757 if (!PlatformSupportsLowEnergy()) { | |
| 758 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; | |
| 759 return; | |
| 760 } | |
| 733 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 761 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| 734 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); | 762 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); |
| 735 | 763 |
| 736 std::vector<uint8_t> empty_vector; | 764 std::vector<uint8_t> empty_vector; |
| 737 characteristic1_->WriteRemoteCharacteristic( | 765 characteristic1_->WriteRemoteCharacteristic( |
| 738 empty_vector, GetCallback(Call::EXPECTED), | 766 empty_vector, GetCallback(Call::EXPECTED), |
| 739 GetGattErrorCallback(Call::NOT_EXPECTED)); | 767 GetGattErrorCallback(Call::NOT_EXPECTED)); |
| 740 characteristic1_->WriteRemoteCharacteristic( | 768 characteristic1_->WriteRemoteCharacteristic( |
| 741 empty_vector, GetCallback(Call::NOT_EXPECTED), | 769 empty_vector, GetCallback(Call::NOT_EXPECTED), |
| 742 GetGattErrorCallback(Call::EXPECTED)); | 770 GetGattErrorCallback(Call::EXPECTED)); |
| 743 | 771 |
| 744 base::RunLoop().RunUntilIdle(); | 772 base::RunLoop().RunUntilIdle(); |
| 745 | 773 |
| 746 EXPECT_EQ(0, callback_count_); | 774 EXPECT_EQ(0, callback_count_); |
| 747 EXPECT_EQ(1, error_callback_count_); | 775 EXPECT_EQ(1, error_callback_count_); |
| 748 EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS, | 776 EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS, |
| 749 last_gatt_error_code_); | 777 last_gatt_error_code_); |
| 750 | 778 |
| 751 // Initial write should still succeed: | 779 // Initial write should still succeed: |
| 752 ResetEventCounts(); | 780 ResetEventCounts(); |
| 753 SimulateGattCharacteristicWrite(characteristic1_); | 781 SimulateGattCharacteristicWrite(characteristic1_); |
| 754 EXPECT_EQ(1, callback_count_); | 782 EXPECT_EQ(1, callback_count_); |
| 755 EXPECT_EQ(0, error_callback_count_); | 783 EXPECT_EQ(0, error_callback_count_); |
| 756 } | 784 } |
| 757 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 785 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 758 | 786 |
| 759 #if defined(OS_ANDROID) || defined(OS_WIN) | 787 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 760 // Tests ReadRemoteCharacteristic error with a pending write operation. | 788 // Tests ReadRemoteCharacteristic error with a pending write operation. |
| 761 TEST_F(BluetoothRemoteGattCharacteristicTest, | 789 TEST_F(BluetoothRemoteGattCharacteristicTest, |
| 762 ReadRemoteCharacteristic_WritePending) { | 790 ReadRemoteCharacteristic_WritePending) { |
| 791 if (!PlatformSupportsLowEnergy()) { | |
| 792 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; | |
| 793 return; | |
| 794 } | |
| 763 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 795 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| 764 BluetoothRemoteGattCharacteristic::PROPERTY_READ | | 796 BluetoothRemoteGattCharacteristic::PROPERTY_READ | |
| 765 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); | 797 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); |
| 766 | 798 |
| 767 std::vector<uint8_t> empty_vector; | 799 std::vector<uint8_t> empty_vector; |
| 768 characteristic1_->WriteRemoteCharacteristic( | 800 characteristic1_->WriteRemoteCharacteristic( |
| 769 empty_vector, GetCallback(Call::EXPECTED), | 801 empty_vector, GetCallback(Call::EXPECTED), |
| 770 GetGattErrorCallback(Call::NOT_EXPECTED)); | 802 GetGattErrorCallback(Call::NOT_EXPECTED)); |
| 771 characteristic1_->ReadRemoteCharacteristic( | 803 characteristic1_->ReadRemoteCharacteristic( |
| 772 GetReadValueCallback(Call::NOT_EXPECTED), | 804 GetReadValueCallback(Call::NOT_EXPECTED), |
| 773 GetGattErrorCallback(Call::EXPECTED)); | 805 GetGattErrorCallback(Call::EXPECTED)); |
| 774 | 806 |
| 775 base::RunLoop().RunUntilIdle(); | 807 base::RunLoop().RunUntilIdle(); |
| 776 | 808 |
| 777 EXPECT_EQ(0, callback_count_); | 809 EXPECT_EQ(0, callback_count_); |
| 778 EXPECT_EQ(1, error_callback_count_); | 810 EXPECT_EQ(1, error_callback_count_); |
| 779 EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS, | 811 EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS, |
| 780 last_gatt_error_code_); | 812 last_gatt_error_code_); |
| 781 | 813 |
| 782 // Initial write should still succeed: | 814 // Initial write should still succeed: |
| 783 ResetEventCounts(); | 815 ResetEventCounts(); |
| 784 SimulateGattCharacteristicWrite(characteristic1_); | 816 SimulateGattCharacteristicWrite(characteristic1_); |
| 785 EXPECT_EQ(1, callback_count_); | 817 EXPECT_EQ(1, callback_count_); |
| 786 EXPECT_EQ(0, error_callback_count_); | 818 EXPECT_EQ(0, error_callback_count_); |
| 787 } | 819 } |
| 788 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 820 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 789 | 821 |
| 790 #if defined(OS_ANDROID) || defined(OS_WIN) | 822 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 791 // Tests WriteRemoteCharacteristic error with a pending Read operation. | 823 // Tests WriteRemoteCharacteristic error with a pending Read operation. |
| 792 TEST_F(BluetoothRemoteGattCharacteristicTest, | 824 TEST_F(BluetoothRemoteGattCharacteristicTest, |
| 793 WriteRemoteCharacteristic_ReadPending) { | 825 WriteRemoteCharacteristic_ReadPending) { |
| 826 if (!PlatformSupportsLowEnergy()) { | |
| 827 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; | |
| 828 return; | |
| 829 } | |
| 794 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( | 830 ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate( |
| 795 BluetoothRemoteGattCharacteristic::PROPERTY_READ | | 831 BluetoothRemoteGattCharacteristic::PROPERTY_READ | |
| 796 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); | 832 BluetoothRemoteGattCharacteristic::PROPERTY_WRITE)); |
| 797 | 833 |
| 798 std::vector<uint8_t> empty_vector; | 834 std::vector<uint8_t> empty_vector; |
| 799 characteristic1_->ReadRemoteCharacteristic( | 835 characteristic1_->ReadRemoteCharacteristic( |
| 800 GetReadValueCallback(Call::EXPECTED), | 836 GetReadValueCallback(Call::EXPECTED), |
| 801 GetGattErrorCallback(Call::NOT_EXPECTED)); | 837 GetGattErrorCallback(Call::NOT_EXPECTED)); |
| 802 characteristic1_->WriteRemoteCharacteristic( | 838 characteristic1_->WriteRemoteCharacteristic( |
| 803 empty_vector, GetCallback(Call::NOT_EXPECTED), | 839 empty_vector, GetCallback(Call::NOT_EXPECTED), |
| 804 GetGattErrorCallback(Call::EXPECTED)); | 840 GetGattErrorCallback(Call::EXPECTED)); |
| 805 base::RunLoop().RunUntilIdle(); | 841 base::RunLoop().RunUntilIdle(); |
| 806 | 842 |
| 807 EXPECT_EQ(0, callback_count_); | 843 EXPECT_EQ(0, callback_count_); |
| 808 EXPECT_EQ(1, error_callback_count_); | 844 EXPECT_EQ(1, error_callback_count_); |
| 809 EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS, | 845 EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS, |
| 810 last_gatt_error_code_); | 846 last_gatt_error_code_); |
| 811 | 847 |
| 812 // Initial read should still succeed: | 848 // Initial read should still succeed: |
| 813 ResetEventCounts(); | 849 ResetEventCounts(); |
| 814 SimulateGattCharacteristicRead(characteristic1_, empty_vector); | 850 SimulateGattCharacteristicRead(characteristic1_, empty_vector); |
| 815 EXPECT_EQ(1, callback_count_); | 851 EXPECT_EQ(1, callback_count_); |
| 816 EXPECT_EQ(0, error_callback_count_); | 852 EXPECT_EQ(0, error_callback_count_); |
| 817 } | 853 } |
| 818 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 854 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| 819 | 855 |
| 820 #if defined(OS_ANDROID) || defined(OS_WIN) | 856 #if defined(OS_ANDROID) || defined(OS_WIN) |
| 821 // StartNotifySession fails if characteristic doesn't have Notify or Indicate | 857 // StartNotifySession fails if characteristic doesn't have Notify or Indicate |
| 822 // property. | 858 // property. |
| 823 TEST_F(BluetoothRemoteGattCharacteristicTest, | 859 TEST_F(BluetoothRemoteGattCharacteristicTest, |
| 824 StartNotifySession_NoNotifyOrIndicate) { | 860 StartNotifySession_NoNotifyOrIndicate) { |
| 825 ASSERT_NO_FATAL_FAILURE(StartNotifyBoilerplate( | 861 ASSERT_NO_FATAL_FAILURE(StartNotifyBoilerplate( |
| 826 /* properties: NOTIFY */ 0x10, | 862 /* properties: NOTIFY */ 0x10, |
| 827 /* expected_config_descriptor_value: NOTIFY */ 1, | 863 /* expected_config_descriptor_value: NOTIFY */ 1, |
| 828 StartNotifySetupError::CHARACTERISTIC_PROPERTIES)); | 864 StartNotifySetupError::CHARACTERISTIC_PROPERTIES)); |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1277 EXPECT_EQ(1u, characteristic1_->GetDescriptorsByUUID(id2).size()); | 1313 EXPECT_EQ(1u, characteristic1_->GetDescriptorsByUUID(id2).size()); |
| 1278 EXPECT_EQ(2u, characteristic2_->GetDescriptorsByUUID(id3).size()); | 1314 EXPECT_EQ(2u, characteristic2_->GetDescriptorsByUUID(id3).size()); |
| 1279 | 1315 |
| 1280 EXPECT_EQ(0u, characteristic2_->GetDescriptorsByUUID(id1).size()); | 1316 EXPECT_EQ(0u, characteristic2_->GetDescriptorsByUUID(id1).size()); |
| 1281 EXPECT_EQ(0u, characteristic2_->GetDescriptorsByUUID(id2).size()); | 1317 EXPECT_EQ(0u, characteristic2_->GetDescriptorsByUUID(id2).size()); |
| 1282 EXPECT_EQ(0u, characteristic1_->GetDescriptorsByUUID(id3).size()); | 1318 EXPECT_EQ(0u, characteristic1_->GetDescriptorsByUUID(id3).size()); |
| 1283 } | 1319 } |
| 1284 #endif // defined(OS_ANDROID) || defined(OS_WIN) | 1320 #endif // defined(OS_ANDROID) || defined(OS_WIN) |
| 1285 | 1321 |
| 1286 } // namespace device | 1322 } // namespace device |
| OLD | NEW |