tree: a3aa65cdbadcaff593164bdb537b071306539987 [path history] [tgz]
  1. BUILD.gn
  2. Bluetooth.cpp
  3. Bluetooth.h
  4. Bluetooth.idl
  5. BluetoothAttributeInstanceMap.cpp
  6. BluetoothAttributeInstanceMap.h
  7. BluetoothCharacteristicProperties.cpp
  8. BluetoothCharacteristicProperties.h
  9. BluetoothCharacteristicProperties.idl
  10. BluetoothDevice.cpp
  11. BluetoothDevice.h
  12. BluetoothDevice.idl
  13. BluetoothError.cpp
  14. BluetoothError.h
  15. BluetoothLEScanFilterInit.idl
  16. BluetoothRemoteGATTCharacteristic.cpp
  17. BluetoothRemoteGATTCharacteristic.h
  18. BluetoothRemoteGATTCharacteristic.idl
  19. BluetoothRemoteGATTDescriptor.cpp
  20. BluetoothRemoteGATTDescriptor.h
  21. BluetoothRemoteGATTDescriptor.idl
  22. BluetoothRemoteGATTServer.cpp
  23. BluetoothRemoteGATTServer.h
  24. BluetoothRemoteGATTServer.idl
  25. BluetoothRemoteGATTService.cpp
  26. BluetoothRemoteGATTService.h
  27. BluetoothRemoteGATTService.idl
  28. BluetoothRemoteGATTUtils.cpp
  29. BluetoothRemoteGATTUtils.h
  30. BluetoothUUID.cpp
  31. BluetoothUUID.h
  32. BluetoothUUID.idl
  33. DEPS
  34. NavigatorBluetooth.cpp
  35. NavigatorBluetooth.h
  36. NavigatorBluetooth.idl
  37. OWNERS
  38. README.md
  39. RequestDeviceOptions.idl
  40. testing/
third_party/WebKit/Source/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