diff options
14 files changed, 87 insertions, 62 deletions
diff --git a/components/bluetooth/test.rs b/components/bluetooth/test.rs index 8578db79aa5..e2c6e639e82 100644 --- a/components/bluetooth/test.rs +++ b/components/bluetooth/test.rs @@ -99,7 +99,7 @@ const SERIAL_NUMBER_STRING_UUID: &'static str = "00002a25-0000-1000-8000-00805f9 // Descriptor UUIDs const BLOCKLIST_EXCLUDE_READS_DESCRIPTOR_UUID: &'static str = "aaaaaaaa-aaaa-1181-0510-810819516110"; -const BLOCKLIST_DESCRIPTOR_UUID: &'static str = "07711111-6104-0970-7011-1107105110aaa"; +const BLOCKLIST_DESCRIPTOR_UUID: &'static str = "07711111-6104-0970-7011-1107105110aa"; // https://www.bluetooth.com/specifications/gatt/ // viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_user_description.xml const CHARACTERISTIC_USER_DESCRIPTION_UUID: &'static str = "00002901-0000-1000-8000-00805f9b34fb"; diff --git a/components/script/dom/bluetoothuuid.rs b/components/script/dom/bluetoothuuid.rs index bf8774650ba..e16d8141e50 100644 --- a/components/script/dom/bluetoothuuid.rs +++ b/components/script/dom/bluetoothuuid.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::UnionTypes::StringOrUnsignedLong; -use dom::bindings::error::Error::Syntax; +use dom::bindings::error::Error::Type; use dom::bindings::error::Fallible; use dom::bindings::reflector::Reflector; use dom::bindings::str::DOMString; @@ -267,7 +267,19 @@ const BASE_UUID: &'static str = "-0000-1000-8000-00805f9b34fb"; const SERVICE_PREFIX: &'static str = "org.bluetooth.service"; const CHARACTERISTIC_PREFIX: &'static str = "org.bluetooth.characteristic"; const DESCRIPTOR_PREFIX: &'static str = "org.bluetooth.descriptor"; -const VALID_UUID_REGEX: &'static str = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"; +const VALID_UUID_REGEX: &'static str = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"; +// https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/bluetooth/BluetoothUUID.cpp?l=314 +const UUID_ERROR_MESSAGE: &'static str = "It must be a valid UUID alias (e.g. 0x1234), \ + UUID (lowercase hex characters e.g. '00001234-0000-1000-8000-00805f9b34fb'),\nor recognized standard name from"; +// https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/bluetooth/BluetoothUUID.cpp?l=321 +const SERVICES_ERROR_MESSAGE: &'static str = "https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx\ + \ne.g. 'alert_notification'."; +// https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/bluetooth/BluetoothUUID.cpp?l=327 +const CHARACTERISTIC_ERROR_MESSAGE: &'static str = "https://developer.bluetooth.org/gatt/characteristics/Pages/\ + CharacteristicsHome.aspx\ne.g. 'aerobic_heart_rate_lower_limit'."; +// https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/bluetooth/BluetoothUUID.cpp?l=333 +const DESCRIPTOR_ERROR_MESSAGE: &'static str = "https://developer.bluetooth.org/gatt/descriptors/Pages/\ + DescriptorsHomePage.aspx\ne.g. 'gatt.characteristic_presentation_format'."; impl BluetoothUUID { // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothuuid-canonicaluuid @@ -325,22 +337,35 @@ fn resolve_uuid_name( prefix: &str) -> Fallible<DOMString> { match name { - // Step 1 + // Step 1. StringOrUnsignedLong::UnsignedLong(unsigned32) => { Ok(canonical_uuid(unsigned32)) }, StringOrUnsignedLong::String(dstring) => { - // Step 2 + // Step 2. let regex = Regex::new(VALID_UUID_REGEX).unwrap(); if regex.is_match(&*dstring) { Ok(dstring) } else { - // Step 3 + // Step 3. let concatenated = format!("{}.{}", prefix, dstring); let is_in_table = assigned_numbers_table.iter().find(|p| p.0 == concatenated); match is_in_table { Some(&(_, alias)) => Ok(canonical_uuid(alias)), - None => Err(Syntax), + None => { + let (attribute_type, error_url_message) = match prefix { + SERVICE_PREFIX => ("Service", SERVICES_ERROR_MESSAGE), + CHARACTERISTIC_PREFIX => ("Characteristic", CHARACTERISTIC_ERROR_MESSAGE), + DESCRIPTOR_PREFIX => ("Descriptor", DESCRIPTOR_ERROR_MESSAGE), + _ => unreachable!(), + }; + // Step 4. + return Err(Type(format!("Invalid {} name : '{}'.\n{} {}", + attribute_type, + dstring, + UUID_ERROR_MESSAGE, + error_url_message))); + }, } } }, diff --git a/resources/gatt_blocklist.txt b/resources/gatt_blocklist.txt index 189a2c5fe0f..e7f39fa77a5 100644 --- a/resources/gatt_blocklist.txt +++ b/resources/gatt_blocklist.txt @@ -56,7 +56,7 @@ bad1c9a2-9a5b-4015-8b60-1579bbbf2135 exclude-reads 00002903-0000-1000-8000-00805f9b34fb exclude-writes # Blocklisted descriptor used to test. -07711111-6104-0970-7011-1107105110aaa +07711111-6104-0970-7011-1107105110aa # Blocklisted descriptor used to test. -aaaaaaaa-aaaa-1181-0510-810819516110 exclude-reads
\ No newline at end of file +aaaaaaaa-aaaa-1181-0510-810819516110 exclude-reads diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/bluetooth-helpers.js b/tests/wpt/mozilla/tests/mozilla/bluetooth/bluetooth-helpers.js index c09835284d5..16a280cca29 100644 --- a/tests/wpt/mozilla/tests/mozilla/bluetooth/bluetooth-helpers.js +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/bluetooth-helpers.js @@ -9,7 +9,7 @@ var blocklist_exclude_reads_characteristic_uuid = "bad1c9a2-9a5b-4015-8b60-1579b var request_disconnection_characteristic_uuid = "01d7d88a-7451-419f-aeb8-d65e7b9277af"; // Descriptors: var blocklist_exclude_reads_descriptor_uuid = "aaaaaaaa-aaaa-1181-0510-810819516110"; -var blocklist_descriptor_uuid = "07711111-6104-0970-7011-1107105110aaa"; +var blocklist_descriptor_uuid = "07711111-6104-0970-7011-1107105110aa"; var characteristic_user_description_uuid = "00002901-0000-1000-8000-00805f9b34fb"; // Bluetooth Adapter types: diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/getCharacteristic/invalid-characteristic-name.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/getCharacteristic/invalid-characteristic-name.html index 46c46938127..0e3eb66670d 100644 --- a/tests/wpt/mozilla/tests/mozilla/bluetooth/getCharacteristic/invalid-characteristic-name.html +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/getCharacteristic/invalid-characteristic-name.html @@ -12,6 +12,6 @@ promise_test(t => { }) .then(device => device.gatt.connect()) .then(gattServer => gattServer.getPrimaryService(generic_access.name)) - .then(service => promise_rejects(t, 'SyntaxError', service.getCharacteristic(wrong.name))); -}, 'Wrong Characteristic name. Reject with SyntaxError.'); + .then(service => promise_rejects(t, new TypeError(), service.getCharacteristic(wrong.name))); +}, 'Wrong Characteristic name. Reject with TypeError.'); </script> diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/getCharacteristics/invalid-characteristic-name.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/getCharacteristics/invalid-characteristic-name.html index 00820d06f37..d053a29fd7f 100644 --- a/tests/wpt/mozilla/tests/mozilla/bluetooth/getCharacteristics/invalid-characteristic-name.html +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/getCharacteristics/invalid-characteristic-name.html @@ -12,6 +12,6 @@ promise_test(t => { }) .then(device => device.gatt.connect()) .then(gattServer => gattServer.getPrimaryService(generic_access.name)) - .then(service => promise_rejects(t, 'SyntaxError', service.getCharacteristics(wrong.name))); -}, 'Invalid Characteristic name. Reject with SyntaxError.'); + .then(service => promise_rejects(t, new TypeError(), service.getCharacteristics(wrong.name))); +}, 'Invalid Characteristic name. Reject with TypeError.'); </script> diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/getDescriptor/invalid-descriptor-name.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/getDescriptor/invalid-descriptor-name.html index 1a56b8e6a15..b97f8ef1661 100644 --- a/tests/wpt/mozilla/tests/mozilla/bluetooth/getDescriptor/invalid-descriptor-name.html +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/getDescriptor/invalid-descriptor-name.html @@ -13,6 +13,6 @@ promise_test(t => { .then(device => device.gatt.connect()) .then(gattServer => gattServer.getPrimaryService(generic_access.name)) .then(service => service.getCharacteristic(device_name.name)) - .then(characteristic => promise_rejects(t, 'SyntaxError', characteristic.getDescriptor(wrong.name))); -}, 'Wrong descriptor name. Reject with SyntaxError.'); + .then(characteristic => promise_rejects(t, new TypeError(), characteristic.getDescriptor(wrong.name))); +}, 'Wrong descriptor name. Reject with TypeError.'); </script> diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/getDescriptors/invalid-descriptor-name.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/getDescriptors/invalid-descriptor-name.html index ddcc08c04bd..8f3dcedd71d 100644 --- a/tests/wpt/mozilla/tests/mozilla/bluetooth/getDescriptors/invalid-descriptor-name.html +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/getDescriptors/invalid-descriptor-name.html @@ -13,6 +13,6 @@ promise_test(t => { .then(device => device.gatt.connect()) .then(gattServer => gattServer.getPrimaryService(generic_access.name)) .then(service => service.getCharacteristic(device_name.name)) - .then(characteristic => promise_rejects(t, 'SyntaxError', characteristic.getDescriptors(wrong.name))); -}, 'Wrong descriptor name. Reject with SyntaxError.'); + .then(characteristic => promise_rejects(t, new TypeError(), characteristic.getDescriptors(wrong.name))); +}, 'Wrong descriptor name. Reject with TypeError.'); </script> diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/getPrimaryService/invalid-service-name.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/getPrimaryService/invalid-service-name.html index f23f0201951..ede8bc812e7 100644 --- a/tests/wpt/mozilla/tests/mozilla/bluetooth/getPrimaryService/invalid-service-name.html +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/getPrimaryService/invalid-service-name.html @@ -10,6 +10,6 @@ promise_test(t => { filters: [{services: [heart_rate.name]}] }) .then(device => device.gatt.connect()) - .then(gattServer => promise_rejects(t, 'SyntaxError', gattServer.getPrimaryService(wrong.name))); -}, 'Wrong Service name. Reject with SyntaxError.'); + .then(gattServer => promise_rejects(t, new TypeError(), gattServer.getPrimaryService(wrong.name))); +}, 'Wrong Service name. Reject with TypeError.'); </script> diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/getPrimaryServices/invalid-service-name.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/getPrimaryServices/invalid-service-name.html index a558b6cedfd..5cb63103eb3 100644 --- a/tests/wpt/mozilla/tests/mozilla/bluetooth/getPrimaryServices/invalid-service-name.html +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/getPrimaryServices/invalid-service-name.html @@ -10,6 +10,6 @@ promise_test(t => { filters: [{services: [heart_rate.name]}] }) .then(device => device.gatt.connect()) - .then(gattServer => promise_rejects(t, 'SyntaxError', gattServer.getPrimaryServices(wrong.name))); -}, 'Wrong Service name. Reject with SyntaxError.'); + .then(gattServer => promise_rejects(t, new TypeError(), gattServer.getPrimaryServices(wrong.name))); +}, 'Wrong Service name. Reject with TypeError.'); </script> diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/idl-BluetoothUUID.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/idl-BluetoothUUID.html index 3b90cf7a318..27f8f846384 100644 --- a/tests/wpt/mozilla/tests/mozilla/bluetooth/idl-BluetoothUUID.html +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/idl-BluetoothUUID.html @@ -83,23 +83,23 @@ test(() => { test(() => { let all_caps_uuid = '1A2B3C4D-5E6F-7A8B-9C0D-1E2F3A4B5C6D'; - assert_throws('SyntaxError', () => BluetoothUUID.getService(all_caps_uuid)); - assert_throws('SyntaxError', () => BluetoothUUID.getCharacteristic(all_caps_uuid)); - assert_throws('SyntaxError', () => BluetoothUUID.getDescriptor(all_caps_uuid)); + assert_throws(new TypeError(), () => BluetoothUUID.getService(all_caps_uuid)); + assert_throws(new TypeError(), () => BluetoothUUID.getCharacteristic(all_caps_uuid)); + assert_throws(new TypeError(), () => BluetoothUUID.getDescriptor(all_caps_uuid)); }, 'A UUID String with uppercase letters is an invalid UUID.'); test(() => { let string_alias = 'deadbeef'; - assert_throws('SyntaxError', () => BluetoothUUID.getService(string_alias)); - assert_throws('SyntaxError', () => BluetoothUUID.getCharacteristic(string_alias)); - assert_throws('SyntaxError', () => BluetoothUUID.getDescriptor(string_alias)); + assert_throws(new TypeError(), () => BluetoothUUID.getService(string_alias)); + assert_throws(new TypeError(), () => BluetoothUUID.getCharacteristic(string_alias)); + assert_throws(new TypeError(), () => BluetoothUUID.getDescriptor(string_alias)); }, 'A 32bit *String* alias is invalid.'); test(() => { let invalid_character_uuid = '0000000g-0000-1000-8000-00805f9b34fb'; - assert_throws('SyntaxError', () => BluetoothUUID.getService(invalid_character_uuid)); - assert_throws('SyntaxError', () => BluetoothUUID.getCharacteristic(invalid_character_uuid)); - assert_throws('SyntaxError', () => BluetoothUUID.getDescriptor(invalid_character_uuid)); + assert_throws(new TypeError(), () => BluetoothUUID.getService(invalid_character_uuid)); + assert_throws(new TypeError(), () => BluetoothUUID.getCharacteristic(invalid_character_uuid)); + assert_throws(new TypeError(), () => BluetoothUUID.getDescriptor(invalid_character_uuid)); }, 'A UUID with invalid characters is an invalid UUID.'); test(() => { @@ -112,31 +112,31 @@ test(() => { }, 'A valid UUID from a name.'); test(() => { - assert_throws('SyntaxError', () => { + assert_throws(new TypeError(), () => { BluetoothUUID.getService(aerobic_heart_rate_lower_limit.name); }); - assert_throws('SyntaxError', () => { + assert_throws(new TypeError(), () => { BluetoothUUID.getService(characteristic_extended_properties.name); }); - assert_throws('SyntaxError', () => { + assert_throws(new TypeError(), () => { BluetoothUUID.getCharacteristic(alert_notification.name); }); - assert_throws('SyntaxError', () => { + assert_throws(new TypeError(), () => { BluetoothUUID.getCharacteristic(characteristic_extended_properties.name); }); - assert_throws('SyntaxError', () => { + assert_throws(new TypeError(), () => { BluetoothUUID.getDescriptor(alert_notification.name); }); - assert_throws('SyntaxError', () => { + assert_throws(new TypeError(), () => { BluetoothUUID.getDescriptor(aerobic_heart_rate_lower_limit.name); }); }, 'Make sure attributes don\'t share a map'); test(() => { let wrong_name = 'wrong_name'; - assert_throws('SyntaxError', () => BluetoothUUID.getService(wrong_name)); - assert_throws('SyntaxError', () => BluetoothUUID.getCharacteristic(wrong_name)); - assert_throws('SyntaxError', () => BluetoothUUID.getDescriptor(wrong_name)); + assert_throws(new TypeError(), () => BluetoothUUID.getService(wrong_name)); + assert_throws(new TypeError(), () => BluetoothUUID.getCharacteristic(wrong_name)); + assert_throws(new TypeError(), () => BluetoothUUID.getDescriptor(wrong_name)); }, 'Invalid Descriptor name'); test(() => { @@ -154,25 +154,25 @@ test(() => { assert_equals(BluetoothUUID.canonicalUUID(true), BluetoothUUID.canonicalUUID(1)); assert_throws(new TypeError, () => BluetoothUUID.canonicalUUID(NaN)); // getService - assert_throws('SyntaxError', () => BluetoothUUID.getService(object)); - assert_throws('SyntaxError', () => BluetoothUUID.getService(array)); - assert_throws('SyntaxError', () => BluetoothUUID.getService(func)); - assert_throws('SyntaxError', () => BluetoothUUID.getService(undefined)); - assert_throws('SyntaxError', () => BluetoothUUID.getService(null)); - assert_throws('SyntaxError', () => BluetoothUUID.getService(false)); + assert_throws(new TypeError(), () => BluetoothUUID.getService(object)); + assert_throws(new TypeError(), () => BluetoothUUID.getService(array)); + assert_throws(new TypeError(), () => BluetoothUUID.getService(func)); + assert_throws(new TypeError(), () => BluetoothUUID.getService(undefined)); + assert_throws(new TypeError(), () => BluetoothUUID.getService(null)); + assert_throws(new TypeError(), () => BluetoothUUID.getService(false)); // getCharacteristic - assert_throws('SyntaxError', () => BluetoothUUID.getCharacteristic(object)); - assert_throws('SyntaxError', () => BluetoothUUID.getCharacteristic(array)); - assert_throws('SyntaxError', () => BluetoothUUID.getCharacteristic(func)); - assert_throws('SyntaxError', () => BluetoothUUID.getCharacteristic(undefined)); - assert_throws('SyntaxError', () => BluetoothUUID.getCharacteristic(null)); - assert_throws('SyntaxError', () => BluetoothUUID.getCharacteristic(false)); + assert_throws(new TypeError(), () => BluetoothUUID.getCharacteristic(object)); + assert_throws(new TypeError(), () => BluetoothUUID.getCharacteristic(array)); + assert_throws(new TypeError(), () => BluetoothUUID.getCharacteristic(func)); + assert_throws(new TypeError(), () => BluetoothUUID.getCharacteristic(undefined)); + assert_throws(new TypeError(), () => BluetoothUUID.getCharacteristic(null)); + assert_throws(new TypeError(), () => BluetoothUUID.getCharacteristic(false)); // getDescriptor - assert_throws('SyntaxError', () => BluetoothUUID.getDescriptor(object)); - assert_throws('SyntaxError', () => BluetoothUUID.getDescriptor(array)); - assert_throws('SyntaxError', () => BluetoothUUID.getDescriptor(func)); - assert_throws('SyntaxError', () => BluetoothUUID.getDescriptor(undefined)); - assert_throws('SyntaxError', () => BluetoothUUID.getDescriptor(null)); - assert_throws('SyntaxError', () => BluetoothUUID.getDescriptor(false)); + assert_throws(new TypeError(), () => BluetoothUUID.getDescriptor(object)); + assert_throws(new TypeError(), () => BluetoothUUID.getDescriptor(array)); + assert_throws(new TypeError(), () => BluetoothUUID.getDescriptor(func)); + assert_throws(new TypeError(), () => BluetoothUUID.getDescriptor(undefined)); + assert_throws(new TypeError(), () => BluetoothUUID.getDescriptor(null)); + assert_throws(new TypeError(), () => BluetoothUUID.getDescriptor(false)); }, 'Non-number and non-strings'); </script> diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-data-key.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-data-key.html index 3fd685d6486..d59d4487f2b 100644 --- a/tests/wpt/mozilla/tests/mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-data-key.html +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-data-key.html @@ -81,8 +81,8 @@ promise_test(t => { window.testRunner.setBluetoothMockDataSet(adapter_type.glucose_heart_rate); let promises = []; wrong_service_data_keys.forEach(args => { - promises.push(promise_rejects(t, 'SyntaxError', window.navigator.bluetooth.requestDevice(args))); + promises.push(promise_rejects(t, new TypeError(), window.navigator.bluetooth.requestDevice(args))); }); return Promise.all(promises); -}, 'Rejects with SyntaxError, if a serviceData key does not convert to a valid uuid.'); +}, 'Rejects with TypeError, if a serviceData key does not convert to a valid uuid.'); </script> diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-optionalServices-member.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-optionalServices-member.html index 752f6765a2e..8500bcaf5fb 100644 --- a/tests/wpt/mozilla/tests/mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-optionalServices-member.html +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-optionalServices-member.html @@ -31,7 +31,7 @@ promise_test(t => { window.testRunner.setBluetoothMockDataSet(adapter_type.empty); let promises = []; test_specs.forEach(args => { - promises.push(promise_rejects(t, 'SyntaxError', window.navigator.bluetooth.requestDevice(args))); + promises.push(promise_rejects(t, new TypeError(), window.navigator.bluetooth.requestDevice(args))); }); return Promise.all(promises); }, 'Invalid optional service must reject the promise.'); diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-services-member.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-services-member.html index cf249d87e19..5b23c65c877 100644 --- a/tests/wpt/mozilla/tests/mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-services-member.html +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-services-member.html @@ -30,7 +30,7 @@ promise_test(t => { window.testRunner.setBluetoothMockDataSet(adapter_type.empty); let promises = []; test_specs.forEach(args => { - promises.push(promise_rejects(t, 'SyntaxError', window.navigator.bluetooth.requestDevice(args))); + promises.push(promise_rejects(t, new TypeError(), window.navigator.bluetooth.requestDevice(args))); }); return Promise.all(promises); }, 'Invalid optional service must reject the promise.'); |