gecko-dev/testing/web-platform/tests/bluetooth/script-tests/service/invalid-characteristic-name.js
James Graham aaf51814c3 Bug 1435337 - Update web-platform-tests to revision 7174d3e89f3057aae399483194dc4b608ee8c933, a=testonly
MozReview-Commit-ID: CSM0hnryiTp


--HG--
rename : testing/web-platform/tests/content-security-policy/reporting/reporting-api-doesnt-send-reports-without-violation.https.sub.html => testing/web-platform/tests/content-security-policy/reporting-api/reporting-api-doesnt-send-reports-without-violation.https.sub.html
rename : testing/web-platform/tests/content-security-policy/reporting/reporting-api-report-only-sends-reports-on-violation.https.sub.html => testing/web-platform/tests/content-security-policy/reporting-api/reporting-api-report-only-sends-reports-on-violation.https.sub.html
rename : testing/web-platform/tests/content-security-policy/reporting/reporting-api-report-to-overrides-report-uri-1.https.sub.html => testing/web-platform/tests/content-security-policy/reporting-api/reporting-api-report-to-overrides-report-uri-1.https.sub.html
rename : testing/web-platform/tests/content-security-policy/reporting/reporting-api-report-to-overrides-report-uri-2.https.sub.html => testing/web-platform/tests/content-security-policy/reporting-api/reporting-api-report-to-overrides-report-uri-2.https.sub.html
rename : testing/web-platform/tests/content-security-policy/reporting/reporting-api-sends-reports-on-violation.https.sub.html => testing/web-platform/tests/content-security-policy/reporting-api/reporting-api-sends-reports-on-violation.https.sub.html
2018-02-02 19:09:23 +00:00

23 lines
900 B
JavaScript

'use strict';
const test_desc = 'Wrong Characteristic name. Reject with TypeError.';
const expected = new DOMException(
"Failed to execute 'FUNCTION_NAME' on " +
"'BluetoothRemoteGATTService': Invalid Characteristic 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/characteristics" +
" e.g. 'aerobic_heart_rate_lower_limit'.",
'TypeError');
bluetooth_test(() => getHealthThermometerService()
.then(({service}) => assert_promise_rejects_with_message(
service.CALLS([
getCharacteristic('wrong_name')|
getCharacteristics('wrong_name')
]),
expected,
'Wrong Characteristic name passed.')),
test_desc);