Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(605)

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/gen-service-delayed-discovery-no-permission-for-any-service.html

Issue 2459523002: bluetooth: Return specific error if getPrimaryServices() is called without requesting access to any… (Closed)
Patch Set: s/foo/TestName/ Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/gen-service-delayed-discovery-no-permission-for-any-service.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/delayed-discovery-no-permission-present-service.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/gen-service-delayed-discovery-no-permission-for-any-service.html
similarity index 54%
copy from third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/delayed-discovery-no-permission-present-service.html
copy to third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/gen-service-delayed-discovery-no-permission-for-any-service.html
index 193943cb0a509fe137d8adbe10de20e8c3185ed1..8698fdeca5b7cde6f0c34f6023fc57938ba2ddb2 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/delayed-discovery-no-permission-present-service.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/gen-service-delayed-discovery-no-permission-for-any-service.html
@@ -1,3 +1,4 @@
+<!-- Generated by //third_party/WebKit/LayoutTests/bluetooth/generate.py -->
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
@@ -10,7 +11,13 @@ promise_test(() => {
filters: [{name: 'Heart Rate Device'}]}))
.then(device => device.gatt.connect())
.then(gattServer => assert_promise_rejects_with_message(
- gattServer.getPrimaryServices(),
- new DOMException('No Services found in device.', 'NotFoundError')));
-}, 'Delayed service discovery, request for present service without permission. Reject with NotFoundError.');
+ gattServer.getPrimaryService('heart_rate'),
+ new DOMException('Origin is not allowed to access any service. Tip: ' +
+ 'Add the service UUID to \'optionalServices\' in ' +
+ 'requestDevice() options. https://goo.gl/HxfxSQ',
+ 'SecurityError')));
+}, 'Delayed service discovery, request for present service without ' +
+ 'permission to access any service. Reject with SecurityError.');
+</script>
+
</script>

Powered by Google App Engine
This is Rietveld 408576698