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

Unified Diff: device/bluetooth/test/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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/test/README.md
diff --git a/device/bluetooth/test/README.md b/device/bluetooth/test/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..e71787c61705270056b91ef0a1051be0de2b6e33
--- /dev/null
+++ b/device/bluetooth/test/README.md
@@ -0,0 +1,56 @@
+# Testing
+
+Implementation of the Bluetooth component is tested via unittests. Client code
+uses Mock Bluetooth objects:
+
+## Mojo Testing Interface Implementation
+See [//public/interfaces/test/README.md](//device/bluetooth/public/interfaces/test/README.md)
+for details about the interface. The current implementation of this interface
+creates a fake implementation of the current non-mojo C++ Bluetooth interface.
+This interface is implemented across files with a "fake_" prefix.
+*This interface may be removed when a Bluetooth Mojo Service is introduced, if
+Web Bluetooth remains its only client. Testing code would implement the service
+as needed for tests.*
+
+## Cross Platform Unit Tests
+
+New feature development uses cross platform unit tests. This reduces test code
+redundancy and produces consistency across all implementations.
+
+Unit tests operate at the public `device/bluetooth` API layer and the
+`BluetoothTest` fixture controls fake operating system behavior as close to the
+platfom as possible. The resulting test coverage spans the cross platform API,
+common implementation, and platform specific implementation as close to
+operating system APIs as possible.
+
+`test/bluetooth_test.h` defines the cross platform test fixture
+`BluetoothTestBase`. Platform implementations provide subclasses, such as
+`test/bluetooth_test_android.h` and typedef to the name `BluetoothTest`.
+
+[More testing information](https://docs.google.com/document/d/1mBipxn1sJu6jMqP0RQZpkYXC1o601bzLCpCxwTA2yGA/edit?usp=sharing)
+
+## Legacy Platform Specific Unit Tests
+
+Early code (Classic on most platforms, and Low Energy on BlueZ) was tested with
+platform specific unit tests, e.g. `bluetooth_bluez_unittest.cc` &
+`bluetooth_adapter_win_unittest.cc`. The BlueZ style has platform specific
+methods to create fake devices and the public API is used to interact with them.
+
+Maintenance of these earlier implementation featuress should update tests in
+place. Long term these tests should be [refactored into cross platform
+tests](https://crbug.com/580403).
+
+
+## Mock Bluetooth Objects
+
+`test/mock_bluetooth_*` files provide GoogleMock based fake objects for use in
+client code.
+
+
+## Chrome OS Blueooth Controller Tests
+
+Bluetooth controller system tests generating radio signals are run and managed
+by the Chrome OS team. See:
+https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/server/site_tests/
+https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/server/cros/bluetooth/
+https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/client/cros/bluetooth/
« no previous file with comments | « device/bluetooth/public/interfaces/test/fake_bluetooth.mojom ('k') | device/bluetooth/test/fake_bluetooth.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698