Index: device/bluetooth/test/bluetooth_test_win.cc |
diff --git a/device/bluetooth/test/bluetooth_test_win.cc b/device/bluetooth/test/bluetooth_test_win.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..fc6275359fed0e4be9b6ae1235a399c342942d54 |
--- /dev/null |
+++ b/device/bluetooth/test/bluetooth_test_win.cc |
@@ -0,0 +1,57 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "device/bluetooth/test/bluetooth_test_win.h" |
+ |
+#include "base/bind.h" |
+#include "device/bluetooth/bluetooth_adapter_win.h" |
+#include "device/bluetooth/bluetooth_low_energy_win.h" |
+ |
+namespace device { |
+ |
+void BluetoothTestWin::SetUp() {} |
scheib
2016/01/26 05:29:26
Remove Setup & TearDown if unneeded.
gogerald1
2016/01/26 19:33:26
The reason I override these interfaces is to expli
|
+void BluetoothTestWin::TearDown() {} |
+ |
+BluetoothTestWin::BluetoothTestWin() |
+ : ui_task_runner_(new base::TestSimpleTaskRunner()), |
+ bluetooth_task_runner_(new base::TestSimpleTaskRunner()) {} |
+BluetoothTestWin::~BluetoothTestWin() {} |
+ |
+bool BluetoothTestWin::PlatformSupportsLowEnergy() { |
+ return device::win::IsBluetoothLowEnergySupported(); |
+} |
+ |
+void BluetoothTestWin::AdapterInitCallback() {} |
+ |
+void BluetoothTestWin::InitWithDefaultAdapter() { |
+ adapter_ = new BluetoothAdapterWin(base::Bind( |
+ &BluetoothTestWin::AdapterInitCallback, base::Unretained(this))); |
+ adapter_Win_ = static_cast<BluetoothAdapterWin*>(adapter_.get()); |
+ adapter_Win_->Init(); |
+} |
+ |
+void BluetoothTestWin::InitWithoutDefaultAdapter() { |
+ adapter_ = new BluetoothAdapterWin(base::Bind( |
+ &BluetoothTestWin::AdapterInitCallback, base::Unretained(this))); |
+ adapter_Win_ = static_cast<BluetoothAdapterWin*>(adapter_.get()); |
+ adapter_Win_->InitForTest(ui_task_runner_, bluetooth_task_runner_); |
+} |
+ |
+void BluetoothTestWin::InitWithFakeAdapter() { |
+ adapter_ = new BluetoothAdapterWin(base::Bind( |
+ &BluetoothTestWin::AdapterInitCallback, base::Unretained(this))); |
+ adapter_Win_ = static_cast<BluetoothAdapterWin*>(adapter_.get()); |
+ adapter_Win_->InitForTest(ui_task_runner_, bluetooth_task_runner_); |
+ BluetoothTaskManagerWin::AdapterState* adapter_state = |
+ new BluetoothTaskManagerWin::AdapterState(); |
+ adapter_state->name = kTestAdapterName; |
+ adapter_state->address = kTestAdapterAddress; |
+ adapter_state->powered = true; |
+ adapter_Win_->AdapterStateChanged(*adapter_state); |
+} |
+ |
+bool BluetoothTestWin::DenyPermission() { |
+ return false; |
+} |
+} |