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

Side by Side Diff: extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc

Issue 593163002: Short-circuit failures in BLE js tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « chrome/test/data/extensions/api_test/bluetooth_low_energy/write_descriptor_value/runtest.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "chrome/browser/extensions/extension_apitest.h" 6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "device/bluetooth/test/mock_bluetooth_adapter.h" 7 #include "device/bluetooth/test/mock_bluetooth_adapter.h"
8 #include "device/bluetooth/test/mock_bluetooth_device.h" 8 #include "device/bluetooth/test/mock_bluetooth_device.h"
9 #include "device/bluetooth/test/mock_bluetooth_gatt_characteristic.h" 9 #include "device/bluetooth/test/mock_bluetooth_gatt_characteristic.h"
10 #include "device/bluetooth/test/mock_bluetooth_gatt_connection.h" 10 #include "device/bluetooth/test/mock_bluetooth_gatt_connection.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 .WillOnce(Return(static_cast<BluetoothDevice*>(NULL))) 271 .WillOnce(Return(static_cast<BluetoothDevice*>(NULL)))
272 .WillRepeatedly(Return(device0_.get())); 272 .WillRepeatedly(Return(device0_.get()));
273 273
274 EXPECT_CALL(*device0_, GetGattServices()) 274 EXPECT_CALL(*device0_, GetGattServices())
275 .Times(2) 275 .Times(2)
276 .WillOnce(Return(std::vector<BluetoothGattService*>())) 276 .WillOnce(Return(std::vector<BluetoothGattService*>()))
277 .WillOnce(Return(services)); 277 .WillOnce(Return(services));
278 278
279 // Load and wait for setup. 279 // Load and wait for setup.
280 ExtensionTestMessageListener listener("ready", true); 280 ExtensionTestMessageListener listener("ready", true);
281 listener.set_failure_message("fail");
281 ASSERT_TRUE(LoadExtension( 282 ASSERT_TRUE(LoadExtension(
282 test_data_dir_.AppendASCII("bluetooth_low_energy/get_services"))); 283 test_data_dir_.AppendASCII("bluetooth_low_energy/get_services")));
283 EXPECT_TRUE(listener.WaitUntilSatisfied()); 284 EXPECT_TRUE(listener.WaitUntilSatisfied());
284 285
285 listener.Reply("go"); 286 listener.Reply("go");
286 287
287 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 288 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
288 } 289 }
289 290
290 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, GetService) { 291 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, GetService) {
291 ResultCatcher catcher; 292 ResultCatcher catcher;
292 catcher.RestrictToBrowserContext(browser()->profile()); 293 catcher.RestrictToBrowserContext(browser()->profile());
293 294
294 event_router()->GattServiceAdded( 295 event_router()->GattServiceAdded(
295 mock_adapter_, device0_.get(), service0_.get()); 296 mock_adapter_, device0_.get(), service0_.get());
296 297
297 EXPECT_CALL(*mock_adapter_, GetDevice(_)) 298 EXPECT_CALL(*mock_adapter_, GetDevice(_))
298 .Times(3) 299 .Times(3)
299 .WillOnce(Return(static_cast<BluetoothDevice*>(NULL))) 300 .WillOnce(Return(static_cast<BluetoothDevice*>(NULL)))
300 .WillRepeatedly(Return(device0_.get())); 301 .WillRepeatedly(Return(device0_.get()));
301 302
302 EXPECT_CALL(*device0_, GetGattService(kTestServiceId0)) 303 EXPECT_CALL(*device0_, GetGattService(kTestServiceId0))
303 .Times(2) 304 .Times(2)
304 .WillOnce(Return(static_cast<BluetoothGattService*>(NULL))) 305 .WillOnce(Return(static_cast<BluetoothGattService*>(NULL)))
305 .WillOnce(Return(service0_.get())); 306 .WillOnce(Return(service0_.get()));
306 307
307 // Load and wait for setup. 308 // Load and wait for setup.
308 ExtensionTestMessageListener listener("ready", true); 309 ExtensionTestMessageListener listener("ready", true);
310 listener.set_failure_message("fail");
309 ASSERT_TRUE(LoadExtension( 311 ASSERT_TRUE(LoadExtension(
310 test_data_dir_.AppendASCII("bluetooth_low_energy/get_service"))); 312 test_data_dir_.AppendASCII("bluetooth_low_energy/get_service")));
311 EXPECT_TRUE(listener.WaitUntilSatisfied()); 313 EXPECT_TRUE(listener.WaitUntilSatisfied());
312 314
313 listener.Reply("go"); 315 listener.Reply("go");
314 316
315 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 317 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
316 318
317 event_router()->GattServiceRemoved( 319 event_router()->GattServiceRemoved(
318 mock_adapter_, device0_.get(), service0_.get()); 320 mock_adapter_, device0_.get(), service0_.get());
319 } 321 }
320 322
321 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, ServiceEvents) { 323 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, ServiceEvents) {
322 ResultCatcher catcher; 324 ResultCatcher catcher;
323 catcher.RestrictToBrowserContext(browser()->profile()); 325 catcher.RestrictToBrowserContext(browser()->profile());
324 326
325 // Load the extension and let it set up. 327 // Load the extension and let it set up.
326 ExtensionTestMessageListener listener("ready", true); 328 ExtensionTestMessageListener listener(true);
327 ASSERT_TRUE(LoadExtension( 329 ASSERT_TRUE(LoadExtension(
328 test_data_dir_.AppendASCII("bluetooth_low_energy/service_events"))); 330 test_data_dir_.AppendASCII("bluetooth_low_energy/service_events")));
329 331
330 // These will create the identifier mappings. 332 // These will create the identifier mappings.
331 event_router()->GattServiceAdded( 333 event_router()->GattServiceAdded(
332 mock_adapter_, device0_.get(), service0_.get()); 334 mock_adapter_, device0_.get(), service0_.get());
333 event_router()->GattServiceAdded( 335 event_router()->GattServiceAdded(
334 mock_adapter_, device0_.get(), service1_.get()); 336 mock_adapter_, device0_.get(), service1_.get());
335 337
336 // These will send the onServiceAdded event to apps. 338 // These will send the onServiceAdded event to apps.
337 event_router()->GattDiscoveryCompleteForService(mock_adapter_, 339 event_router()->GattDiscoveryCompleteForService(mock_adapter_,
338 service0_.get()); 340 service0_.get());
339 event_router()->GattDiscoveryCompleteForService(mock_adapter_, 341 event_router()->GattDiscoveryCompleteForService(mock_adapter_,
340 service1_.get()); 342 service1_.get());
341 343
342 // This will send the onServiceChanged event to apps. 344 // This will send the onServiceChanged event to apps.
343 event_router()->GattServiceChanged(mock_adapter_, service1_.get()); 345 event_router()->GattServiceChanged(mock_adapter_, service1_.get());
344 346
345 // This will send the onServiceRemoved event to apps. 347 // This will send the onServiceRemoved event to apps.
346 event_router()->GattServiceRemoved( 348 event_router()->GattServiceRemoved(
347 mock_adapter_, device0_.get(), service0_.get()); 349 mock_adapter_, device0_.get(), service0_.get());
348 350
349 EXPECT_TRUE(listener.WaitUntilSatisfied()); 351 EXPECT_TRUE(listener.WaitUntilSatisfied());
352 ASSERT_EQ("ready", listener.message()) << listener.message();
350 listener.Reply("go"); 353 listener.Reply("go");
351 354
352 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 355 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
353 event_router()->GattServiceRemoved( 356 event_router()->GattServiceRemoved(
354 mock_adapter_, device0_.get(), service1_.get()); 357 mock_adapter_, device0_.get(), service1_.get());
355 } 358 }
356 359
357 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, GetRemovedService) { 360 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, GetRemovedService) {
358 ResultCatcher catcher; 361 ResultCatcher catcher;
359 catcher.RestrictToBrowserContext(browser()->profile()); 362 catcher.RestrictToBrowserContext(browser()->profile());
360 363
361 // Load the extension and let it set up. 364 // Load the extension and let it set up.
362 ASSERT_TRUE(LoadExtension( 365 ASSERT_TRUE(LoadExtension(
363 test_data_dir_.AppendASCII("bluetooth_low_energy/get_removed_service"))); 366 test_data_dir_.AppendASCII("bluetooth_low_energy/get_removed_service")));
364 367
365 // 1. getService success. 368 // 1. getService success.
366 EXPECT_CALL(*mock_adapter_, GetDevice(_)) 369 EXPECT_CALL(*mock_adapter_, GetDevice(_))
367 .Times(1) 370 .Times(1)
368 .WillOnce(Return(device0_.get())); 371 .WillOnce(Return(device0_.get()));
369 EXPECT_CALL(*device0_, GetGattService(kTestServiceId0)) 372 EXPECT_CALL(*device0_, GetGattService(kTestServiceId0))
370 .Times(1) 373 .Times(1)
371 .WillOnce(Return(service0_.get())); 374 .WillOnce(Return(service0_.get()));
372 375
373 event_router()->GattServiceAdded( 376 event_router()->GattServiceAdded(
374 mock_adapter_, device0_.get(), service0_.get()); 377 mock_adapter_, device0_.get(), service0_.get());
375 event_router()->GattDiscoveryCompleteForService(mock_adapter_, 378 event_router()->GattDiscoveryCompleteForService(mock_adapter_,
376 service0_.get()); 379 service0_.get());
377 380
378 ExtensionTestMessageListener get_service_success_listener("getServiceSuccess", 381 ExtensionTestMessageListener get_service_success_listener(true);
379 true);
380 EXPECT_TRUE(get_service_success_listener.WaitUntilSatisfied()); 382 EXPECT_TRUE(get_service_success_listener.WaitUntilSatisfied());
383 ASSERT_EQ("getServiceSuccess", get_service_success_listener.message())
384 << get_service_success_listener.message();
381 testing::Mock::VerifyAndClearExpectations(mock_adapter_); 385 testing::Mock::VerifyAndClearExpectations(mock_adapter_);
382 testing::Mock::VerifyAndClearExpectations(device0_.get()); 386 testing::Mock::VerifyAndClearExpectations(device0_.get());
383 387
384 // 2. getService fail. 388 // 2. getService fail.
385 EXPECT_CALL(*mock_adapter_, GetDevice(_)).Times(0); 389 EXPECT_CALL(*mock_adapter_, GetDevice(_)).Times(0);
386 EXPECT_CALL(*device0_, GetGattService(kTestServiceId0)).Times(0); 390 EXPECT_CALL(*device0_, GetGattService(kTestServiceId0)).Times(0);
387 391
388 event_router()->GattServiceRemoved( 392 event_router()->GattServiceRemoved(
389 mock_adapter_, device0_.get(), service0_.get()); 393 mock_adapter_, device0_.get(), service0_.get());
390 394
391 ExtensionTestMessageListener get_service_fail_listener("getServiceFail", 395 ExtensionTestMessageListener get_service_fail_listener(true);
392 true);
393 EXPECT_TRUE(get_service_fail_listener.WaitUntilSatisfied()); 396 EXPECT_TRUE(get_service_fail_listener.WaitUntilSatisfied());
397 ASSERT_EQ("getServiceFail", get_service_fail_listener.message())
398 << get_service_fail_listener.message();
394 testing::Mock::VerifyAndClearExpectations(mock_adapter_); 399 testing::Mock::VerifyAndClearExpectations(mock_adapter_);
395 testing::Mock::VerifyAndClearExpectations(device0_.get()); 400 testing::Mock::VerifyAndClearExpectations(device0_.get());
396 401
397 get_service_fail_listener.Reply("go"); 402 get_service_fail_listener.Reply("go");
398 403
399 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 404 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
400 } 405 }
401 406
402 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, GetIncludedServices) { 407 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, GetIncludedServices) {
403 ResultCatcher catcher; 408 ResultCatcher catcher;
404 catcher.RestrictToBrowserContext(browser()->profile()); 409 catcher.RestrictToBrowserContext(browser()->profile());
405 410
406 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( 411 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
407 "bluetooth_low_energy/get_included_services"))); 412 "bluetooth_low_energy/get_included_services")));
408 413
409 // Wait for initial call to end with failure as there is no mapping. 414 // Wait for initial call to end with failure as there is no mapping.
410 ExtensionTestMessageListener listener("ready", true); 415 ExtensionTestMessageListener listener("ready", true);
416 listener.set_failure_message("fail");
411 EXPECT_TRUE(listener.WaitUntilSatisfied()); 417 EXPECT_TRUE(listener.WaitUntilSatisfied());
412 418
413 // Set up for the rest of the calls before replying. Included services can be 419 // Set up for the rest of the calls before replying. Included services can be
414 // returned even if there is no instance ID mapping for them yet, so no need 420 // returned even if there is no instance ID mapping for them yet, so no need
415 // to call GattServiceAdded for |service1_| here. 421 // to call GattServiceAdded for |service1_| here.
416 event_router()->GattServiceAdded( 422 event_router()->GattServiceAdded(
417 mock_adapter_, device0_.get(), service0_.get()); 423 mock_adapter_, device0_.get(), service0_.get());
418 424
419 std::vector<BluetoothGattService*> includes; 425 std::vector<BluetoothGattService*> includes;
420 includes.push_back(service1_.get()); 426 includes.push_back(service1_.get());
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 .WillOnce(Return(static_cast<BluetoothGattService*>(NULL))) 499 .WillOnce(Return(static_cast<BluetoothGattService*>(NULL)))
494 .WillRepeatedly(Return(service0_.get())); 500 .WillRepeatedly(Return(service0_.get()));
495 501
496 EXPECT_CALL(*service0_, GetCharacteristic(kTestCharacteristicId0)) 502 EXPECT_CALL(*service0_, GetCharacteristic(kTestCharacteristicId0))
497 .Times(2) 503 .Times(2)
498 .WillOnce(Return(static_cast<BluetoothGattCharacteristic*>(NULL))) 504 .WillOnce(Return(static_cast<BluetoothGattCharacteristic*>(NULL)))
499 .WillOnce(Return(chrc0_.get())); 505 .WillOnce(Return(chrc0_.get()));
500 506
501 // Load the extension and wait for first test. 507 // Load the extension and wait for first test.
502 ExtensionTestMessageListener listener("ready", true); 508 ExtensionTestMessageListener listener("ready", true);
509 listener.set_failure_message("fail");
503 ASSERT_TRUE(LoadExtension( 510 ASSERT_TRUE(LoadExtension(
504 test_data_dir_.AppendASCII("bluetooth_low_energy/get_characteristic"))); 511 test_data_dir_.AppendASCII("bluetooth_low_energy/get_characteristic")));
505 EXPECT_TRUE(listener.WaitUntilSatisfied()); 512 EXPECT_TRUE(listener.WaitUntilSatisfied());
506 513
507 listener.Reply("go"); 514 listener.Reply("go");
508 515
509 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 516 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
510 517
511 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); 518 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get());
512 event_router()->GattServiceRemoved( 519 event_router()->GattServiceRemoved(
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 BluetoothGattCharacteristic::kPropertyWriteWithoutResponse | 560 BluetoothGattCharacteristic::kPropertyWriteWithoutResponse |
554 BluetoothGattCharacteristic::kPropertyWrite | 561 BluetoothGattCharacteristic::kPropertyWrite |
555 BluetoothGattCharacteristic::kPropertyNotify | 562 BluetoothGattCharacteristic::kPropertyNotify |
556 BluetoothGattCharacteristic::kPropertyIndicate | 563 BluetoothGattCharacteristic::kPropertyIndicate |
557 BluetoothGattCharacteristic::kPropertyAuthenticatedSignedWrites | 564 BluetoothGattCharacteristic::kPropertyAuthenticatedSignedWrites |
558 BluetoothGattCharacteristic::kPropertyExtendedProperties | 565 BluetoothGattCharacteristic::kPropertyExtendedProperties |
559 BluetoothGattCharacteristic::kPropertyReliableWrite | 566 BluetoothGattCharacteristic::kPropertyReliableWrite |
560 BluetoothGattCharacteristic::kPropertyWritableAuxiliaries)); 567 BluetoothGattCharacteristic::kPropertyWritableAuxiliaries));
561 568
562 ExtensionTestMessageListener listener("ready", true); 569 ExtensionTestMessageListener listener("ready", true);
570 listener.set_failure_message("fail");
563 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( 571 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
564 "bluetooth_low_energy/characteristic_properties"))); 572 "bluetooth_low_energy/characteristic_properties")));
565 EXPECT_TRUE(listener.WaitUntilSatisfied()); 573 EXPECT_TRUE(listener.WaitUntilSatisfied());
566 574
567 listener.Reply("go"); 575 listener.Reply("go");
568 576
569 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 577 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
570 578
571 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); 579 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get());
572 event_router()->GattServiceRemoved( 580 event_router()->GattServiceRemoved(
(...skipping 14 matching lines...) Expand all
587 .Times(1) 595 .Times(1)
588 .WillOnce(Return(chrc0_.get())); 596 .WillOnce(Return(chrc0_.get()));
589 597
590 event_router()->GattServiceAdded( 598 event_router()->GattServiceAdded(
591 mock_adapter_, device0_.get(), service0_.get()); 599 mock_adapter_, device0_.get(), service0_.get());
592 event_router()->GattCharacteristicAdded(mock_adapter_, chrc0_.get()); 600 event_router()->GattCharacteristicAdded(mock_adapter_, chrc0_.get());
593 601
594 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( 602 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
595 "bluetooth_low_energy/get_removed_characteristic"))); 603 "bluetooth_low_energy/get_removed_characteristic")));
596 604
597 ExtensionTestMessageListener listener("ready", true); 605 ExtensionTestMessageListener listener(true);
598 EXPECT_TRUE(listener.WaitUntilSatisfied()); 606 EXPECT_TRUE(listener.WaitUntilSatisfied());
607 ASSERT_EQ("ready", listener.message()) << listener.message();
599 testing::Mock::VerifyAndClearExpectations(mock_adapter_); 608 testing::Mock::VerifyAndClearExpectations(mock_adapter_);
600 testing::Mock::VerifyAndClearExpectations(device0_.get()); 609 testing::Mock::VerifyAndClearExpectations(device0_.get());
601 testing::Mock::VerifyAndClearExpectations(service0_.get()); 610 testing::Mock::VerifyAndClearExpectations(service0_.get());
602 611
603 EXPECT_CALL(*mock_adapter_, GetDevice(_)).Times(0); 612 EXPECT_CALL(*mock_adapter_, GetDevice(_)).Times(0);
604 EXPECT_CALL(*device0_, GetGattService(_)).Times(0); 613 EXPECT_CALL(*device0_, GetGattService(_)).Times(0);
605 EXPECT_CALL(*service0_, GetCharacteristic(_)).Times(0); 614 EXPECT_CALL(*service0_, GetCharacteristic(_)).Times(0);
606 615
607 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); 616 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get());
608 617
609 listener.Reply("go"); 618 listener.Reply("go");
610 listener.Reset(); 619 listener.Reset();
611 EXPECT_TRUE(listener.WaitUntilSatisfied()); 620 EXPECT_TRUE(listener.WaitUntilSatisfied());
621 ASSERT_EQ("ready", listener.message()) << listener.message();
612 622
613 listener.Reply("go"); 623 listener.Reply("go");
614 624
615 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 625 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
616 event_router()->GattServiceRemoved( 626 event_router()->GattServiceRemoved(
617 mock_adapter_, device0_.get(), service0_.get()); 627 mock_adapter_, device0_.get(), service0_.get());
618 } 628 }
619 629
620 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, CharacteristicValueChanged) { 630 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, CharacteristicValueChanged) {
621 ResultCatcher catcher; 631 ResultCatcher catcher;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 .Times(3) 716 .Times(3)
707 .WillRepeatedly(Return(chrc0_.get())); 717 .WillRepeatedly(Return(chrc0_.get()));
708 718
709 std::vector<uint8> value; 719 std::vector<uint8> value;
710 EXPECT_CALL(*chrc0_, ReadRemoteCharacteristic(_, _)) 720 EXPECT_CALL(*chrc0_, ReadRemoteCharacteristic(_, _))
711 .Times(2) 721 .Times(2)
712 .WillOnce(InvokeCallbackArgument<1>()) 722 .WillOnce(InvokeCallbackArgument<1>())
713 .WillOnce(InvokeCallbackArgument<0>(value)); 723 .WillOnce(InvokeCallbackArgument<0>(value));
714 724
715 ExtensionTestMessageListener listener("ready", true); 725 ExtensionTestMessageListener listener("ready", true);
726 listener.set_failure_message("fail");
716 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( 727 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
717 "bluetooth_low_energy/read_characteristic_value"))); 728 "bluetooth_low_energy/read_characteristic_value")));
718 EXPECT_TRUE(listener.WaitUntilSatisfied()); 729 listener.WaitUntilSatisfied();
719 730
720 listener.Reply("go"); 731 listener.Reply("go");
721 732
722 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 733 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
723 734
724 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); 735 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get());
725 event_router()->GattServiceRemoved( 736 event_router()->GattServiceRemoved(
726 mock_adapter_, device0_.get(), service0_.get()); 737 mock_adapter_, device0_.get(), service0_.get());
727 } 738 }
728 739
(...skipping 19 matching lines...) Expand all
748 759
749 std::vector<uint8> write_value; 760 std::vector<uint8> write_value;
750 EXPECT_CALL(*chrc0_, WriteRemoteCharacteristic(_, _, _)) 761 EXPECT_CALL(*chrc0_, WriteRemoteCharacteristic(_, _, _))
751 .Times(2) 762 .Times(2)
752 .WillOnce(InvokeCallbackArgument<2>()) 763 .WillOnce(InvokeCallbackArgument<2>())
753 .WillOnce(DoAll(SaveArg<0>(&write_value), InvokeCallbackArgument<1>())); 764 .WillOnce(DoAll(SaveArg<0>(&write_value), InvokeCallbackArgument<1>()));
754 765
755 EXPECT_CALL(*chrc0_, GetValue()).Times(1).WillOnce(ReturnRef(write_value)); 766 EXPECT_CALL(*chrc0_, GetValue()).Times(1).WillOnce(ReturnRef(write_value));
756 767
757 ExtensionTestMessageListener listener("ready", true); 768 ExtensionTestMessageListener listener("ready", true);
769 listener.set_failure_message("fail");
758 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( 770 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
759 "bluetooth_low_energy/write_characteristic_value"))); 771 "bluetooth_low_energy/write_characteristic_value")));
760 EXPECT_TRUE(listener.WaitUntilSatisfied()); 772 EXPECT_TRUE(listener.WaitUntilSatisfied());
761 773
762 listener.Reply("go"); 774 listener.Reply("go");
763 775
764 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 776 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
765 777
766 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); 778 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get());
767 event_router()->GattServiceRemoved( 779 event_router()->GattServiceRemoved(
(...skipping 21 matching lines...) Expand all
789 EXPECT_CALL(*service0_, GetCharacteristic(kTestCharacteristicId0)) 801 EXPECT_CALL(*service0_, GetCharacteristic(kTestCharacteristicId0))
790 .Times(3) 802 .Times(3)
791 .WillOnce(Return(static_cast<BluetoothGattCharacteristic*>(NULL))) 803 .WillOnce(Return(static_cast<BluetoothGattCharacteristic*>(NULL)))
792 .WillRepeatedly(Return(chrc0_.get())); 804 .WillRepeatedly(Return(chrc0_.get()));
793 EXPECT_CALL(*chrc0_, GetDescriptors()) 805 EXPECT_CALL(*chrc0_, GetDescriptors())
794 .Times(2) 806 .Times(2)
795 .WillOnce(Return(std::vector<BluetoothGattDescriptor*>())) 807 .WillOnce(Return(std::vector<BluetoothGattDescriptor*>()))
796 .WillOnce(Return(descriptors)); 808 .WillOnce(Return(descriptors));
797 809
798 ExtensionTestMessageListener listener("ready", true); 810 ExtensionTestMessageListener listener("ready", true);
811 listener.set_failure_message("fail");
799 ASSERT_TRUE(LoadExtension( 812 ASSERT_TRUE(LoadExtension(
800 test_data_dir_.AppendASCII("bluetooth_low_energy/get_descriptors"))); 813 test_data_dir_.AppendASCII("bluetooth_low_energy/get_descriptors")));
801 EXPECT_TRUE(listener.WaitUntilSatisfied()); 814 EXPECT_TRUE(listener.WaitUntilSatisfied());
802 815
803 listener.Reply("go"); 816 listener.Reply("go");
804 817
805 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 818 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
806 819
807 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); 820 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get());
808 event_router()->GattServiceRemoved( 821 event_router()->GattServiceRemoved(
(...skipping 24 matching lines...) Expand all
833 .WillOnce(Return(static_cast<BluetoothGattCharacteristic*>(NULL))) 846 .WillOnce(Return(static_cast<BluetoothGattCharacteristic*>(NULL)))
834 .WillRepeatedly(Return(chrc0_.get())); 847 .WillRepeatedly(Return(chrc0_.get()));
835 848
836 EXPECT_CALL(*chrc0_, GetDescriptor(kTestDescriptorId0)) 849 EXPECT_CALL(*chrc0_, GetDescriptor(kTestDescriptorId0))
837 .Times(2) 850 .Times(2)
838 .WillOnce(Return(static_cast<BluetoothGattDescriptor*>(NULL))) 851 .WillOnce(Return(static_cast<BluetoothGattDescriptor*>(NULL)))
839 .WillOnce(Return(desc0_.get())); 852 .WillOnce(Return(desc0_.get()));
840 853
841 // Load the extension and wait for first test. 854 // Load the extension and wait for first test.
842 ExtensionTestMessageListener listener("ready", true); 855 ExtensionTestMessageListener listener("ready", true);
856 listener.set_failure_message("fail");
843 ASSERT_TRUE(LoadExtension( 857 ASSERT_TRUE(LoadExtension(
844 test_data_dir_.AppendASCII("bluetooth_low_energy/get_descriptor"))); 858 test_data_dir_.AppendASCII("bluetooth_low_energy/get_descriptor")));
845 EXPECT_TRUE(listener.WaitUntilSatisfied()); 859 EXPECT_TRUE(listener.WaitUntilSatisfied());
846 860
847 listener.Reply("go"); 861 listener.Reply("go");
848 862
849 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 863 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
850 864
851 event_router()->GattDescriptorRemoved(mock_adapter_, desc0_.get()); 865 event_router()->GattDescriptorRemoved(mock_adapter_, desc0_.get());
852 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); 866 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get());
(...skipping 19 matching lines...) Expand all
872 .WillOnce(Return(desc0_.get())); 886 .WillOnce(Return(desc0_.get()));
873 887
874 event_router()->GattServiceAdded( 888 event_router()->GattServiceAdded(
875 mock_adapter_, device0_.get(), service0_.get()); 889 mock_adapter_, device0_.get(), service0_.get());
876 event_router()->GattCharacteristicAdded(mock_adapter_, chrc0_.get()); 890 event_router()->GattCharacteristicAdded(mock_adapter_, chrc0_.get());
877 event_router()->GattDescriptorAdded(mock_adapter_, desc0_.get()); 891 event_router()->GattDescriptorAdded(mock_adapter_, desc0_.get());
878 892
879 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( 893 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
880 "bluetooth_low_energy/get_removed_descriptor"))); 894 "bluetooth_low_energy/get_removed_descriptor")));
881 895
882 ExtensionTestMessageListener listener("ready", true); 896 ExtensionTestMessageListener listener(true);
883 EXPECT_TRUE(listener.WaitUntilSatisfied()); 897 EXPECT_TRUE(listener.WaitUntilSatisfied());
898 ASSERT_EQ("ready", listener.message()) << listener.message();
884 testing::Mock::VerifyAndClearExpectations(mock_adapter_); 899 testing::Mock::VerifyAndClearExpectations(mock_adapter_);
885 testing::Mock::VerifyAndClearExpectations(device0_.get()); 900 testing::Mock::VerifyAndClearExpectations(device0_.get());
886 testing::Mock::VerifyAndClearExpectations(service0_.get()); 901 testing::Mock::VerifyAndClearExpectations(service0_.get());
887 testing::Mock::VerifyAndClearExpectations(chrc0_.get()); 902 testing::Mock::VerifyAndClearExpectations(chrc0_.get());
888 903
889 EXPECT_CALL(*mock_adapter_, GetDevice(_)).Times(0); 904 EXPECT_CALL(*mock_adapter_, GetDevice(_)).Times(0);
890 EXPECT_CALL(*device0_, GetGattService(_)).Times(0); 905 EXPECT_CALL(*device0_, GetGattService(_)).Times(0);
891 EXPECT_CALL(*service0_, GetCharacteristic(_)).Times(0); 906 EXPECT_CALL(*service0_, GetCharacteristic(_)).Times(0);
892 EXPECT_CALL(*chrc0_, GetDescriptor(_)).Times(0); 907 EXPECT_CALL(*chrc0_, GetDescriptor(_)).Times(0);
893 908
894 event_router()->GattDescriptorRemoved(mock_adapter_, desc0_.get()); 909 event_router()->GattDescriptorRemoved(mock_adapter_, desc0_.get());
895 910
896 listener.Reply("go"); 911 listener.Reply("go");
897 listener.Reset(); 912 listener.Reset();
898 EXPECT_TRUE(listener.WaitUntilSatisfied()); 913 EXPECT_TRUE(listener.WaitUntilSatisfied());
914 ASSERT_EQ("ready", listener.message()) << listener.message();
899 915
900 listener.Reply("go"); 916 listener.Reply("go");
901 917
902 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 918 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
903 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); 919 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get());
904 event_router()->GattServiceRemoved( 920 event_router()->GattServiceRemoved(
905 mock_adapter_, device0_.get(), service0_.get()); 921 mock_adapter_, device0_.get(), service0_.get());
906 } 922 }
907 923
908 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, DescriptorValueChanged) { 924 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, DescriptorValueChanged) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 .Times(3) 979 .Times(3)
964 .WillRepeatedly(Return(desc0_.get())); 980 .WillRepeatedly(Return(desc0_.get()));
965 981
966 std::vector<uint8> value; 982 std::vector<uint8> value;
967 EXPECT_CALL(*desc0_, ReadRemoteDescriptor(_, _)) 983 EXPECT_CALL(*desc0_, ReadRemoteDescriptor(_, _))
968 .Times(2) 984 .Times(2)
969 .WillOnce(InvokeCallbackArgument<1>()) 985 .WillOnce(InvokeCallbackArgument<1>())
970 .WillOnce(InvokeCallbackArgument<0>(value)); 986 .WillOnce(InvokeCallbackArgument<0>(value));
971 987
972 ExtensionTestMessageListener listener("ready", true); 988 ExtensionTestMessageListener listener("ready", true);
989 listener.set_failure_message("fail");
973 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( 990 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
974 "bluetooth_low_energy/read_descriptor_value"))); 991 "bluetooth_low_energy/read_descriptor_value")));
975 EXPECT_TRUE(listener.WaitUntilSatisfied()); 992 EXPECT_TRUE(listener.WaitUntilSatisfied());
976 993
977 listener.Reply("go"); 994 listener.Reply("go");
978 995
979 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 996 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
980 997
981 event_router()->GattDescriptorRemoved(mock_adapter_, desc0_.get()); 998 event_router()->GattDescriptorRemoved(mock_adapter_, desc0_.get());
982 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); 999 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get());
(...skipping 28 matching lines...) Expand all
1011 1028
1012 std::vector<uint8> write_value; 1029 std::vector<uint8> write_value;
1013 EXPECT_CALL(*desc0_, WriteRemoteDescriptor(_, _, _)) 1030 EXPECT_CALL(*desc0_, WriteRemoteDescriptor(_, _, _))
1014 .Times(2) 1031 .Times(2)
1015 .WillOnce(InvokeCallbackArgument<2>()) 1032 .WillOnce(InvokeCallbackArgument<2>())
1016 .WillOnce(DoAll(SaveArg<0>(&write_value), InvokeCallbackArgument<1>())); 1033 .WillOnce(DoAll(SaveArg<0>(&write_value), InvokeCallbackArgument<1>()));
1017 1034
1018 EXPECT_CALL(*desc0_, GetValue()).Times(1).WillOnce(ReturnRef(write_value)); 1035 EXPECT_CALL(*desc0_, GetValue()).Times(1).WillOnce(ReturnRef(write_value));
1019 1036
1020 ExtensionTestMessageListener listener("ready", true); 1037 ExtensionTestMessageListener listener("ready", true);
1038 listener.set_failure_message("fail");
1021 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( 1039 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
1022 "bluetooth_low_energy/write_descriptor_value"))); 1040 "bluetooth_low_energy/write_descriptor_value")));
1023 EXPECT_TRUE(listener.WaitUntilSatisfied()); 1041 EXPECT_TRUE(listener.WaitUntilSatisfied());
1024 1042
1025 listener.Reply("go"); 1043 listener.Reply("go");
1026 1044
1027 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 1045 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
1028 1046
1029 event_router()->GattDescriptorRemoved(mock_adapter_, desc0_.get()); 1047 event_router()->GattDescriptorRemoved(mock_adapter_, desc0_.get());
1030 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); 1048 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get());
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 event_router()->GattDescriptorRemoved(mock_adapter_, desc0_.get()); 1088 event_router()->GattDescriptorRemoved(mock_adapter_, desc0_.get());
1071 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); 1089 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get());
1072 event_router()->GattServiceRemoved( 1090 event_router()->GattServiceRemoved(
1073 mock_adapter_, device0_.get(), service0_.get()); 1091 mock_adapter_, device0_.get(), service0_.get());
1074 } 1092 }
1075 1093
1076 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, UuidPermissionEvents) { 1094 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, UuidPermissionEvents) {
1077 ResultCatcher catcher; 1095 ResultCatcher catcher;
1078 catcher.RestrictToBrowserContext(browser()->profile()); 1096 catcher.RestrictToBrowserContext(browser()->profile());
1079 1097
1080 ExtensionTestMessageListener listener("ready", true); 1098 ExtensionTestMessageListener listener(true);
1081 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( 1099 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
1082 "bluetooth_low_energy/uuid_permission_events"))); 1100 "bluetooth_low_energy/uuid_permission_events")));
1083 1101
1084 // Cause events to be sent to the extension. 1102 // Cause events to be sent to the extension.
1085 event_router()->GattServiceAdded( 1103 event_router()->GattServiceAdded(
1086 mock_adapter_, device0_.get(), service0_.get()); 1104 mock_adapter_, device0_.get(), service0_.get());
1087 event_router()->GattCharacteristicAdded(mock_adapter_, chrc0_.get()); 1105 event_router()->GattCharacteristicAdded(mock_adapter_, chrc0_.get());
1088 event_router()->GattDescriptorAdded(mock_adapter_, desc0_.get()); 1106 event_router()->GattDescriptorAdded(mock_adapter_, desc0_.get());
1089 1107
1090 std::vector<uint8> value; 1108 std::vector<uint8> value;
1091 event_router()->GattCharacteristicValueChanged( 1109 event_router()->GattCharacteristicValueChanged(
1092 mock_adapter_, chrc0_.get(), value); 1110 mock_adapter_, chrc0_.get(), value);
1093 event_router()->GattDescriptorValueChanged( 1111 event_router()->GattDescriptorValueChanged(
1094 mock_adapter_, desc0_.get(), value); 1112 mock_adapter_, desc0_.get(), value);
1095 event_router()->GattServiceChanged(mock_adapter_, service0_.get()); 1113 event_router()->GattServiceChanged(mock_adapter_, service0_.get());
1096 1114
1097 EXPECT_TRUE(listener.WaitUntilSatisfied()); 1115 EXPECT_TRUE(listener.WaitUntilSatisfied());
1098 listener.Reply("go"); 1116 listener.Reply("go");
1099 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 1117 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
1118 ASSERT_EQ("ready", listener.message()) << listener.message();
1100 1119
1101 event_router()->GattDescriptorRemoved(mock_adapter_, desc0_.get()); 1120 event_router()->GattDescriptorRemoved(mock_adapter_, desc0_.get());
1102 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); 1121 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get());
1103 event_router()->GattServiceRemoved( 1122 event_router()->GattServiceRemoved(
1104 mock_adapter_, device0_.get(), service0_.get()); 1123 mock_adapter_, device0_.get(), service0_.get());
1105 } 1124 }
1106 1125
1107 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, GattConnection) { 1126 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, GattConnection) {
1108 ResultCatcher catcher; 1127 ResultCatcher catcher;
1109 catcher.RestrictToBrowserContext(browser()->profile()); 1128 catcher.RestrictToBrowserContext(browser()->profile());
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 kTestLeDeviceAddress0); 1196 kTestLeDeviceAddress0);
1178 scoped_ptr<BluetoothGattConnection> conn_ptr(conn); 1197 scoped_ptr<BluetoothGattConnection> conn_ptr(conn);
1179 EXPECT_CALL(*conn, Disconnect(_)) 1198 EXPECT_CALL(*conn, Disconnect(_))
1180 .Times(1) 1199 .Times(1)
1181 .WillOnce(SaveArg<0>(&disconnect_callback)); 1200 .WillOnce(SaveArg<0>(&disconnect_callback));
1182 1201
1183 EXPECT_CALL(*device0_, CreateGattConnection(_, _)) 1202 EXPECT_CALL(*device0_, CreateGattConnection(_, _))
1184 .Times(1) 1203 .Times(1)
1185 .WillOnce(SaveArg<0>(&connect_callback)); 1204 .WillOnce(SaveArg<0>(&connect_callback));
1186 1205
1187 ExtensionTestMessageListener listener("ready", true); 1206 ExtensionTestMessageListener listener(true);
1188 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( 1207 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
1189 "bluetooth_low_energy/connect_in_progress"))); 1208 "bluetooth_low_energy/connect_in_progress")));
1190 1209
1191 listener.WaitUntilSatisfied(); 1210 EXPECT_TRUE(listener.WaitUntilSatisfied());
1211 ASSERT_EQ("ready", listener.message()) << listener.message();
1192 connect_callback.Run(conn_ptr.Pass()); 1212 connect_callback.Run(conn_ptr.Pass());
1193 1213
1194 listener.Reset(); 1214 listener.Reset();
1195 listener.WaitUntilSatisfied(); 1215 EXPECT_TRUE(listener.WaitUntilSatisfied());
1216 ASSERT_EQ("ready", listener.message()) << listener.message();
1196 disconnect_callback.Run(); 1217 disconnect_callback.Run();
1197 1218
1198 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 1219 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
1199 } 1220 }
1200 1221
1201 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, StartStopNotifications) { 1222 IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, StartStopNotifications) {
1202 ResultCatcher catcher; 1223 ResultCatcher catcher;
1203 catcher.RestrictToBrowserContext(browser()->profile()); 1224 catcher.RestrictToBrowserContext(browser()->profile());
1204 1225
1205 event_router()->GattServiceAdded( 1226 event_router()->GattServiceAdded(
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 .WillOnce( 1264 .WillOnce(
1244 InvokeCallbackWithScopedPtrArg<0, BluetoothGattNotifySession>( 1265 InvokeCallbackWithScopedPtrArg<0, BluetoothGattNotifySession>(
1245 session0)); 1266 session0));
1246 EXPECT_CALL(*chrc1_, StartNotifySession(_, _)) 1267 EXPECT_CALL(*chrc1_, StartNotifySession(_, _))
1247 .Times(1) 1268 .Times(1)
1248 .WillOnce( 1269 .WillOnce(
1249 InvokeCallbackWithScopedPtrArg<0, BluetoothGattNotifySession>( 1270 InvokeCallbackWithScopedPtrArg<0, BluetoothGattNotifySession>(
1250 session1)); 1271 session1));
1251 1272
1252 ExtensionTestMessageListener listener("ready", true); 1273 ExtensionTestMessageListener listener("ready", true);
1274 listener.set_failure_message("fail");
1253 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( 1275 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
1254 "bluetooth_low_energy/start_stop_notifications"))); 1276 "bluetooth_low_energy/start_stop_notifications")));
1255 1277
1256 EXPECT_TRUE(listener.WaitUntilSatisfied()); 1278 EXPECT_TRUE(listener.WaitUntilSatisfied());
1257 1279
1258 std::vector<uint8> value; 1280 std::vector<uint8> value;
1259 event_router()->GattCharacteristicValueChanged( 1281 event_router()->GattCharacteristicValueChanged(
1260 mock_adapter_, chrc0_.get(), value); 1282 mock_adapter_, chrc0_.get(), value);
1261 event_router()->GattCharacteristicValueChanged( 1283 event_router()->GattCharacteristicValueChanged(
1262 mock_adapter_, chrc1_.get(), value); 1284 mock_adapter_, chrc1_.get(), value);
1263 event_router()->GattCharacteristicValueChanged( 1285 event_router()->GattCharacteristicValueChanged(
1264 mock_adapter_, chrc2_.get(), value); 1286 mock_adapter_, chrc2_.get(), value);
1265 1287
1266 listener.Reply("go"); 1288 listener.Reply("go");
1267 1289
1268 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 1290 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
1269 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc2_.get()); 1291 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc2_.get());
1270 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc1_.get()); 1292 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc1_.get());
1271 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); 1293 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get());
1272 event_router()->GattServiceRemoved( 1294 event_router()->GattServiceRemoved(
1273 mock_adapter_, device0_.get(), service1_.get()); 1295 mock_adapter_, device0_.get(), service1_.get());
1274 event_router()->GattServiceRemoved( 1296 event_router()->GattServiceRemoved(
1275 mock_adapter_, device0_.get(), service0_.get()); 1297 mock_adapter_, device0_.get(), service0_.get());
1276 } 1298 }
1277 1299
1278 } // namespace 1300 } // namespace
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/bluetooth_low_energy/write_descriptor_value/runtest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698