tree: 7f8c792165ae8c74582917ea46d1dd841793fe09 [path history] [tgz]
  1. BUILD.gn
  2. DEPS
  3. OWNERS
  4. README.md
  5. bluetooth.cc
  6. bluetooth.h
  7. bluetooth.idl
  8. bluetooth_attribute_instance_map.cc
  9. bluetooth_attribute_instance_map.h
  10. bluetooth_characteristic_properties.cc
  11. bluetooth_characteristic_properties.h
  12. bluetooth_characteristic_properties.idl
  13. bluetooth_device.cc
  14. bluetooth_device.h
  15. bluetooth_device.idl
  16. bluetooth_error.cc
  17. bluetooth_error.h
  18. bluetooth_le_scan_filter_init.idl
  19. bluetooth_remote_gatt_characteristic.cc
  20. bluetooth_remote_gatt_characteristic.h
  21. bluetooth_remote_gatt_characteristic.idl
  22. bluetooth_remote_gatt_descriptor.cc
  23. bluetooth_remote_gatt_descriptor.h
  24. bluetooth_remote_gatt_descriptor.idl
  25. bluetooth_remote_gatt_server.cc
  26. bluetooth_remote_gatt_server.h
  27. bluetooth_remote_gatt_server.idl
  28. bluetooth_remote_gatt_service.cc
  29. bluetooth_remote_gatt_service.h
  30. bluetooth_remote_gatt_service.idl
  31. bluetooth_remote_gatt_utils.cc
  32. bluetooth_remote_gatt_utils.h
  33. bluetooth_uuid.cc
  34. bluetooth_uuid.h
  35. bluetooth_uuid.idl
  36. navigator_bluetooth.cc
  37. navigator_bluetooth.h
  38. navigator_bluetooth.idl
  39. request_device_options.idl
  40. testing/
third_party/blink/renderer/modules/bluetooth/README.md

Web Bluetooth Blink Module

Source/modules/bluetooth implements the renderer process details and bindings for the Web Bluetooth specification. It uses the Web Bluetooth Service mojom to communicate with the Web Bluetooth Service.

LE only Scanning

There isn't much support for GATT over BR/EDR from neither platforms nor devices so performing a Dual scan will find devices that the API is not able to interact with. To avoid wasting power and confusing users with devices they are not able to interact with, navigator.bluetooth.requestDevice performs an LE-only Scan.

Testing

Web Bluetooth implementation details are tested at several layers:

  • /device/bluetooth/*_unittest.cc
    • device_unittests --gtest_filter="*Bluetooth*"
    • General bluetooth platform abstraction level down to the OS. See device/bluetooth/test for details.
  • /chrome/browser/*bluetooth*_browsertest.cc
    • out/Release/browser_tests --gtest_filter="*Bluetooth*"
    • Browser policy level tests (crash recovery, blocklist, killswitch).
  • /content/*/bluetooth/*_unittest.cc
    • out/Release/content_unittests --gtest_filter="*Bluetooth*"
    • Trusted Web Bluetooth code (browser process) tests (as opposed to untrusted renderer process).
  • LayoutTests/bluetooth/*/*.html
    • blink/tools/run_layout_tests.sh bluetooth
    • Layout tests in LayoutTests/bluetooth/ rely on fake Bluetooth implementation classes constructed in content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider. These tests span JavaScript binding to the device/bluetooth platform abstraction layer.
  • testing/clusterfuzz

Design Documents

See: Class Diagram of Web Bluetooth through Bluetooth Android