Rather than returning 'NotFoundError: No services found in device.' we could give a more specific error that indicates that developers need to request access to services before being able to retrieve them.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/08303d660862c7d0d4f9deb7cb753d3dc68570dc commit 08303d660862c7d0d4f9deb7cb753d3dc68570dc Author: beaufort.francois <beaufort.francois@gmail.com> Date: Tue Nov 15 15:53:14 2016 bluetooth: Return specific error if getPrimaryServices() is called without requesting access to any UUIDs. BUG= 656458 Review-Url: https://codereview.chromium.org/2459523002 Cr-Commit-Position: refs/heads/master@{#432186} [modify] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/content/browser/bluetooth/bluetooth_allowed_devices_map.cc [modify] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/content/browser/bluetooth/bluetooth_allowed_devices_map.h [modify] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/content/browser/bluetooth/bluetooth_allowed_devices_map_unittest.cc [modify] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/content/browser/bluetooth/web_bluetooth_service_impl.cc [add] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/gen-service-delayed-discovery-no-permission-for-any-service.html [add] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/gen-service-no-permission-for-any-service.html [modify] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/delayed-discovery-no-permission-present-service.html [add] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/gen-service-delayed-discovery-no-permission-for-any-service-with-uuid.html [add] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/gen-service-delayed-discovery-no-permission-for-any-service.html [add] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/gen-service-no-permission-for-any-service-with-uuid.html [add] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/gen-service-no-permission-for-any-service.html [modify] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/no-permission-present-service.html [add] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/third_party/WebKit/LayoutTests/bluetooth/script-tests/service-delayed-discovery-no-permission-for-any-service.js [add] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/third_party/WebKit/LayoutTests/bluetooth/script-tests/service-no-permission-for-any-service.js [modify] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/third_party/WebKit/Source/modules/bluetooth/BluetoothError.cpp [modify] https://crrev.com/08303d660862c7d0d4f9deb7cb753d3dc68570dc/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom
Comment 1 by fbeaufort@chromium.org
, Oct 28 2016Status: Started (was: Available)