OLD | NEW |
1 # Testing | 1 # Bluetooth Testing |
2 | 2 |
3 Implementation of the Bluetooth component is tested via unittests. Client code | 3 Implementation of the Bluetooth component is tested via unittests. Client code |
4 uses Mock Bluetooth objects: | 4 uses Mock Bluetooth objects: |
5 | 5 |
| 6 |
6 ## Mojo Testing Interface Implementation | 7 ## Mojo Testing Interface Implementation |
7 See [//public/interfaces/test/README.md](//device/bluetooth/public/interfaces/te
st/README.md) | 8 |
| 9 See [bluetooth/public/interfaces/test](/device/bluetooth/public/interfaces/test) |
8 for details about the interface. The current implementation of this interface | 10 for details about the interface. The current implementation of this interface |
9 creates a fake implementation of the current non-mojo C++ Bluetooth interface. | 11 creates a fake implementation of the current non-mojo C++ Bluetooth interface. |
10 This interface is implemented across files with a "fake_" prefix. | 12 This interface is implemented across files with a "fake_" prefix. |
11 *This interface may be removed when a Bluetooth Mojo Service is introduced, if | 13 *This interface may be removed when a Bluetooth Mojo Service is introduced, if |
12 Web Bluetooth remains its only client. Testing code would implement the service | 14 Web Bluetooth remains its only client. Testing code would implement the service |
13 as needed for tests.* | 15 as needed for tests.* |
14 | 16 |
| 17 |
15 ## Cross Platform Unit Tests | 18 ## Cross Platform Unit Tests |
16 | 19 |
17 New feature development uses cross platform unit tests. This reduces test code | 20 New feature development uses cross platform unit tests. This reduces test code |
18 redundancy and produces consistency across all implementations. | 21 redundancy and produces consistency across all implementations. |
19 | 22 |
20 Unit tests operate at the public `device/bluetooth` API layer and the | 23 Unit tests operate at the public `device/bluetooth` API layer and the |
21 `BluetoothTest` fixture controls fake operating system behavior as close to the | 24 `BluetoothTest` fixture controls fake operating system behavior as close to the |
22 platfom as possible. The resulting test coverage spans the cross platform API, | 25 platfom as possible. The resulting test coverage spans the cross platform API, |
23 common implementation, and platform specific implementation as close to | 26 common implementation, and platform specific implementation as close to |
24 operating system APIs as possible. | 27 operating system APIs as possible. |
25 | 28 |
26 `test/bluetooth_test.h` defines the cross platform test fixture | 29 `test/bluetooth_test.h` defines the cross platform test fixture |
27 `BluetoothTestBase`. Platform implementations provide subclasses, such as | 30 `BluetoothTestBase`. Platform implementations provide subclasses, such as |
28 `test/bluetooth_test_android.h` and typedef to the name `BluetoothTest`. | 31 `test/bluetooth_test_android.h` and typedef to the name `BluetoothTest`. |
29 | 32 |
30 [More testing information](https://docs.google.com/document/d/1mBipxn1sJu6jMqP0R
QZpkYXC1o601bzLCpCxwTA2yGA/edit?usp=sharing) | 33 [More testing information](https://docs.google.com/document/d/1mBipxn1sJu6jMqP0R
QZpkYXC1o601bzLCpCxwTA2yGA/edit?usp=sharing) |
31 | 34 |
| 35 |
32 ## Legacy Platform Specific Unit Tests | 36 ## Legacy Platform Specific Unit Tests |
33 | 37 |
34 Early code (Classic on most platforms, and Low Energy on BlueZ) was tested with | 38 Early code (Classic on most platforms, and Low Energy on BlueZ) was tested with |
35 platform specific unit tests, e.g. `bluetooth_bluez_unittest.cc` & | 39 platform specific unit tests, e.g. `bluetooth_bluez_unittest.cc` & |
36 `bluetooth_adapter_win_unittest.cc`. The BlueZ style has platform specific | 40 `bluetooth_adapter_win_unittest.cc`. The BlueZ style has platform specific |
37 methods to create fake devices and the public API is used to interact with them. | 41 methods to create fake devices and the public API is used to interact with them. |
38 | 42 |
39 Maintenance of these earlier implementation featuress should update tests in | 43 Maintenance of these earlier implementation featuress should update tests in |
40 place. Long term these tests should be [refactored into cross platform | 44 place. Long term these tests should be [refactored into cross platform |
41 tests](https://crbug.com/580403). | 45 tests](https://crbug.com/580403). |
42 | 46 |
43 | 47 |
44 ## Mock Bluetooth Objects | 48 ## Mock Bluetooth Objects |
45 | 49 |
46 `test/mock_bluetooth_*` files provide GoogleMock based fake objects for use in | 50 `test/mock_bluetooth_*` files provide GoogleMock based fake objects for use in |
47 client code. | 51 client code. |
48 | 52 |
49 | 53 |
50 ## Chrome OS Blueooth Controller Tests | 54 ## Chrome OS Blueooth Controller Tests |
51 | 55 |
52 Bluetooth controller system tests generating radio signals are run and managed | 56 Bluetooth controller system tests generating radio signals are run and managed |
53 by the Chrome OS team. See: | 57 by the Chrome OS team. See: |
54 https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/serve
r/site_tests/ | 58 https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/serve
r/site_tests/ |
55 https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/serve
r/cros/bluetooth/ | 59 https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/serve
r/cros/bluetooth/ |
56 https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/clien
t/cros/bluetooth/ | 60 https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/clien
t/cros/bluetooth/ |
OLD | NEW |