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

Unified Diff: device/bluetooth/test/bluetooth_test_mac.mm

Issue 2695573002: Adding BluetoothTestBase::CheckNotifySessionValue() method (Closed)
Patch Set: Should work Created 3 years, 10 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
« no previous file with comments | « device/bluetooth/test/bluetooth_test_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/test/bluetooth_test_mac.mm
diff --git a/device/bluetooth/test/bluetooth_test_mac.mm b/device/bluetooth/test/bluetooth_test_mac.mm
index eb4bf905e330bb81166f50a4af60aa57b42aeeff..41b5748f1050c3bbc12e3a893f0c0867a43b604a 100644
--- a/device/bluetooth/test/bluetooth_test_mac.mm
+++ b/device/bluetooth/test/bluetooth_test_mac.mm
@@ -133,6 +133,11 @@ void BluetoothTestMac::InitWithFakeAdapter() {
}
}
+void BluetoothTestMac::ResetEventCounts() {
+ BluetoothTestBase::ResetEventCounts();
+ last_notify_value_ = false;
+}
+
BluetoothDevice* BluetoothTestMac::SimulateLowEnergyDevice(int device_ordinal) {
TestBluetoothAdapterObserver observer(adapter_);
CBCentralManager* central_manager = adapter_mac_->low_energy_central_manager_;
@@ -465,6 +470,23 @@ void BluetoothTestMac::SimulateGattCharacteristicRemoved(
[peripheral_mock mockDidDiscoverEvents];
}
+void BluetoothTestMac::ExpectedChangeNotifyValueAttempts(int attempts) {
+ EXPECT_EQ(attempts, gatt_notify_characteristic_attempts_);
+}
+
+void BluetoothTestMac::ExpectedNotifyValue(
+ NotifyValueState expected_value_state) {
+ switch (expected_value_state) {
+ case NotifyValueState::NONE:
+ EXPECT_FALSE(last_notify_value_);
+ break;
+ case NotifyValueState::NOTIFY:
+ case NotifyValueState::INDICATE:
+ EXPECT_TRUE(last_notify_value_);
+ break;
+ }
+}
+
void BluetoothTestMac::OnFakeBluetoothDeviceConnectGattCalled() {
gatt_connection_attempts_++;
}
@@ -489,7 +511,7 @@ void BluetoothTest::OnFakeBluetoothCharacteristicWriteValue(
void BluetoothTest::OnFakeBluetoothGattSetCharacteristicNotification(
bool notify_value) {
- last_notify_value = notify_value;
+ last_notify_value_ = notify_value;
gatt_notify_characteristic_attempts_++;
}
« no previous file with comments | « device/bluetooth/test/bluetooth_test_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698