Index: components/arc/bluetooth/arc_bluetooth_bridge.h |
diff --git a/components/arc/bluetooth/arc_bluetooth_bridge.h b/components/arc/bluetooth/arc_bluetooth_bridge.h |
index 81b120bc7aece4febf1f54ba903c71d3d5daaf1c..d2396456ab32243548d56f655395374a368c4ff8 100644 |
--- a/components/arc/bluetooth/arc_bluetooth_bridge.h |
+++ b/components/arc/bluetooth/arc_bluetooth_bridge.h |
@@ -36,6 +36,7 @@ class ArcBluetoothBridge |
public mojom::BluetoothHost { |
public: |
explicit ArcBluetoothBridge(ArcBridgeService* bridge_service); |
+ ArcBluetoothBridge(ArcBridgeService* bridge_service, bool test_flag); |
~ArcBluetoothBridge() override; |
// Overridden from ArcBridgeService::Observer: |
@@ -251,6 +252,20 @@ class ArcBluetoothBridge |
void OnGattNotifyStopDone( |
const DeregisterForGattNotificationCallback& callback) const; |
+ // Exposed for testing. |
+ void SetAdapterForTest(device::BluetoothAdapter* adapter) { |
rkc
2016/06/19 18:45:43
None of these are required.
Adding "SetXXXForTesti
|
+ bluetooth_adapter_ = adapter; |
+ } |
+ |
+ void SetBluetoothInstanceForTest( |
+ mojom::BluetoothInstance* bluetooth_instance) { |
+ bluetooth_instance_ = base::WrapUnique(bluetooth_instance); |
+ } |
+ |
+ void SetBluetoothVersionForTest(int32_t bluetooth_version) { |
+ bluetooth_version_ = bluetooth_version; |
+ } |
+ |
private: |
mojo::Array<mojom::BluetoothPropertyPtr> GetDeviceProperties( |
mojom::BluetoothPropertyType type, |
@@ -283,6 +298,8 @@ class ArcBluetoothBridge |
mojo::Binding<mojom::BluetoothHost> binding_; |
scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_; |
+ std::unique_ptr<mojom::BluetoothInstance> bluetooth_instance_; |
+ int32_t bluetooth_version_; |
scoped_refptr<device::BluetoothAdvertisement> advertisment_; |
std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_; |
std::map<std::string, std::unique_ptr<device::BluetoothGattNotifySession>> |