OLD | NEW |
(Empty) | |
| 1 Bluetooth |
| 2 ========= |
| 3 |
| 4 `device/bluetooth` abstracts |
| 5 [Bluetooth Classic](https://en.wikipedia.org/wiki/Bluetooth) and |
| 6 [Low Energy](https://en.wikipedia.org/wiki/Bluetooth_low_energy) features |
| 7 across multiple platforms. |
| 8 |
| 9 Classic and Low Energy based profiles differ substantially. Platform |
| 10 implementations may support only one or the other, even though several classes |
| 11 have interfaces for both, e.g. `BluetoothAdapter` & `BluetoothDevice`. |
| 12 |
| 13 | | Classic | Low Energy | |
| 14 |----------|:-------:|:-----------:| |
| 15 | Android | no | in progress | |
| 16 | ChromeOS | yes | yes | |
| 17 | Linux | yes | yes | |
| 18 | Mac OSX | yes | in progress | |
| 19 | Windows | some | in progress | |
| 20 |
| 21 ChromeOS and Linux are supported via BlueZ, see `*_bluez` files. |
| 22 |
| 23 |
| 24 -------------------------------------------------------------------------------- |
| 25 Maintainer History |
| 26 -------------------------------------------------------------------------------- |
| 27 |
| 28 Initial implementation OWNERS were youngki@chromium.org, keybuk@chromium.org, |
| 29 armansito@chromium.org, and rpaquay@chromium.org. They no longer contribute to |
| 30 chromium fulltime. They were responsible for support for ChromeOS Bluetooth |
| 31 features and the Chrome Apps APIs: |
| 32 |
| 33 * [bluetooth](https://developer.chrome.com/apps/bluetooth) |
| 34 * [bluetoothLowEnergy](https://developer.chrome.com/apps/bluetoothLowEnergy) |
| 35 * [bluetoothSocket](https://developer.chrome.com/apps/bluetoothSocket) |
| 36 |
| 37 Active development in 2015 & 2016 is focused on enabling GATT features for: |
| 38 |
| 39 * [Web Bluetooth](https://crbug.com/419413) |
| 40 |
| 41 Known future work is tracked in the |
| 42 [Refactoring meta issue](https://crbug.com/580406). |
| 43 |
| 44 -------------------------------------------------------------------------------- |
| 45 Testing |
| 46 -------------------------------------------------------------------------------- |
| 47 |
| 48 Implementation of the Bluetooth component is tested via unittests. Client code |
| 49 uses Mock Bluetooth objects: |
| 50 |
| 51 |
| 52 ### Cross Platform Unit Tests |
| 53 |
| 54 New feature development uses cross platform unit tests. This reduces test code |
| 55 redundancy and produces consistency across all implementations. |
| 56 |
| 57 Unit tests operate at the public `device/bluetooth` API layer and the |
| 58 `BluetoothTest` fixture controls fake operating system behavior as close to the |
| 59 platfom as possible. The resulting test coverage spans the cross platform API, |
| 60 common implementation, and platform specific implementation as close to |
| 61 operating system APIs as possible. |
| 62 |
| 63 `test/bluetooth_test.h` defines the cross platform test fixture |
| 64 `BluetoothTestBase`. Platform implementations provide subclasses, such as |
| 65 `test/bluetooth_test_android.h` and typedef to the name `BluetoothTest`. |
| 66 |
| 67 [More testing information](https://docs.google.com/document/d/1mBipxn1sJu6jMqP0R
QZpkYXC1o601bzLCpCxwTA2yGA/edit?usp=sharing) |
| 68 |
| 69 ### Legacy Platform Specific Unit Tests |
| 70 |
| 71 Early code (Classic on most platforms, and Low Energy on BlueZ) was tested with |
| 72 platform specific unit tests, e.g. `bluetooth_bluez_unittest.cc` & |
| 73 `bluetooth_adapter_win_unittest.cc`. The BlueZ style has platform specific |
| 74 methods to create fake devices and the public API is used to interact with them. |
| 75 |
| 76 Maintenance of these earlier implementation featuress should update tests in |
| 77 place. Long term these tests should be [refactored into cross platform |
| 78 tests](https://crbug.com/580403). |
| 79 |
| 80 |
| 81 ### Mock Bluetooth Objects |
| 82 |
| 83 `test/mock_bluetooth_*` files provide GoogleMock based fake objects for use in |
| 84 client code. |
| 85 |
| 86 |
| 87 ### ChromeOS Blueooth Controller Tests |
| 88 |
| 89 Bluetooth controller system tests generating radio signals are run and managed |
| 90 by the ChromeOS team. See: |
| 91 https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/serve
r/site_tests/ |
| 92 https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/serve
r/cros/bluetooth/ |
| 93 https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/clien
t/cros/bluetooth/ |
| 94 |
| 95 |
| 96 -------------------------------------------------------------------------------- |
| 97 Android |
| 98 -------------------------------------------------------------------------------- |
| 99 |
| 100 The android implementation requires crossing from C++ to Java using |
| 101 [__JNI__](https://www.chromium.org/developers/design-documents/android-jni). |
| 102 |
| 103 Object ownership is rooted in the C++ classes, starting with the Adapter, which |
| 104 owns Devices, Services, etc. Java counter parts interface with the Android |
| 105 Bluetooth objects. E.g. |
| 106 |
| 107 For testing, the Android objects are __wrapped__ in: |
| 108 `android/java/src/org/chromium/device/bluetooth/Wrappers.java`. <br> |
| 109 and __fakes__ implemented in: |
| 110 `test/android/java/src/org/chromium/device/bluetooth/Fakes.java`. |
| 111 |
| 112 Thus: |
| 113 |
| 114 * `bluetooth_adapter_android.h` owns: |
| 115 * `android/.../ChromeBluetoothAdapter.java` uses: |
| 116 * `android/.../Wrappers.java`: `BluetoothAdapterWrapper` |
| 117 * Which under test is a `FakeBluetoothAdapter` |
| 118 * `bluetooth_device_android.h` owns: |
| 119 * `android/.../ChromeBluetoothDevice.java` uses: |
| 120 * `android/.../Wrappers.java`: `BluetoothDeviceWrapper` |
| 121 * Which under test is a `FakeBluetoothDevice` |
| 122 * `bluetooth_gatt_service_android.h` owns: |
| 123 * `android/.../ChromeBluetoothService.java` uses: |
| 124 * `android/.../Wrappers.java`: `BluetoothServiceWrapper` |
| 125 * Which under test is a `FakeBluetoothService` |
| 126 * ... and so on for characteristics and descriptors. |
| 127 |
| 128 Fake objects are controlled by `bluetooth_test_android.cc`. |
OLD | NEW |