OLD | NEW |
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/api/bluetooth_low_energy/bluetooth_low_energ
y_api.h" | 6 #include "chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energ
y_api.h" |
7 #include "chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energ
y_event_router.h" | 7 #include "chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energ
y_event_router.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/extensions/extension_function_test_utils.h" | 9 #include "chrome/browser/extensions/extension_function_test_utils.h" |
10 #include "chrome/browser/extensions/extension_test_message_listener.h" | 10 #include "chrome/browser/extensions/extension_test_message_listener.h" |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 Return(BluetoothGattCharacteristic::kPropertyWriteWithoutResponse)) | 498 Return(BluetoothGattCharacteristic::kPropertyWriteWithoutResponse)) |
499 .WillOnce(Return(BluetoothGattCharacteristic::kPropertyWrite)) | 499 .WillOnce(Return(BluetoothGattCharacteristic::kPropertyWrite)) |
500 .WillOnce(Return(BluetoothGattCharacteristic::kPropertyNotify)) | 500 .WillOnce(Return(BluetoothGattCharacteristic::kPropertyNotify)) |
501 .WillOnce(Return(BluetoothGattCharacteristic::kPropertyIndicate)) | 501 .WillOnce(Return(BluetoothGattCharacteristic::kPropertyIndicate)) |
502 .WillOnce(Return( | 502 .WillOnce(Return( |
503 BluetoothGattCharacteristic::kPropertyAuthenticatedSignedWrites)) | 503 BluetoothGattCharacteristic::kPropertyAuthenticatedSignedWrites)) |
504 .WillOnce( | 504 .WillOnce( |
505 Return(BluetoothGattCharacteristic::kPropertyExtendedProperties)) | 505 Return(BluetoothGattCharacteristic::kPropertyExtendedProperties)) |
506 .WillOnce(Return(BluetoothGattCharacteristic::kPropertyReliableWrite)) | 506 .WillOnce(Return(BluetoothGattCharacteristic::kPropertyReliableWrite)) |
507 .WillOnce( | 507 .WillOnce( |
508 Return(BluetoothGattCharacteristic::kPropertyWriteableAuxiliaries)) | 508 Return(BluetoothGattCharacteristic::kPropertyWritableAuxiliaries)) |
509 .WillOnce(Return( | 509 .WillOnce(Return( |
510 BluetoothGattCharacteristic::kPropertyBroadcast | | 510 BluetoothGattCharacteristic::kPropertyBroadcast | |
511 BluetoothGattCharacteristic::kPropertyRead | | 511 BluetoothGattCharacteristic::kPropertyRead | |
512 BluetoothGattCharacteristic::kPropertyWriteWithoutResponse | | 512 BluetoothGattCharacteristic::kPropertyWriteWithoutResponse | |
513 BluetoothGattCharacteristic::kPropertyWrite | | 513 BluetoothGattCharacteristic::kPropertyWrite | |
514 BluetoothGattCharacteristic::kPropertyNotify | | 514 BluetoothGattCharacteristic::kPropertyNotify | |
515 BluetoothGattCharacteristic::kPropertyIndicate | | 515 BluetoothGattCharacteristic::kPropertyIndicate | |
516 BluetoothGattCharacteristic::kPropertyAuthenticatedSignedWrites | | 516 BluetoothGattCharacteristic::kPropertyAuthenticatedSignedWrites | |
517 BluetoothGattCharacteristic::kPropertyExtendedProperties | | 517 BluetoothGattCharacteristic::kPropertyExtendedProperties | |
518 BluetoothGattCharacteristic::kPropertyReliableWrite | | 518 BluetoothGattCharacteristic::kPropertyReliableWrite | |
519 BluetoothGattCharacteristic::kPropertyWriteableAuxiliaries)); | 519 BluetoothGattCharacteristic::kPropertyWritableAuxiliaries)); |
520 | 520 |
521 ExtensionTestMessageListener listener("ready", true); | 521 ExtensionTestMessageListener listener("ready", true); |
522 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( | 522 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( |
523 "bluetooth_low_energy/characteristic_properties"))); | 523 "bluetooth_low_energy/characteristic_properties"))); |
524 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 524 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
525 | 525 |
526 listener.Reply("go"); | 526 listener.Reply("go"); |
527 | 527 |
528 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 528 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
529 | 529 |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 | 946 |
947 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 947 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
948 | 948 |
949 event_router()->GattDescriptorRemoved(chrc0_.get(), desc0_.get()); | 949 event_router()->GattDescriptorRemoved(chrc0_.get(), desc0_.get()); |
950 event_router()->GattCharacteristicRemoved(service0_.get(), chrc0_.get()); | 950 event_router()->GattCharacteristicRemoved(service0_.get(), chrc0_.get()); |
951 event_router()->GattServiceRemoved(device_.get(), service0_.get()); | 951 event_router()->GattServiceRemoved(device_.get(), service0_.get()); |
952 event_router()->DeviceRemoved(mock_adapter_, device_.get()); | 952 event_router()->DeviceRemoved(mock_adapter_, device_.get()); |
953 } | 953 } |
954 | 954 |
955 } // namespace | 955 } // namespace |
OLD | NEW |