tree: 9f1ec77e774392de87efd10dbb0dccb80f266436 [path history] [tgz]
  1. testing/
  2. bluetooth.cc
  3. bluetooth.h
  4. bluetooth.idl
  5. bluetooth_advertising_event.cc
  6. bluetooth_advertising_event.h
  7. bluetooth_advertising_event.idl
  8. bluetooth_advertising_event_init.idl
  9. bluetooth_attribute_instance_map.cc
  10. bluetooth_attribute_instance_map.h
  11. bluetooth_characteristic_properties.cc
  12. bluetooth_characteristic_properties.h
  13. bluetooth_characteristic_properties.idl
  14. bluetooth_device.cc
  15. bluetooth_device.h
  16. bluetooth_device.idl
  17. bluetooth_error.cc
  18. bluetooth_error.h
  19. bluetooth_le_scan.cc
  20. bluetooth_le_scan.h
  21. bluetooth_le_scan.idl
  22. bluetooth_le_scan_filter_init.idl
  23. bluetooth_le_scan_options.idl
  24. bluetooth_manufacturer_data_map.cc
  25. bluetooth_manufacturer_data_map.h
  26. bluetooth_manufacturer_data_map.idl
  27. bluetooth_remote_gatt_characteristic.cc
  28. bluetooth_remote_gatt_characteristic.h
  29. bluetooth_remote_gatt_characteristic.idl
  30. bluetooth_remote_gatt_descriptor.cc
  31. bluetooth_remote_gatt_descriptor.h
  32. bluetooth_remote_gatt_descriptor.idl
  33. bluetooth_remote_gatt_server.cc
  34. bluetooth_remote_gatt_server.h
  35. bluetooth_remote_gatt_server.idl
  36. bluetooth_remote_gatt_service.cc
  37. bluetooth_remote_gatt_service.h
  38. bluetooth_remote_gatt_service.idl
  39. bluetooth_remote_gatt_utils.cc
  40. bluetooth_remote_gatt_utils.h
  41. bluetooth_service_data_map.cc
  42. bluetooth_service_data_map.h
  43. bluetooth_service_data_map.idl
  44. bluetooth_uuid.cc
  45. bluetooth_uuid.h
  46. bluetooth_uuid.idl
  47. BUILD.gn
  48. DEPS
  49. navigator_bluetooth.cc
  50. navigator_bluetooth.h
  51. navigator_bluetooth.idl
  52. OWNERS
  53. README.md
  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