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

Side by Side Diff: device/bluetooth/test/bluetooth_test.h

Issue 1232613004: The first 3 BluetoothTest.* unit tests now running on Mac as well. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@movCBCM
Patch Set: comment edit Created 5 years, 5 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/bluetooth_adapter_unittest.cc ('k') | device/bluetooth/test/bluetooth_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 class BluetoothAdapter; 16 class BluetoothAdapter;
17 17
18 // A test fixture for Bluetooth that abstracts platform specifics for creating 18 // A test fixture for Bluetooth that abstracts platform specifics for creating
19 // and controlling fake low level objects. 19 // and controlling fake low level objects.
20 // 20 //
21 // Subclasses on each platform implement this, and are then typedef-ed to 21 // Subclasses on each platform implement this, and are then typedef-ed to
22 // BluetoothTest. 22 // BluetoothTest.
23 class BluetoothTestBase : public testing::Test { 23 class BluetoothTestBase : public testing::Test {
24 public: 24 public:
25 static const std::string kTestAdapterName;
26 static const std::string kTestAdapterAddress;
27
25 BluetoothTestBase(); 28 BluetoothTestBase();
26 ~BluetoothTestBase() override; 29 ~BluetoothTestBase() override;
27 30
28 // Initializes the BluetoothAdapter |adapter_| with the system adapter. 31 // Initializes the BluetoothAdapter |adapter_| with the system adapter.
29 virtual void InitWithDefaultAdapter(){}; 32 virtual void InitWithDefaultAdapter(){};
30 33
31 // Initializes the BluetoothAdapter |adapter_| with the system adapter forced 34 // Initializes the BluetoothAdapter |adapter_| with the system adapter forced
32 // to be ignored as if it did not exist. This enables tests for when an 35 // to be ignored as if it did not exist. This enables tests for when an
33 // adapter is not present on the system. 36 // adapter is not present on the system.
34 virtual void InitWithoutDefaultAdapter(){}; 37 virtual void InitWithoutDefaultAdapter(){};
(...skipping 27 matching lines...) Expand all
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_
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter_unittest.cc ('k') | device/bluetooth/test/bluetooth_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698