OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/test/test_simple_task_runner.h" | 9 #include "base/test/test_simple_task_runner.h" |
10 #include "device/bluetooth/bluetooth_adapter.h" | 10 #include "device/bluetooth/bluetooth_adapter.h" |
11 #include "device/bluetooth/bluetooth_adapter_win.h" | 11 #include "device/bluetooth/bluetooth_adapter_win.h" |
12 #include "device/bluetooth/bluetooth_device.h" | 12 #include "device/bluetooth/bluetooth_device.h" |
13 #include "device/bluetooth/bluetooth_task_manager_win.h" | 13 #include "device/bluetooth/bluetooth_task_manager_win.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 const char kAdapterAddress[] = "Bluetooth Adapter Address"; | 18 const char kAdapterAddress[] = "A1:B2:C3:D4:E5:F6"; |
19 const char kAdapterName[] = "Bluetooth Adapter Name"; | 19 const char kAdapterName[] = "Bluetooth Adapter Name"; |
20 | 20 |
21 | 21 |
22 void MakeDeviceState(const std::string& name, | 22 void MakeDeviceState(const std::string& name, |
23 const std::string& address, | 23 const std::string& address, |
24 device::BluetoothTaskManagerWin::DeviceState* state) { | 24 device::BluetoothTaskManagerWin::DeviceState* state) { |
25 state->name = name; | 25 state->name = name; |
26 state->address = address; | 26 state->address = address; |
27 state->bluetooth_class = 0; | 27 state->bluetooth_class = 0; |
28 state->authenticated = false; | 28 state->authenticated = false; |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 ScopedVector<BluetoothTaskManagerWin::DeviceState> devices; | 500 ScopedVector<BluetoothTaskManagerWin::DeviceState> devices; |
501 devices.push_back(android_phone_state); | 501 devices.push_back(android_phone_state); |
502 devices.push_back(laptop_state); | 502 devices.push_back(laptop_state); |
503 devices.push_back(iphone_state); | 503 devices.push_back(iphone_state); |
504 | 504 |
505 adapter_win_->DevicesDiscovered(devices); | 505 adapter_win_->DevicesDiscovered(devices); |
506 EXPECT_EQ(3, adapter_observer_.num_device_added()); | 506 EXPECT_EQ(3, adapter_observer_.num_device_added()); |
507 } | 507 } |
508 | 508 |
509 } // namespace device | 509 } // namespace device |
OLD | NEW |