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

Side by Side Diff: device/bluetooth/test/bluetooth_test_win.cc

Issue 1681853003: Add BluetoothRemoteGattServiceWin to BluetoothDeviceWin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add PlatformSupportsLowEnergy check in the unittests Created 4 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 unified diff | Download patch
« no previous file with comments | « device/bluetooth/test/bluetooth_test_win.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/test/bluetooth_test_win.h" 5 #include "device/bluetooth/test/bluetooth_test_win.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "device/bluetooth/bluetooth_adapter_win.h" 9 #include "device/bluetooth/bluetooth_adapter_win.h"
10 #include "device/bluetooth/bluetooth_low_energy_win.h" 10 #include "device/bluetooth/bluetooth_low_energy_win.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 ui_task_runner_->RunPendingTasks(); 121 ui_task_runner_->RunPendingTasks();
122 122
123 std::vector<BluetoothDevice*> devices = adapter_win_->GetDevices(); 123 std::vector<BluetoothDevice*> devices = adapter_win_->GetDevices();
124 for (auto device : devices) { 124 for (auto device : devices) {
125 if (device->GetAddress() == device_address) 125 if (device->GetAddress() == device_address)
126 return device; 126 return device;
127 } 127 }
128 128
129 return nullptr; 129 return nullptr;
130 } 130 }
131
132 void BluetoothTestWin::SimulateGattConnection(BluetoothDevice* device) {
133 bluetooth_task_runner_->RunPendingTasks();
134 ui_task_runner_->RunPendingTasks();
135
136 // Clear records caused by CreateGattConnection since we do not support it on
137 // Windows.
138 gatt_discovery_attempts_++;
139 expected_success_callback_calls_--;
140 unexpected_error_callback_ = false;
131 } 141 }
142
143 void BluetoothTestWin::SimulateGattServicesDiscovered(
144 BluetoothDevice* device,
145 const std::vector<std::string>& uuids) {
146 win::BLEDevice* simulated_device =
147 fake_bt_le_wrapper_->GetSimulatedBLEDevice(device->GetAddress());
148 CHECK(simulated_device);
149
150 for (auto uuid : uuids) {
151 fake_bt_le_wrapper_->SimulateBLEGattService(simulated_device, uuid);
152 }
153
154 bluetooth_task_runner_->RunPendingTasks();
155 ui_task_runner_->RunPendingTasks();
156 }
157 }
OLDNEW
« no previous file with comments | « device/bluetooth/test/bluetooth_test_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698