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

Unified Diff: extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc

Issue 628983003: New error strings for chrome.bluetoothLowEnergy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add readDescriptorValue errors/tests 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc
diff --git a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc
index 18a82134999cf340e42074395be474a2e0fb9541..ef131ebcde9773a9b57ca4cd8e16198c58835956 100644
--- a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc
+++ b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc
@@ -966,26 +966,38 @@ IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, ReadDescriptorValue) {
event_router()->GattDescriptorAdded(mock_adapter_, desc0_.get());
EXPECT_CALL(*mock_adapter_, GetDevice(_))
- .Times(3)
+ .Times(9)
.WillRepeatedly(Return(device0_.get()));
EXPECT_CALL(*device0_, GetGattService(kTestServiceId0))
- .Times(3)
+ .Times(9)
.WillRepeatedly(Return(service0_.get()));
EXPECT_CALL(*service0_, GetCharacteristic(kTestCharacteristicId0))
- .Times(3)
+ .Times(9)
.WillRepeatedly(Return(chrc0_.get()));
EXPECT_CALL(*chrc0_, GetDescriptor(kTestDescriptorId0))
- .Times(3)
+ .Times(9)
.WillRepeatedly(Return(desc0_.get()));
std::vector<uint8> value;
EXPECT_CALL(*desc0_, ReadRemoteDescriptor(_, _))
- .Times(2)
+ .Times(8)
.WillOnce(InvokeCallbackArgument<1>(
BluetoothGattService::GattErrorCode::GATT_ERROR_FAILED))
+ .WillOnce(InvokeCallbackArgument<1>(
+ BluetoothGattService::GattErrorCode::GATT_ERROR_INVALID_LENGTH))
armansito 2014/10/13 18:51:37 nit: I would ditch the "GattErrorCode::" in betwee
Marie Janssen 2014/10/13 21:22:49 Done.
+ .WillOnce(InvokeCallbackArgument<1>(
+ BluetoothGattService::GattErrorCode::GATT_ERROR_NOT_PERMITTED))
+ .WillOnce(InvokeCallbackArgument<1>(
+ BluetoothGattService::GattErrorCode::GATT_ERROR_NOT_AUTHORIZED))
+ .WillOnce(InvokeCallbackArgument<1>(
+ BluetoothGattService::GattErrorCode::GATT_ERROR_NOT_PAIRED))
+ .WillOnce(InvokeCallbackArgument<1>(
+ BluetoothGattService::GattErrorCode::GATT_ERROR_NOT_SUPPORTED))
+ .WillOnce(InvokeCallbackArgument<1>(
+ BluetoothGattService::GattErrorCode::GATT_ERROR_IN_PROGRESS))
.WillOnce(InvokeCallbackArgument<0>(value));
ExtensionTestMessageListener listener("ready", true);
@@ -1138,8 +1150,15 @@ IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTest, GattConnection) {
EXPECT_CALL(*mock_adapter_, GetDevice(kTestLeDeviceAddress1))
.WillRepeatedly(Return(device1_.get()));
EXPECT_CALL(*device0_, CreateGattConnection(_, _))
- .Times(3)
+ .Times(9)
.WillOnce(InvokeCallbackArgument<1>(BluetoothDevice::ERROR_FAILED))
+ .WillOnce(InvokeCallbackArgument<1>(BluetoothDevice::ERROR_INPROGRESS))
+ .WillOnce(InvokeCallbackArgument<1>(BluetoothDevice::ERROR_AUTH_FAILED))
+ .WillOnce(InvokeCallbackArgument<1>(BluetoothDevice::ERROR_AUTH_REJECTED))
+ .WillOnce(InvokeCallbackArgument<1>(BluetoothDevice::ERROR_AUTH_CANCELED))
+ .WillOnce(InvokeCallbackArgument<1>(BluetoothDevice::ERROR_AUTH_TIMEOUT))
+ .WillOnce(
+ InvokeCallbackArgument<1>(BluetoothDevice::ERROR_UNSUPPORTED_DEVICE))
.WillOnce(InvokeCallbackWithScopedPtrArg<0, BluetoothGattConnection>(
CreateGattConnection(kTestLeDeviceAddress0,
true /* expect_disconnect */)))

Powered by Google App Engine
This is Rietveld 408576698