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