 Chromium Code Reviews
 Chromium Code Reviews Issue 1382743002:
  bluetooth: Add characteristicvaluechanged event  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-notifications-1
    
  
    Issue 1382743002:
  bluetooth: Add characteristicvaluechanged event  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-notifications-1| Index: device/bluetooth/test/mock_bluetooth_gatt_notify_session.cc | 
| diff --git a/device/bluetooth/test/mock_bluetooth_gatt_notify_session.cc b/device/bluetooth/test/mock_bluetooth_gatt_notify_session.cc | 
| index a4e9843621d11920d47cab102d95ccabbb5c48e5..068be3a9b82b41dc4505346dd4078fd980895a46 100644 | 
| --- a/device/bluetooth/test/mock_bluetooth_gatt_notify_session.cc | 
| +++ b/device/bluetooth/test/mock_bluetooth_gatt_notify_session.cc | 
| @@ -3,6 +3,8 @@ | 
| // found in the LICENSE file. | 
| #include "device/bluetooth/test/mock_bluetooth_gatt_notify_session.h" | 
| +#include "device/bluetooth/test/mock_bluetooth_adapter.h" | 
| +#include "device/bluetooth/test/mock_bluetooth_gatt_characteristic.h" | 
| using testing::Return; | 
| @@ -18,4 +20,30 @@ MockBluetoothGattNotifySession::MockBluetoothGattNotifySession( | 
| MockBluetoothGattNotifySession::~MockBluetoothGattNotifySession() { | 
| } | 
| +void MockBluetoothGattNotifySession::StartTestNotifications( | 
| + MockBluetoothAdapter* adapter, | 
| + MockBluetoothGattCharacteristic* characteristic, | 
| + const std::vector<uint8_t>& value) { | 
| + test_notifications_timer_.Start( | 
| + FROM_HERE, base::TimeDelta::FromMilliseconds(10), | 
| + base::Bind(&MockBluetoothGattNotifySession::TestNotify, | 
| + // base::Timer guarantees it won't call back after its | 
| + // destructor starts. | 
| + base::Unretained(this), base::Unretained(adapter), | 
| + characteristic, value)); | 
| +} | 
| + | 
| +void MockBluetoothGattNotifySession::StopTestNotifications() { | 
| + test_notifications_timer_.Stop(); | 
| +} | 
| + | 
| +void MockBluetoothGattNotifySession::TestNotify( | 
| 
Jeffrey Yasskin
2015/10/15 23:00:51
Maybe "DoNotify" since this actually notifies the
 
ortuno
2015/10/16 01:24:21
Done.
 | 
| + MockBluetoothAdapter* adapter, | 
| + MockBluetoothGattCharacteristic* characteristic, | 
| + const std::vector<uint8_t>& value) { | 
| + FOR_EACH_OBSERVER( | 
| + BluetoothAdapter::Observer, adapter->GetObservers(), | 
| + GattCharacteristicValueChanged(adapter, characteristic, value)); | 
| +} | 
| + | 
| } // namespace device |