OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ | 5 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ |
6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ | 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "device/bluetooth/bluetooth_adapter.h" | 10 #include "device/bluetooth/bluetooth_adapter.h" |
11 #include "device/bluetooth/bluetooth_discovery_session.h" | 11 #include "device/bluetooth/bluetooth_discovery_session.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace device { | 14 namespace device { |
15 | 15 |
16 const std::string kTestAdapterName = "FakeBluetoothAdapter"; | |
scheib
2015/07/17 21:26:04
Probably we should move these to be static members
krstnmnlsn
2015/07/17 23:14:50
Done.
| |
17 const std::string kTestAdapterAddress = "A1:B2:C3:D4:E5:F6"; | |
18 | |
16 class BluetoothAdapter; | 19 class BluetoothAdapter; |
17 | 20 |
18 // A test fixture for Bluetooth that abstracts platform specifics for creating | 21 // A test fixture for Bluetooth that abstracts platform specifics for creating |
19 // and controlling fake low level objects. | 22 // and controlling fake low level objects. |
20 // | 23 // |
21 // Subclasses on each platform implement this, and are then typedef-ed to | 24 // Subclasses on each platform implement this, and are then typedef-ed to |
22 // BluetoothTest. | 25 // BluetoothTest. |
23 class BluetoothTestBase : public testing::Test { | 26 class BluetoothTestBase : public testing::Test { |
24 public: | 27 public: |
25 BluetoothTestBase(); | 28 BluetoothTestBase(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 scoped_refptr<BluetoothAdapter> adapter_; | 65 scoped_refptr<BluetoothAdapter> adapter_; |
63 ScopedVector<BluetoothDiscoverySession> discovery_sessions_; | 66 ScopedVector<BluetoothDiscoverySession> discovery_sessions_; |
64 int callback_count_ = 0; | 67 int callback_count_ = 0; |
65 int error_callback_count_ = 0; | 68 int error_callback_count_ = 0; |
66 bool run_message_loop_to_wait_for_callbacks_ = true; | 69 bool run_message_loop_to_wait_for_callbacks_ = true; |
67 }; | 70 }; |
68 | 71 |
69 } // namespace device | 72 } // namespace device |
70 | 73 |
71 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ | 74 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ |
OLD | NEW |