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

Side by Side Diff: device/bluetooth/README.md

Issue 2737343003: bluetooth: Add FakeBluetooth interface (Closed)
Patch Set: move web-bluetooth-test.js Created 3 years, 8 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/BUILD.gn ('k') | device/bluetooth/public/interfaces/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Bluetooth 1 # Bluetooth
2 2
3 `device/bluetooth` abstracts 3 `device/bluetooth` abstracts
4 [Bluetooth Classic](https://en.wikipedia.org/wiki/Bluetooth) and 4 [Bluetooth Classic](https://en.wikipedia.org/wiki/Bluetooth) and
5 [Low Energy](https://en.wikipedia.org/wiki/Bluetooth_low_energy) features 5 [Low Energy](https://en.wikipedia.org/wiki/Bluetooth_low_energy) features
6 across multiple platforms. 6 across multiple platforms.
7 7
8 Classic and Low Energy based profiles differ substantially. Platform 8 Classic and Low Energy based profiles differ substantially. Platform
9 implementations may support only one or the other, even though several classes 9 implementations may support only one or the other, even though several classes
10 have interfaces for both, e.g. `BluetoothAdapter` & `BluetoothDevice`. 10 have interfaces for both, e.g. `BluetoothAdapter` & `BluetoothDevice`.
(...skipping 25 matching lines...) Expand all
36 * [chrome.bluetoothSocket](https://developer.chrome.com/apps/bluetoothSocket) 36 * [chrome.bluetoothSocket](https://developer.chrome.com/apps/bluetoothSocket)
37 37
38 Active development in 2015 & 2016 is focused on enabling GATT features for: 38 Active development in 2015 & 2016 is focused on enabling GATT features for:
39 39
40 * [Web Bluetooth](https://crbug.com/419413) 40 * [Web Bluetooth](https://crbug.com/419413)
41 * Peripheral mode for Chrome OS. 41 * Peripheral mode for Chrome OS.
42 42
43 Known future work is tracked in the 43 Known future work is tracked in the
44 [Refactoring meta issue](https://crbug.com/580406). 44 [Refactoring meta issue](https://crbug.com/580406).
45 45
46
47 ## Testing
48
49 Implementation of the Bluetooth component is tested via unittests. Client code
50 uses Mock Bluetooth objects:
51
52
53 ### Cross Platform Unit Tests
54
55 New feature development uses cross platform unit tests. This reduces test code
56 redundancy and produces consistency across all implementations.
57
58 Unit tests operate at the public `device/bluetooth` API layer and the
59 `BluetoothTest` fixture controls fake operating system behavior as close to the
60 platfom as possible. The resulting test coverage spans the cross platform API,
61 common implementation, and platform specific implementation as close to
62 operating system APIs as possible.
63
64 `test/bluetooth_test.h` defines the cross platform test fixture
65 `BluetoothTestBase`. Platform implementations provide subclasses, such as
66 `test/bluetooth_test_android.h` and typedef to the name `BluetoothTest`.
67
68 [More testing information](https://docs.google.com/document/d/1mBipxn1sJu6jMqP0R QZpkYXC1o601bzLCpCxwTA2yGA/edit?usp=sharing)
69
70 ### Legacy Platform Specific Unit Tests
71
72 Early code (Classic on most platforms, and Low Energy on BlueZ) was tested with
73 platform specific unit tests, e.g. `bluetooth_bluez_unittest.cc` &
74 `bluetooth_adapter_win_unittest.cc`. The BlueZ style has platform specific
75 methods to create fake devices and the public API is used to interact with them.
76
77 Maintenance of these earlier implementation featuress should update tests in
78 place. Long term these tests should be [refactored into cross platform
79 tests](https://crbug.com/580403).
80
81
82 ### Mock Bluetooth Objects
83
84 `test/mock_bluetooth_*` files provide GoogleMock based fake objects for use in
85 client code.
86
87
88 ### Chrome OS Blueooth Controller Tests
89
90 Bluetooth controller system tests generating radio signals are run and managed
91 by the Chrome OS team. See:
92 https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/serve r/site_tests/
93 https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/serve r/cros/bluetooth/
94 https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/clien t/cros/bluetooth/
95
96
97 ## Android 46 ## Android
98 47
99 The android implementation requires crossing from C++ to Java using 48 The android implementation requires crossing from C++ to Java using
100 [__JNI__](https://www.chromium.org/developers/design-documents/android-jni). 49 [__JNI__](https://www.chromium.org/developers/design-documents/android-jni).
101 50
102 Object ownership is rooted in the C++ classes, starting with the Adapter, which 51 Object ownership is rooted in the C++ classes, starting with the Adapter, which
103 owns Devices, Services, etc. Java counter parts interface with the Android 52 owns Devices, Services, etc. Java counter parts interface with the Android
104 Bluetooth objects. E.g. 53 Bluetooth objects. E.g.
105 54
106 For testing, the Android objects are __wrapped__ in: 55 For testing, the Android objects are __wrapped__ in:
(...skipping 16 matching lines...) Expand all
123 * `android/.../Wrappers.java`: `BluetoothServiceWrapper` 72 * `android/.../Wrappers.java`: `BluetoothServiceWrapper`
124 * Which under test is a `FakeBluetoothService` 73 * Which under test is a `FakeBluetoothService`
125 * ... and so on for characteristics and descriptors. 74 * ... and so on for characteristics and descriptors.
126 75
127 Fake objects are controlled by `bluetooth_test_android.cc`. 76 Fake objects are controlled by `bluetooth_test_android.cc`.
128 77
129 See also: [Class Diagram of Web Bluetooth through Bluetooth Android][Class] 78 See also: [Class Diagram of Web Bluetooth through Bluetooth Android][Class]
130 79
131 [Class]: https://sites.google.com/a/chromium.org/dev/developers/design-documents /bluetooth-design-docs/web-bluetooth-through-bluetooth-android-class-diagram 80 [Class]: https://sites.google.com/a/chromium.org/dev/developers/design-documents /bluetooth-design-docs/web-bluetooth-through-bluetooth-android-class-diagram
132 81
82 ## Testing
83 See [test/README.md](//device/bluetooth/test/README.md)
133 84
134 ## Design Documents 85 ## Design Documents
135 86
136 * [Bluetooth Notifications](https://docs.google.com/document/d/1guBtAnQUP8ZoZre4 VQGrjR5uX0ZYxfK-lwKNeqY0-z4/edit?usp=sharing) 2016-08-26 87 * [Bluetooth Notifications](https://docs.google.com/document/d/1guBtAnQUP8ZoZre4 VQGrjR5uX0ZYxfK-lwKNeqY0-z4/edit?usp=sharing) 2016-08-26
137 * Web Bluetooth through Android implementation details, class diagram and 88 * Web Bluetooth through Android implementation details, class diagram and
138 call flow. 89 call flow.
OLDNEW
« no previous file with comments | « device/bluetooth/BUILD.gn ('k') | device/bluetooth/public/interfaces/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698