tree: ea81c43608e966e6b6aacdf6b700106e2e961b59 [path history] [tgz]
  1. testing/
  2. BUILD.gn
  3. DEPS
  4. OWNERS
  5. README.md
  6. bluetooth.cc
  7. bluetooth.h
  8. bluetooth.idl
  9. bluetooth_advertising_event.cc
  10. bluetooth_advertising_event.h
  11. bluetooth_advertising_event.idl
  12. bluetooth_advertising_event_init.idl
  13. bluetooth_attribute_instance_map.cc
  14. bluetooth_attribute_instance_map.h
  15. bluetooth_characteristic_properties.cc
  16. bluetooth_characteristic_properties.h
  17. bluetooth_characteristic_properties.idl
  18. bluetooth_device.cc
  19. bluetooth_device.h
  20. bluetooth_device.idl
  21. bluetooth_error.cc
  22. bluetooth_error.h
  23. bluetooth_le_scan.cc
  24. bluetooth_le_scan.h
  25. bluetooth_le_scan.idl
  26. bluetooth_le_scan_filter_init.idl
  27. bluetooth_le_scan_options.idl
  28. bluetooth_manufacturer_data_map.cc
  29. bluetooth_manufacturer_data_map.h
  30. bluetooth_manufacturer_data_map.idl
  31. bluetooth_remote_gatt_characteristic.cc
  32. bluetooth_remote_gatt_characteristic.h
  33. bluetooth_remote_gatt_characteristic.idl
  34. bluetooth_remote_gatt_descriptor.cc
  35. bluetooth_remote_gatt_descriptor.h
  36. bluetooth_remote_gatt_descriptor.idl
  37. bluetooth_remote_gatt_server.cc
  38. bluetooth_remote_gatt_server.h
  39. bluetooth_remote_gatt_server.idl
  40. bluetooth_remote_gatt_service.cc
  41. bluetooth_remote_gatt_service.h
  42. bluetooth_remote_gatt_service.idl
  43. bluetooth_remote_gatt_utils.cc
  44. bluetooth_remote_gatt_utils.h
  45. bluetooth_service_data_map.cc
  46. bluetooth_service_data_map.h
  47. bluetooth_service_data_map.idl
  48. bluetooth_uuid.cc
  49. bluetooth_uuid.h
  50. bluetooth_uuid.idl
  51. navigator_bluetooth.cc
  52. navigator_bluetooth.h
  53. navigator_bluetooth.idl
  54. request_device_options.idl
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).
  • web_tests/bluetooth/*/*.html
    • blink/tools/run_layout_tests.sh bluetooth
    • Web tests in web_tests/bluetooth/ rely on fake Bluetooth implementation classes constructed in content/shell/browser/web_test/web_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