gecko-dev/testing/web-platform/tests/bluetooth/script-tests/server/invalid-service-name.js
Conley Owens e214eb1ddc Bug 1450351 [wpt PR 10257] - bluetooth: web: test: Use AllResponsesConsumed, a=testonly
Automatic update from web-platform-testsbluetooth: web: test: Use AllResponsesConsumed

This change uses AllResponsesConsumed in the bluetooth Web Platform
Tests in order to make sure we have consumed all the anticipatory
responses that we've set on our fakes.

BUG=569709

Change-Id: I9767792fcd5dda71fabf2f8941638f744aefa2dc
Reviewed-on: https://chromium-review.googlesource.com/988422
Commit-Queue: Conley Owens <cco3@chromium.org>
Reviewed-by: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548125}

wpt-commits: 148f026e5178b0b8d77e8f374671c9c5ff1545bf
wpt-pr: 10257
wpt-commits: 148f026e5178b0b8d77e8f374671c9c5ff1545bf
wpt-pr: 10257
2018-04-15 09:28:10 +01:00

22 lines
861 B
JavaScript

'use strict';
const test_desc = 'Wrong Service name. Reject with TypeError.';
const expected = new DOMException(
"Failed to execute 'FUNCTION_NAME' on " +
"'BluetoothRemoteGATTServer': Invalid Service name: " +
"'wrong_name'. It must be a valid UUID alias (e.g. 0x1234), " +
"UUID (lowercase hex characters e.g. " +
"'00001234-0000-1000-8000-00805f9b34fb'), " +
"or recognized standard name from " +
"https://www.bluetooth.com/specifications/gatt/services" +
" e.g. 'alert_notification'.",
'TypeError');
bluetooth_test(() => getConnectedHealthThermometerDevice()
.then(({device}) => assert_promise_rejects_with_message(
device.gatt.CALLS([
getPrimaryService('wrong_name')|
getPrimaryServices('wrong_name')
]),
expected,
'Wrong Service name passed.')),
test_desc);