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

Unified Diff: components/arc/bluetooth/arc_bluetooth_bridge.h

Issue 2046283003: Add unit test for ArcBluetoothBridge and TypeConverter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt
Patch Set: rebase Created 4 years, 6 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: 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>>

Powered by Google App Engine
This is Rietveld 408576698