tree: 2da70129d816bf053f13316259c4012af9aca55b [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_data_filter_init.idl
  15. bluetooth_device.cc
  16. bluetooth_device.h
  17. bluetooth_device.idl
  18. bluetooth_error.cc
  19. bluetooth_error.h
  20. bluetooth_le_scan.cc
  21. bluetooth_le_scan.h
  22. bluetooth_le_scan.idl
  23. bluetooth_le_scan_filter_init.idl
  24. bluetooth_le_scan_options.idl
  25. bluetooth_manufacturer_data_filter_init.idl
  26. bluetooth_manufacturer_data_map.cc
  27. bluetooth_manufacturer_data_map.h
  28. bluetooth_manufacturer_data_map.idl
  29. bluetooth_remote_gatt_characteristic.cc
  30. bluetooth_remote_gatt_characteristic.h
  31. bluetooth_remote_gatt_characteristic.idl
  32. bluetooth_remote_gatt_descriptor.cc
  33. bluetooth_remote_gatt_descriptor.h
  34. bluetooth_remote_gatt_descriptor.idl
  35. bluetooth_remote_gatt_server.cc
  36. bluetooth_remote_gatt_server.h
  37. bluetooth_remote_gatt_server.idl
  38. bluetooth_remote_gatt_service.cc
  39. bluetooth_remote_gatt_service.h
  40. bluetooth_remote_gatt_service.idl
  41. bluetooth_remote_gatt_utils.cc
  42. bluetooth_remote_gatt_utils.h
  43. bluetooth_service_data_map.cc
  44. bluetooth_service_data_map.h
  45. bluetooth_service_data_map.idl
  46. bluetooth_uuid.cc
  47. bluetooth_uuid.h
  48. bluetooth_uuid.idl
  49. bluetooth_uuid_unittest.cc
  50. BUILD.gn
  51. DEPS
  52. DIR_METADATA
  53. navigator_bluetooth.idl
  54. OWNERS
  55. README.md
  56. request_device_options.idl
  57. watch_advertisements_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
  • Web Bluetooth Manual Tests
    • Not browser-specific.
    • Relies on the full Bluetooth hardware stack. Helps find bugs specific to an operating system, or even OS level bugs.
    • Can be run by external web-application developers.

Design Documents

See: Class Diagram of Web Bluetooth through Bluetooth Android