Chromium Code Reviews| 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 | |
|
ortuno
2016/01/26 20:40:04
... or the other, even though...
scheib
2016/01/27 23:59:05
Done.
| |
| 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 | |
|
Jeffrey Yasskin
2016/01/26 20:59:37
Want to mention that only ChromeOS has full-system
scheib
2016/01/27 23:59:05
Done.
| |
| 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 | |
|
Jeffrey Yasskin
2016/01/26 20:59:37
Mention that these unit tests mock out the calls t
scheib
2016/01/27 23:59:05
Done.
| |
| 55 redundancy and produces consistency across all implementations. | |
| 56 | |
| 57 `test/bluetooth_test.h` defines a cross platform test fixture | |
| 58 `BluetoothTestBase`. Platform implementations provide subclasses, such as | |
| 59 `test/bluetooth_test_android.h` and typedef to the name `BluetoothTest`. | |
| 60 | |
| 61 [More information](https://docs.google.com/document/d/1mBipxn1sJu6jMqP0RQZpkYXC1 o601bzLCpCxwTA2yGA/edit?usp=sharing) | |
| 62 | |
| 63 ### Legacy Platform Specific Unit Tests | |
| 64 | |
| 65 Early code (Classic on most platforms, and Low Energy on BlueZ) was tested with | |
| 66 platform specific unit tests, e.g. `bluetooth_bluez_unittest.cc` & | |
|
Jeffrey Yasskin
2016/01/26 20:59:37
Maybe mention that these tests often asked the pla
scheib
2016/01/27 23:59:05
Done.
| |
| 67 `bluetooth_adapter_win_unittest.cc`. | |
| 68 | |
| 69 Maintenance of these earlier implementations should update tests in place. Long | |
| 70 term these tests should be | |
| 71 [refactored into cross platform tests](https://crbug.com/580403). | |
| 72 | |
| 73 | |
| 74 ### Mock Bluetooth Objects | |
| 75 | |
| 76 `test/mock_bluetooth_*` files provide GMOCK based fake objects for use in client | |
|
Jeffrey Yasskin
2016/01/26 20:59:37
"GMock" isn't normally all-caps. Its official name
scheib
2016/01/27 23:59:05
Done.
| |
| 77 code. | |
| 78 | |
| 79 | |
| 80 -------------------------------------------------------------------------------- | |
| 81 Android | |
| 82 -------------------------------------------------------------------------------- | |
| 83 | |
| 84 The android implementation requires crossing from C++ to Java using | |
| 85 [__JNI__](https://www.chromium.org/developers/design-documents/android-jni). | |
| 86 | |
| 87 Object ownership is rooted in the C++ classes, starting with the Adapter, which | |
| 88 owns Devices, Services, etc. Java counter parts interface with the Android | |
| 89 Bluetooth objects. E.g. | |
| 90 | |
| 91 For testing, the Android objects are __wrapped__ in: | |
| 92 `android/java/src/org/chromium/device/bluetooth/Wrappers.java`. <br> | |
| 93 and __fakes__ implemenated in: | |
|
Jeffrey Yasskin
2016/01/26 20:59:37
sp: implemenated
scheib
2016/01/27 23:59:05
Done.
| |
| 94 `test/android/java/src/org/chromium/device/bluetooth/Fakes.java`. | |
| 95 | |
| 96 Thus: | |
| 97 | |
| 98 * `bluetooth_adapter_android.h` owns: | |
|
Jeffrey Yasskin
2016/01/26 20:59:37
Yay clarity!
scheib
2016/01/27 23:59:05
Acknowledged.
| |
| 99 * `android/.../ChromeBluetoothAdapter.java` uses: | |
| 100 * `android/.../Wrappers.java`: `BluetoothAdapterWrapper` | |
| 101 * Which under test is a `FakeBluetoothAdapter` | |
| 102 * `bluetooth_device_android.h` owns: | |
| 103 * `android/.../ChromeBluetoothDevice.java` uses: | |
| 104 * `android/.../Wrappers.java`: `BluetoothDeviceWrapper` | |
| 105 * Which under test is a `FakeBluetoothDevice` | |
| 106 * `bluetooth_gatt_service_android.h` owns: | |
|
Jeffrey Yasskin
2016/01/26 20:59:37
Maybe a "* similar through characteristics and des
scheib
2016/01/27 23:59:05
Done.
| |
| 107 * `android/.../ChromeBluetoothService.java` uses: | |
| 108 * `android/.../Wrappers.java`: `BluetoothServiceWrapper` | |
| 109 * Which under test is a `FakeBluetoothService` | |
| 110 | |
| 111 Fake objects are controlled by `bluetooth_test_android.cc`. | |
| OLD | NEW |