Auto merge of #25783 - servo-wpt-sync:wpt_update_17-02-2020, r=jdm

Sync WPT with upstream (17-02-2020)

Automated downstream sync of changes from upstream as of 17-02-2020.
[no-wpt-sync]
r? @servo-wpt-sync
This commit is contained in:
bors-servo 2020-02-19 21:58:50 -05:00 committed by GitHub
commit f5ff38b875
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4440 changed files with 664501 additions and 857552 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,4 @@
[idl-BluetoothUUID.html]
[Non-number and non-strings]
expected: FAIL

View file

@ -1,5 +0,0 @@
[htmllabel-activation.html]
type: testharness
[If label's 1st child (submit) is disabled, click should have no impact]
expected: FAIL

View file

@ -0,0 +1,5 @@
[paint_timing.html]
expected: ERROR
[Performance entries observer]
expected: NOTRUN

View file

@ -0,0 +1,7 @@
[window-postmessage-sameorigin.html]
[explicit invalid url, cloneable string message (handler)]
expected: FAIL
[explicit invalid url, cloneable string message (listener)]
expected: FAIL

View file

@ -12,7 +12,7 @@ promise_test(t => {
.then(device => {
var gatt_server = device.gatt;
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
return promise_rejects(t, 'NetworkError', gatt_server.connect());
return promise_rejects_dom(t, 'NetworkError', gatt_server.connect());
});
}, 'Device goes out of range. Reject with NetworkError.');
</script>

View file

@ -11,6 +11,6 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryService(device_information.name))
.then(service => promise_rejects(t, 'SecurityError', service.getCharacteristic(serial_number_string.name)));
.then(service => promise_rejects_dom(t, 'SecurityError', service.getCharacteristic(serial_number_string.name)));
}, 'Serial Number String characteristic is blocklisted.');
</script>

View file

@ -12,6 +12,6 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryService(generic_access.name))
.then(service => promise_rejects(t, 'NotFoundError', service.getCharacteristic(battery_level.name)));
.then(service => promise_rejects_dom(t, 'NotFoundError', service.getCharacteristic(battery_level.name)));
}, 'Request for absent characteristic. Reject with NotFoundError.');
</script>

View file

@ -14,7 +14,7 @@ promise_test(t => {
.then(gattServer => gattServer.getPrimaryService(generic_access.name))
.then(service => {
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
return promise_rejects(t, 'NetworkError', service.getCharacteristic(device_name.uuid));
return promise_rejects_dom(t, 'NetworkError', service.getCharacteristic(device_name.uuid));
});
}, 'Device goes out of range. Reject with NetworkError.');
</script>

View file

@ -15,7 +15,7 @@ promise_test(t => {
return gattServer.getPrimaryService(generic_access.name)
.then(service => {
gattServer.disconnect();
return promise_rejects(t, 'NetworkError', service.getCharacteristic(device_name.uuid));
return promise_rejects_dom(t, 'NetworkError', service.getCharacteristic(device_name.uuid));
});
});
}, 'disconnect() called before getCharacteristic. Reject with NetworkError.');

View file

@ -14,7 +14,7 @@ promise_test(t => {
.then(gattServer => {
return gattServer.getPrimaryService(generic_access.name)
.then(service => {
let promise = promise_rejects(t, 'NetworkError', service.getCharacteristic(device_name.uuid));
let promise = promise_rejects_dom(t, 'NetworkError', service.getCharacteristic(device_name.uuid));
gattServer.disconnect();
return promise;
});

View file

@ -23,13 +23,13 @@ promise_test(t => {
})
.then(characteristic => {
let promises = [];
promises.push(promise_rejects(t, 'InvalidStateError', characteristic.getDescriptor(number_of_digitals.name)));
promises.push(promise_rejects(t, 'InvalidStateError', characteristic.getDescriptors(number_of_digitals.name)));
promises.push(promise_rejects(t, 'InvalidStateError', characteristic.getDescriptors()));
promises.push(promise_rejects(t, 'InvalidStateError', characteristic.readValue()));
promises.push(promise_rejects(t, 'InvalidStateError', characteristic.writeValue(new Uint8Array(1))));
promises.push(promise_rejects(t, 'InvalidStateError', characteristic.startNotifications()));
promises.push(promise_rejects(t, 'InvalidStateError', characteristic.stopNotifications()));
promises.push(promise_rejects_dom(t, 'InvalidStateError', characteristic.getDescriptor(number_of_digitals.name)));
promises.push(promise_rejects_dom(t, 'InvalidStateError', characteristic.getDescriptors(number_of_digitals.name)));
promises.push(promise_rejects_dom(t, 'InvalidStateError', characteristic.getDescriptors()));
promises.push(promise_rejects_dom(t, 'InvalidStateError', characteristic.readValue()));
promises.push(promise_rejects_dom(t, 'InvalidStateError', characteristic.writeValue(new Uint8Array(1))));
promises.push(promise_rejects_dom(t, 'InvalidStateError', characteristic.startNotifications()));
promises.push(promise_rejects_dom(t, 'InvalidStateError', characteristic.stopNotifications()));
return Promise.all(promises);
});
}, 'Calls on a characteristic after we disconnect and connect again. Should reject with InvalidStateError.');

View file

@ -12,6 +12,6 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryService(generic_access.name))
.then(service => promise_rejects(t, new TypeError(), service.getCharacteristic(wrong.name)));
.then(service => promise_rejects_js(t, TypeError, service.getCharacteristic(wrong.name)));
}, 'Wrong Characteristic name. Reject with TypeError.');
</script>

View file

@ -13,7 +13,7 @@ promise_test(t => {
.then(gattServer => {
return gattServer.getPrimaryService(heart_rate.name)
.then(service => {
let promise = promise_rejects(t, 'NetworkError', service.getCharacteristic(heart_rate_measurement.uuid));
let promise = promise_rejects_dom(t, 'NetworkError', service.getCharacteristic(heart_rate_measurement.uuid));
gattServer.disconnect();
return gattServer.connect()
.then(() => promise);

View file

@ -14,7 +14,7 @@ promise_test(t => {
.then(gattServer => gattServer.getPrimaryService(generic_access.name))
.then(service => {
window.testRunner.setBluetoothMockDataSet(adapter_type.missing_service_heart_rate);
return promise_rejects(t, 'InvalidStateError', service.getCharacteristic(device_name.uuid));
return promise_rejects_dom(t, 'InvalidStateError', service.getCharacteristic(device_name.uuid));
});
}, 'Service is removed. Reject with InvalidStateError.');
</script>

View file

@ -11,6 +11,6 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryService(device_information.name))
.then(service => promise_rejects(t, 'SecurityError', service.getCharacteristics(serial_number_string.name)));
.then(service => promise_rejects_dom(t, 'SecurityError', service.getCharacteristics(serial_number_string.name)));
}, 'Serial Number String characteristic is blocklisted. Should reject with SecurityError.');
</script>

View file

@ -11,6 +11,6 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryService(device_information.name))
.then(service => promise_rejects(t, 'NotFoundError', service.getCharacteristics()));
.then(service => promise_rejects_dom(t, 'NotFoundError', service.getCharacteristics()));
}, 'The Device Information service is composed of blocklisted characteristics so we shouldn\'t find any.');
</script>

View file

@ -11,6 +11,6 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryService(heart_rate.name))
.then(service => promise_rejects(t, 'NotFoundError', service.getCharacteristics(battery_level.name)));
.then(service => promise_rejects_dom(t, 'NotFoundError', service.getCharacteristics(battery_level.name)));
}, 'Request for absent characteristics with UUID. Reject with NotFoundError.');
</script>

View file

@ -11,6 +11,6 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryService(heart_rate.name))
.then(service => promise_rejects(t, 'NotFoundError', service.getCharacteristics()));
.then(service => promise_rejects_dom(t, 'NotFoundError', service.getCharacteristics()));
}, 'Request for absent characteristics. Reject with NotFoundError.');
</script>

View file

@ -13,7 +13,7 @@ promise_test(t => {
.then(gattServer => gattServer.getPrimaryService(heart_rate.name))
.then(service => {
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
return promise_rejects(t, 'NetworkError', service.getCharacteristics(heart_rate_measurement.name));
return promise_rejects_dom(t, 'NetworkError', service.getCharacteristics(heart_rate_measurement.name));
});
}, 'Device goes out of range with UUID. Reject with NetworkError.');
</script>

View file

@ -13,7 +13,7 @@ promise_test(t => {
.then(gattServer => gattServer.getPrimaryService(heart_rate.name))
.then(service => {
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
return promise_rejects(t, 'NetworkError', service.getCharacteristics());
return promise_rejects_dom(t, 'NetworkError', service.getCharacteristics());
});
}, 'Device goes out of range. Reject with NetworkError.');
</script>

View file

@ -14,7 +14,7 @@ promise_test(t => {
return gattServer.getPrimaryService(heart_rate.name)
.then(service => {
gattServer.disconnect();
return promise_rejects(t, 'NetworkError', service.getCharacteristics(body_sensor_location.alias));
return promise_rejects_dom(t, 'NetworkError', service.getCharacteristics(body_sensor_location.alias));
});
});
}, 'disconnect() called before getCharacteristics. Reject with NetworkError.');

View file

@ -14,7 +14,7 @@ promise_test(t => {
return gattServer.getPrimaryService(heart_rate.name)
.then(service => {
gattServer.disconnect();
return promise_rejects(t, 'NetworkError', service.getCharacteristics());
return promise_rejects_dom(t, 'NetworkError', service.getCharacteristics());
});
});
}, 'disconnect() called before getCharacteristics. Reject with NetworkError.');

View file

@ -13,7 +13,7 @@ promise_test(t => {
.then(gattServer => {
return gattServer.getPrimaryService(heart_rate.name)
.then(service => {
let promise = promise_rejects(t, 'NetworkError', service.getCharacteristics(body_sensor_location.alias));
let promise = promise_rejects_dom(t, 'NetworkError', service.getCharacteristics(body_sensor_location.alias));
gattServer.disconnect();
return promise;
});

View file

@ -13,7 +13,7 @@ promise_test(t => {
.then(gattServer => {
return gattServer.getPrimaryService(heart_rate.name)
.then(service => {
let promise = promise_rejects(t, 'NetworkError', service.getCharacteristics());
let promise = promise_rejects_dom(t, 'NetworkError', service.getCharacteristics());
gattServer.disconnect();
return promise;
});

View file

@ -25,13 +25,13 @@ promise_test(t => {
.then(characteristics => {
let promises = [];
for (let characteristic of characteristics) {
promises.push(promise_rejects(t, 'InvalidStateError', characteristic.getDescriptor(number_of_digitals.name)));
promises.push(promise_rejects(t, 'InvalidStateError', characteristic.getDescriptors(number_of_digitals.name)));
promises.push(promise_rejects(t, 'InvalidStateError', characteristic.getDescriptors()));
promises.push(promise_rejects(t, 'InvalidStateError', characteristic.readValue()));
promises.push(promise_rejects(t, 'InvalidStateError', characteristic.writeValue(new Uint8Array(1))));
promises.push(promise_rejects(t, 'InvalidStateError', characteristic.startNotifications()));
promises.push(promise_rejects(t, 'InvalidStateError', characteristic.stopNotifications()));
promises.push(promise_rejects_dom(t, 'InvalidStateError', characteristic.getDescriptor(number_of_digitals.name)));
promises.push(promise_rejects_dom(t, 'InvalidStateError', characteristic.getDescriptors(number_of_digitals.name)));
promises.push(promise_rejects_dom(t, 'InvalidStateError', characteristic.getDescriptors()));
promises.push(promise_rejects_dom(t, 'InvalidStateError', characteristic.readValue()));
promises.push(promise_rejects_dom(t, 'InvalidStateError', characteristic.writeValue(new Uint8Array(1))));
promises.push(promise_rejects_dom(t, 'InvalidStateError', characteristic.startNotifications()));
promises.push(promise_rejects_dom(t, 'InvalidStateError', characteristic.stopNotifications()));
}
return Promise.all(promises);
});

View file

@ -12,6 +12,6 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryService(generic_access.name))
.then(service => promise_rejects(t, new TypeError(), service.getCharacteristics(wrong.name)));
.then(service => promise_rejects_js(t, TypeError, service.getCharacteristics(wrong.name)));
}, 'Invalid Characteristic name. Reject with TypeError.');
</script>

View file

@ -13,7 +13,7 @@ promise_test(t => {
.then(gattServer => gattServer.getPrimaryService(heart_rate.name))
.then(service => {
window.testRunner.setBluetoothMockDataSet(adapter_type.missing_service_heart_rate);
return promise_rejects(t, 'InvalidStateError', service.getCharacteristic(heart_rate_measurement.name));
return promise_rejects_dom(t, 'InvalidStateError', service.getCharacteristic(heart_rate_measurement.name));
});
}, 'Service is removed. Reject with InvalidStateError.');
</script>

View file

@ -13,7 +13,7 @@ promise_test(t => {
.then(gattServer => gattServer.getPrimaryService(heart_rate.name))
.then(service => {
window.testRunner.setBluetoothMockDataSet(adapter_type.missing_service_heart_rate);
return promise_rejects(t, 'InvalidStateError', service.getCharacteristics());
return promise_rejects_dom(t, 'InvalidStateError', service.getCharacteristics());
});
}, 'Service is removed. Reject with InvalidStateError.');
</script>

View file

@ -12,7 +12,7 @@ promise_test(t => {
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryService(blocklist_test_service_uuid))
.then(service => service.getCharacteristic(blocklist_exclude_reads_characteristic_uuid))
.then(characteristic => promise_rejects(t, 'SecurityError',
.then(characteristic => promise_rejects_dom(t, 'SecurityError',
characteristic.getDescriptor(blocklist_descriptor_uuid)));
}, 'The descriptor is blocklisted.');
</script>

View file

@ -15,7 +15,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
window.testRunner.setBluetoothMockDataSet(adapter_type.missing_characteristic_heart_rate);
return promise_rejects(t, 'InvalidStateError', characteristic.getDescriptor(number_of_digitals.name));
return promise_rejects_dom(t, 'InvalidStateError', characteristic.getDescriptor(number_of_digitals.name));
});
}, 'Characteristic is removed. Reject with InvalidStateError.');
</script>

View file

@ -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, 'NotFoundError', characteristic.getDescriptor(number_of_digitals.name)));
.then(characteristic => promise_rejects_dom(t, 'NotFoundError', characteristic.getDescriptor(number_of_digitals.name)));
}, 'Request for absent descriptor. Reject with NotFoundError.');
</script>

View file

@ -15,7 +15,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
return promise_rejects(t, 'NetworkError', characteristic.getDescriptor(number_of_digitals.name));
return promise_rejects_dom(t, 'NetworkError', characteristic.getDescriptor(number_of_digitals.name));
});
}, 'Device goes out of range. Reject with NetworkError.');
</script>

View file

@ -16,7 +16,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
gattServer.disconnect();
return promise_rejects(t, 'NetworkError', characteristic.getDescriptor(number_of_digitals.name));
return promise_rejects_dom(t, 'NetworkError', characteristic.getDescriptor(number_of_digitals.name));
});
});
}, 'disconnect() called before getDescriptor. Reject with NetworkError.');

View file

@ -15,7 +15,7 @@ promise_test(t => {
return gattServer.getPrimaryService(generic_access.name)
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
let promise = promise_rejects(t, 'NetworkError', characteristic.getDescriptor(number_of_digitals.name));
let promise = promise_rejects_dom(t, 'NetworkError', characteristic.getDescriptor(number_of_digitals.name));
gattServer.disconnect();
return promise;
});

View file

@ -24,8 +24,8 @@ promise_test(t => {
})
.then(descriptor => {
let promises = [];
promises.push(promise_rejects(t, 'InvalidStateError', descriptor.readValue()));
promises.push(promise_rejects(t, 'InvalidStateError', descriptor.writeValue(new Uint8Array(1))));
promises.push(promise_rejects_dom(t, 'InvalidStateError', descriptor.readValue()));
promises.push(promise_rejects_dom(t, 'InvalidStateError', descriptor.writeValue(new Uint8Array(1))));
return Promise.all(promises);
});
}, 'Calls on a descriptor after we disconnect and connect again. Should reject with InvalidStateError.');

View file

@ -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, new TypeError(), characteristic.getDescriptor(wrong.name)));
.then(characteristic => promise_rejects_js(t, TypeError, characteristic.getDescriptor(wrong.name)));
}, 'Wrong descriptor name. Reject with TypeError.');
</script>

View file

@ -12,7 +12,7 @@ promise_test(t => {
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryService(blocklist_test_service_uuid))
.then(service => service.getCharacteristic(blocklist_exclude_reads_characteristic_uuid))
.then(characteristic => promise_rejects(t, 'SecurityError',
.then(characteristic => promise_rejects_dom(t, 'SecurityError',
characteristic.getDescriptors(blocklist_descriptor_uuid)));
}, 'The descriptor is blocklisted. Should reject with SecurityError.');
</script>

View file

@ -15,7 +15,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
window.testRunner.setBluetoothMockDataSet(adapter_type.missing_characteristic_heart_rate);
return promise_rejects(t, 'InvalidStateError', characteristic.getDescriptors(number_of_digitals.name));
return promise_rejects_dom(t, 'InvalidStateError', characteristic.getDescriptors(number_of_digitals.name));
});
}, 'Characteristic is removed. Reject with InvalidStateError.');
</script>

View file

@ -15,7 +15,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
window.testRunner.setBluetoothMockDataSet(adapter_type.missing_characteristic_heart_rate);
return promise_rejects(t, 'InvalidStateError', characteristic.getDescriptors());
return promise_rejects_dom(t, 'InvalidStateError', characteristic.getDescriptors());
});
}, 'Characteristic is removed. Reject with InvalidStateError.');
</script>

View file

@ -13,7 +13,7 @@ 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, 'NotFoundError',
.then(characteristic => promise_rejects_dom(t, 'NotFoundError',
characteristic.getDescriptors(number_of_digitals.name)));
}, 'Request for absent descriptors with UUID. Reject with NotFoundError.');
</script>

View file

@ -13,7 +13,7 @@ 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, 'NotFoundError',
.then(characteristic => promise_rejects_dom(t, 'NotFoundError',
characteristic.getDescriptors()));
}, 'Request for absent descriptors with UUID. Reject with NotFoundError.');
</script>

View file

@ -15,7 +15,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
return promise_rejects(t, 'NetworkError', characteristic.getDescriptors(number_of_digitals.name));
return promise_rejects_dom(t, 'NetworkError', characteristic.getDescriptors(number_of_digitals.name));
});
}, 'Device goes out of range. Reject with NetworkError.');
</script>

View file

@ -15,7 +15,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
return promise_rejects(t, 'NetworkError', characteristic.getDescriptors());
return promise_rejects_dom(t, 'NetworkError', characteristic.getDescriptors());
});
}, 'Device goes out of range. Reject with NetworkError.');
</script>

View file

@ -16,7 +16,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
gattServer.disconnect();
return promise_rejects(t, 'NetworkError', characteristic.getDescriptors(number_of_digitals.alias));
return promise_rejects_dom(t, 'NetworkError', characteristic.getDescriptors(number_of_digitals.alias));
});
});
}, 'disconnect() called before getDescriptors. Reject with NetworkError.');

View file

@ -16,7 +16,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
gattServer.disconnect();
return promise_rejects(t, 'NetworkError', characteristic.getDescriptors());
return promise_rejects_dom(t, 'NetworkError', characteristic.getDescriptors());
});
});
}, 'disconnect() called before getDescriptors. Reject with NetworkError.');

View file

@ -15,7 +15,7 @@ promise_test(t => {
return gattServer.getPrimaryService(generic_access.name)
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
let promise = promise_rejects(t, 'NetworkError', characteristic.getDescriptors(number_of_digitals.alias));
let promise = promise_rejects_dom(t, 'NetworkError', characteristic.getDescriptors(number_of_digitals.alias));
gattServer.disconnect();
return promise;
});

View file

@ -15,7 +15,7 @@ promise_test(t => {
return gattServer.getPrimaryService(generic_access.name)
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
let promise = promise_rejects(t, 'NetworkError', characteristic.getDescriptors());
let promise = promise_rejects_dom(t, 'NetworkError', characteristic.getDescriptors());
gattServer.disconnect();
return promise;
});

View file

@ -25,9 +25,9 @@ promise_test(t => {
.then(descriptors => {
let promises = [];
for (let descriptor of descriptors) {
promises.push(promise_rejects(t, 'InvalidStateError', descriptor.readValue()));
promises.push(promise_rejects_dom(t, 'InvalidStateError', descriptor.readValue()));
if (descriptor.uuid != client_characteristic_configuration.uuid)
promises.push(promise_rejects(t, 'InvalidStateError', descriptor.writeValue(new Uint8Array(1))));
promises.push(promise_rejects_dom(t, 'InvalidStateError', descriptor.writeValue(new Uint8Array(1))));
}
return Promise.all(promises);
});

View file

@ -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, new TypeError(), characteristic.getDescriptors(wrong.name)));
.then(characteristic => promise_rejects_js(t, TypeError, characteristic.getDescriptors(wrong.name)));
}, 'Wrong descriptor name. Reject with TypeError.');
</script>

View file

@ -12,7 +12,7 @@ promise_test(t => {
.then(device => device.gatt.connect())
.then(gattServer => {
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
return promise_rejects(t, 'NetworkError', gattServer.getPrimaryService(generic_access.name));
return promise_rejects_dom(t, 'NetworkError', gattServer.getPrimaryService(generic_access.name));
});
}, 'Device goes out of range. Reject with NetworkError.');
</script>

View file

@ -12,7 +12,7 @@ promise_test(t => {
.then(device => device.gatt.connect())
.then(gattServer => {
gattServer.disconnect();
return promise_rejects(t, 'NetworkError', gattServer.getPrimaryService(heart_rate.name));
return promise_rejects_dom(t, 'NetworkError', gattServer.getPrimaryService(heart_rate.name));
});
}, 'disconnect() called before getPrimaryService. Reject with NetworkError.');
</script>

View file

@ -11,7 +11,7 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => {
let promise = promise_rejects(t, 'NetworkError', gattServer.getPrimaryService(heart_rate.name));
let promise = promise_rejects_dom(t, 'NetworkError', gattServer.getPrimaryService(heart_rate.name));
gattServer.disconnect();
return promise;
});

View file

@ -22,9 +22,9 @@ promise_test(t => {
})
.then(service => {
let promises = [];
promises.push(promise_rejects(t, 'InvalidStateError', service.getCharacteristic(body_sensor_location.name)));
promises.push(promise_rejects(t, 'InvalidStateError', service.getCharacteristics(body_sensor_location.name)));
promises.push(promise_rejects(t, 'InvalidStateError', service.getCharacteristics()));
promises.push(promise_rejects_dom(t, 'InvalidStateError', service.getCharacteristic(body_sensor_location.name)));
promises.push(promise_rejects_dom(t, 'InvalidStateError', service.getCharacteristics(body_sensor_location.name)));
promises.push(promise_rejects_dom(t, 'InvalidStateError', service.getCharacteristics()));
return Promise.all(promises);
});
}, 'Calls on a service after we disconnect and connect again. Should reject with InvalidStateError.');

View file

@ -9,6 +9,6 @@ promise_test(t => {
return window.navigator.bluetooth.requestDevice({
filters: [{services: [heart_rate.name]}]
})
.then(device => promise_rejects(t, 'NetworkError', device.gatt.getPrimaryService(heart_rate.name)));
.then(device => promise_rejects_dom(t, 'NetworkError', device.gatt.getPrimaryService(heart_rate.name)));
}, 'getPrimaryService called before connecting. Reject with NetworkError.');
</script>

View file

@ -10,6 +10,6 @@ promise_test(t => {
filters: [{services: [heart_rate.name]}]
})
.then(device => device.gatt.connect())
.then(gattServer => promise_rejects(t, new TypeError(), gattServer.getPrimaryService(wrong.name)));
.then(gattServer => promise_rejects_js(t, TypeError, gattServer.getPrimaryService(wrong.name)));
}, 'Wrong Service name. Reject with TypeError.');
</script>

View file

@ -12,8 +12,8 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => Promise.all([
promise_rejects(t, expected, gattServer.getPrimaryService(glucose.alias)),
promise_rejects(t, expected, gattServer.getPrimaryService(glucose.name)),
promise_rejects(t, expected, gattServer.getPrimaryService(glucose.uuid))]));
promise_rejects_dom(t, expected, gattServer.getPrimaryService(glucose.alias)),
promise_rejects_dom(t, expected, gattServer.getPrimaryService(glucose.name)),
promise_rejects_dom(t, expected, gattServer.getPrimaryService(glucose.uuid))]));
}, 'Request for absent service without permission. Reject with SecurityError.');
</script>

View file

@ -12,8 +12,8 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => Promise.all([
promise_rejects(t, expected, gattServer.getPrimaryService(generic_access.alias)),
promise_rejects(t, expected, gattServer.getPrimaryService(generic_access.name)),
promise_rejects(t, expected, gattServer.getPrimaryService(generic_access.uuid))]));
promise_rejects_dom(t, expected, gattServer.getPrimaryService(generic_access.alias)),
promise_rejects_dom(t, expected, gattServer.getPrimaryService(generic_access.name)),
promise_rejects_dom(t, expected, gattServer.getPrimaryService(generic_access.uuid))]));
}, 'Request for present service without permission. Reject with SecurityError.');
</script>

View file

@ -11,6 +11,6 @@ promise_test(t => {
optionalServices: [glucose.name]
})
.then(device => device.gatt.connect())
.then(gattServer => promise_rejects(t, 'NotFoundError', gattServer.getPrimaryService(glucose.name)));
.then(gattServer => promise_rejects_dom(t, 'NotFoundError', gattServer.getPrimaryService(glucose.name)));
}, 'Request for absent service. Reject with NotFoundError.');
</script>

View file

@ -11,6 +11,6 @@ promise_test(t => {
optionalServices: [human_interface_device.name]
})
.then(device => device.gatt.connect())
.then(gattServer => promise_rejects(t, 'SecurityError', gattServer.getPrimaryServices(human_interface_device.name)));
.then(gattServer => promise_rejects_dom(t, 'SecurityError', gattServer.getPrimaryServices(human_interface_device.name)));
}, 'Request for services. Does not return blocklisted service.');
</script>

View file

@ -13,7 +13,7 @@ promise_test(t => {
.then(device => device.gatt.connect())
.then(gattServer => {
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
return promise_rejects(t, 'NetworkError', gattServer.getPrimaryServices(generic_access.name));
return promise_rejects_dom(t, 'NetworkError', gattServer.getPrimaryServices(generic_access.name));
});
}, 'Device goes out of range. Reject with NetworkError.');
</script>

View file

@ -13,7 +13,7 @@ promise_test(t => {
.then(device => device.gatt.connect())
.then(gattServer => {
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
return promise_rejects(t, 'NetworkError', gattServer.getPrimaryServices());
return promise_rejects_dom(t, 'NetworkError', gattServer.getPrimaryServices());
});
}, 'Device goes out of range. Reject with NetworkError.');
</script>

View file

@ -13,7 +13,7 @@ promise_test(t => {
.then(device => device.gatt.connect())
.then(gattServer => {
gattServer.disconnect();
return promise_rejects(t, 'NetworkError', gattServer.getPrimaryServices(heart_rate.name));
return promise_rejects_dom(t, 'NetworkError', gattServer.getPrimaryServices(heart_rate.name));
});
}, 'disconnect() called before getPrimaryServices. Reject with NetworkError.');
</script>

View file

@ -13,7 +13,7 @@ promise_test(t => {
.then(device => device.gatt.connect())
.then(gattServer => {
gattServer.disconnect();
return promise_rejects(t, 'NetworkError', gattServer.getPrimaryServices());
return promise_rejects_dom(t, 'NetworkError', gattServer.getPrimaryServices());
});
}, 'disconnect() called before getPrimaryServices. Reject with NetworkError.');
</script>

View file

@ -11,7 +11,7 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => {
let promise = promise_rejects(t, 'NetworkError', gattServer.getPrimaryServices(heart_rate.name));
let promise = promise_rejects_dom(t, 'NetworkError', gattServer.getPrimaryServices(heart_rate.name));
gattServer.disconnect();
return promise;
});

View file

@ -11,7 +11,7 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => {
let promise = promise_rejects(t, 'NetworkError', gattServer.getPrimaryServices());
let promise = promise_rejects_dom(t, 'NetworkError', gattServer.getPrimaryServices());
gattServer.disconnect();
return promise;
});

View file

@ -24,9 +24,9 @@ promise_test(t => {
.then(services => {
let promises = [];
for (let service of services) {
promises.push(promise_rejects(t, 'InvalidStateError', service.getCharacteristic(body_sensor_location.name)));
promises.push(promise_rejects(t, 'InvalidStateError', service.getCharacteristics(body_sensor_location.name)));
promises.push(promise_rejects(t, 'InvalidStateError', service.getCharacteristics()));
promises.push(promise_rejects_dom(t, 'InvalidStateError', service.getCharacteristic(body_sensor_location.name)));
promises.push(promise_rejects_dom(t, 'InvalidStateError', service.getCharacteristics(body_sensor_location.name)));
promises.push(promise_rejects_dom(t, 'InvalidStateError', service.getCharacteristics()));
}
return Promise.all(promises);
});

View file

@ -9,6 +9,6 @@ promise_test(t => {
return window.navigator.bluetooth.requestDevice({
filters: [{services: [heart_rate.name]}]
})
.then(device => promise_rejects(t, 'NetworkError', device.gatt.getPrimaryServices(heart_rate.name)));
.then(device => promise_rejects_dom(t, 'NetworkError', device.gatt.getPrimaryServices(heart_rate.name)));
}, 'getPrimaryServices called before connecting. Reject with NetworkError.');
</script>

View file

@ -9,6 +9,6 @@ promise_test(t => {
return window.navigator.bluetooth.requestDevice({
filters: [{services: [heart_rate.name]}]
})
.then(device => promise_rejects(t, 'NetworkError', device.gatt.getPrimaryServices()));
.then(device => promise_rejects_dom(t, 'NetworkError', device.gatt.getPrimaryServices()));
}, 'getPrimaryServices called before connecting. Reject with NetworkError.');
</script>

View file

@ -10,6 +10,6 @@ promise_test(t => {
filters: [{services: [heart_rate.name]}]
})
.then(device => device.gatt.connect())
.then(gattServer => promise_rejects(t, new TypeError(), gattServer.getPrimaryServices(wrong.name)));
.then(gattServer => promise_rejects_js(t, TypeError, gattServer.getPrimaryServices(wrong.name)));
}, 'Wrong Service name. Reject with TypeError.');
</script>

View file

@ -12,8 +12,8 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => Promise.all([
promise_rejects(t, expected, gattServer.getPrimaryServices(glucose.alias)),
promise_rejects(t, expected, gattServer.getPrimaryServices(glucose.name)),
promise_rejects(t, expected, gattServer.getPrimaryServices(glucose.uuid))]));
promise_rejects_dom(t, expected, gattServer.getPrimaryServices(glucose.alias)),
promise_rejects_dom(t, expected, gattServer.getPrimaryServices(glucose.name)),
promise_rejects_dom(t, expected, gattServer.getPrimaryServices(glucose.uuid))]));
}, 'Request for absent service without permission. Reject with SecurityError.');
</script>

View file

@ -12,8 +12,8 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => Promise.all([
promise_rejects(t, expected, gattServer.getPrimaryServices(generic_access.alias)),
promise_rejects(t, expected, gattServer.getPrimaryServices(generic_access.name)),
promise_rejects(t, expected, gattServer.getPrimaryServices(generic_access.uuid))]));
promise_rejects_dom(t, expected, gattServer.getPrimaryServices(generic_access.alias)),
promise_rejects_dom(t, expected, gattServer.getPrimaryServices(generic_access.name)),
promise_rejects_dom(t, expected, gattServer.getPrimaryServices(generic_access.uuid))]));
}, 'Request for present service without permission. Reject with SecurityError.');
</script>

View file

@ -10,6 +10,6 @@ promise_test(t => {
filters: [{name: mock_device_name.heart_rate}]
})
.then(device => device.gatt.connect())
.then(gattServer => promise_rejects(t, 'NotFoundError', gattServer.getPrimaryServices()));
.then(gattServer => promise_rejects_dom(t, 'NotFoundError', gattServer.getPrimaryServices()));
}, 'Request for present service without permission. Reject with NotFoundError.');
</script>

View file

@ -11,6 +11,6 @@ promise_test(t => {
optionalServices: [glucose.name]
})
.then(device => device.gatt.connect())
.then(gattServer => promise_rejects(t, 'NotFoundError', gattServer.getPrimaryServices(glucose.name)));
.then(gattServer => promise_rejects_dom(t, 'NotFoundError', gattServer.getPrimaryServices(glucose.name)));
}, 'Request for absent service. Reject with NotFoundError.');
</script>

View file

@ -11,6 +11,6 @@ promise_test(t => {
optionalServices: [generic_access.name]
})
.then(device => device.gatt.connect())
.then(gattServer => promise_rejects(t, 'NotFoundError', gattServer.getPrimaryServices()));
.then(gattServer => promise_rejects_dom(t, 'NotFoundError', gattServer.getPrimaryServices()));
}, 'Request for absent service. Reject with NotFoundError.');
</script>

View file

@ -83,23 +83,23 @@ test(() => {
test(() => {
let all_caps_uuid = '1A2B3C4D-5E6F-7A8B-9C0D-1E2F3A4B5C6D';
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));
assert_throws_js(TypeError, () => BluetoothUUID.getService(all_caps_uuid));
assert_throws_js(TypeError, () => BluetoothUUID.getCharacteristic(all_caps_uuid));
assert_throws_js(TypeError, () => BluetoothUUID.getDescriptor(all_caps_uuid));
}, 'A UUID String with uppercase letters is an invalid UUID.');
test(() => {
let string_alias = 'deadbeef';
assert_throws(new TypeError(), () => BluetoothUUID.getService(string_alias));
assert_throws(new TypeError(), () => BluetoothUUID.getCharacteristic(string_alias));
assert_throws(new TypeError(), () => BluetoothUUID.getDescriptor(string_alias));
assert_throws_js(TypeError, () => BluetoothUUID.getService(string_alias));
assert_throws_js(TypeError, () => BluetoothUUID.getCharacteristic(string_alias));
assert_throws_js(TypeError, () => BluetoothUUID.getDescriptor(string_alias));
}, 'A 32bit *String* alias is invalid.');
test(() => {
let invalid_character_uuid = '0000000g-0000-1000-8000-00805f9b34fb';
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));
assert_throws_js(TypeError, () => BluetoothUUID.getService(invalid_character_uuid));
assert_throws_js(TypeError, () => BluetoothUUID.getCharacteristic(invalid_character_uuid));
assert_throws_js(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(new TypeError(), () => {
assert_throws_js(TypeError, () => {
BluetoothUUID.getService(aerobic_heart_rate_lower_limit.name);
});
assert_throws(new TypeError(), () => {
assert_throws_js(TypeError, () => {
BluetoothUUID.getService(characteristic_extended_properties.name);
});
assert_throws(new TypeError(), () => {
assert_throws_js(TypeError, () => {
BluetoothUUID.getCharacteristic(alert_notification.name);
});
assert_throws(new TypeError(), () => {
assert_throws_js(TypeError, () => {
BluetoothUUID.getCharacteristic(characteristic_extended_properties.name);
});
assert_throws(new TypeError(), () => {
assert_throws_js(TypeError, () => {
BluetoothUUID.getDescriptor(alert_notification.name);
});
assert_throws(new TypeError(), () => {
assert_throws_js(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(new TypeError(), () => BluetoothUUID.getService(wrong_name));
assert_throws(new TypeError(), () => BluetoothUUID.getCharacteristic(wrong_name));
assert_throws(new TypeError(), () => BluetoothUUID.getDescriptor(wrong_name));
assert_throws_js(TypeError, () => BluetoothUUID.getService(wrong_name));
assert_throws_js(TypeError, () => BluetoothUUID.getCharacteristic(wrong_name));
assert_throws_js(TypeError, () => BluetoothUUID.getDescriptor(wrong_name));
}, 'Invalid Descriptor name');
test(() => {
@ -144,35 +144,35 @@ test(() => {
let array = [];
let func = () => {};
// cannonicalUUID
assert_throws(new TypeError, () => BluetoothUUID.canonicalUUID(object));
assert_throws_js(new TypeError, () => BluetoothUUID.canonicalUUID(object));
// [] converts to '', which converts to 0 before the range check.
assert_equals(BluetoothUUID.canonicalUUID(array), base_uuid);
assert_throws(new TypeError, () => BluetoothUUID.canonicalUUID(func));
assert_throws(new TypeError, () => BluetoothUUID.canonicalUUID(undefined));
assert_throws_js(new TypeError, () => BluetoothUUID.canonicalUUID(func));
assert_throws_js(new TypeError, () => BluetoothUUID.canonicalUUID(undefined));
assert_equals(BluetoothUUID.canonicalUUID(null), base_uuid);
assert_equals(BluetoothUUID.canonicalUUID(false), base_uuid);
assert_equals(BluetoothUUID.canonicalUUID(true), BluetoothUUID.canonicalUUID(1));
assert_throws(new TypeError, () => BluetoothUUID.canonicalUUID(NaN));
assert_throws_js(new TypeError, () => BluetoothUUID.canonicalUUID(NaN));
// getService
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));
assert_throws_js(TypeError, () => BluetoothUUID.getService(object));
assert_throws_js(TypeError, () => BluetoothUUID.getService(array));
assert_throws_js(TypeError, () => BluetoothUUID.getService(func));
assert_throws_js(TypeError, () => BluetoothUUID.getService(undefined));
assert_throws_js(TypeError, () => BluetoothUUID.getService(null));
assert_throws_js(TypeError, () => BluetoothUUID.getService(false));
// getCharacteristic
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));
assert_throws_js(TypeError, () => BluetoothUUID.getCharacteristic(object));
assert_throws_js(TypeError, () => BluetoothUUID.getCharacteristic(array));
assert_throws_js(TypeError, () => BluetoothUUID.getCharacteristic(func));
assert_throws_js(TypeError, () => BluetoothUUID.getCharacteristic(undefined));
assert_throws_js(TypeError, () => BluetoothUUID.getCharacteristic(null));
assert_throws_js(TypeError, () => BluetoothUUID.getCharacteristic(false));
// getDescriptor
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));
assert_throws_js(TypeError, () => BluetoothUUID.getDescriptor(object));
assert_throws_js(TypeError, () => BluetoothUUID.getDescriptor(array));
assert_throws_js(TypeError, () => BluetoothUUID.getDescriptor(func));
assert_throws_js(TypeError, () => BluetoothUUID.getDescriptor(undefined));
assert_throws_js(TypeError, () => BluetoothUUID.getDescriptor(null));
assert_throws_js(TypeError, () => BluetoothUUID.getDescriptor(false));
}, 'Non-number and non-strings');
</script>

View file

@ -14,7 +14,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(blocklist_exclude_reads_characteristic_uuid))
.then(characteristic => {
return characteristic.writeValue(new Uint8Array(1))
.then(() => promise_rejects(t, 'SecurityError', characteristic.readValue()));
.then(() => promise_rejects_dom(t, 'SecurityError', characteristic.readValue()));
});
}, 'Characteristic with exclude-reads fullfills write and rejects read.');
</script>

View file

@ -15,7 +15,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
window.testRunner.setBluetoothMockDataSet(adapter_type.missing_characteristic_heart_rate);
return promise_rejects(t, 'InvalidStateError', characteristic.readValue());
return promise_rejects_dom(t, 'InvalidStateError', characteristic.readValue());
});
}, 'Characteristic gets removed. Reject with InvalidStateError.');
</script>

View file

@ -15,7 +15,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
return promise_rejects(t, 'NetworkError', characteristic.readValue());
return promise_rejects_dom(t, 'NetworkError', characteristic.readValue());
});
}, 'Device goes out of range. Reject with NetworkError.');
</script>

View file

@ -16,7 +16,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
gattServer.disconnect();
return promise_rejects(t, 'NetworkError', characteristic.readValue());
return promise_rejects_dom(t, 'NetworkError', characteristic.readValue());
});
});
}, 'disconnect() called before readValue. Reject with NetworkError.');

View file

@ -16,7 +16,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(heart_rate_measurement.name))
.then(characteristic => characteristic.startNotifications())
.then(characteristic => {
let promise = promise_rejects(t, 'NetworkError', characteristic.readValue());
let promise = promise_rejects_dom(t, 'NetworkError', characteristic.readValue());
gattServer.disconnect();
return promise;
});

View file

@ -15,7 +15,7 @@ promise_test(t => {
.then(service => service.getCharacteristic(device_name.name))
.then(characteristic => {
window.testRunner.setBluetoothMockDataSet(adapter_type.missing_service_heart_rate);
return promise_rejects(t, 'InvalidStateError', characteristic.readValue());
return promise_rejects_dom(t, 'InvalidStateError', characteristic.readValue());
});
}, 'Service gets removed. Reject with InvalidStateError.');
</script>

View file

@ -15,7 +15,7 @@ promise_test(t => {
.then(characteristic => characteristic.getDescriptor(blocklist_exclude_reads_descriptor_uuid))
.then(descriptor => {
return descriptor.writeValue(new Uint8Array(1))
.then(() => promise_rejects(t, 'SecurityError', descriptor.readValue()));
.then(() => promise_rejects_dom(t, 'SecurityError', descriptor.readValue()));
});
}, 'Descriptor with exclude-reads fullfills write and rejects read.');
</script>

View file

@ -16,7 +16,7 @@ promise_test(t => {
.then(characteristic => characteristic.getDescriptor(number_of_digitals.name))
.then(descriptor => {
window.testRunner.setBluetoothMockDataSet(adapter_type.missing_characteristic_heart_rate);
return promise_rejects(t, 'InvalidStateError', descriptor.readValue());
return promise_rejects_dom(t, 'InvalidStateError', descriptor.readValue());
});
}, 'Characteristic gets removed. Reject with InvalidStateError.');
</script>

View file

@ -16,7 +16,7 @@ promise_test(t => {
.then(characteristic => characteristic.getDescriptor(number_of_digitals.name))
.then(descriptor => {
window.testRunner.setBluetoothMockDataSet(adapter_type.missing_descriptor_heart_rate);
return promise_rejects(t, 'InvalidStateError', descriptor.readValue());
return promise_rejects_dom(t, 'InvalidStateError', descriptor.readValue());
});
}, 'Descriptor gets removed. Reject with InvalidStateError.');
</script>

View file

@ -16,7 +16,7 @@ promise_test(t => {
.then(characteristic => characteristic.getDescriptor(number_of_digitals.name))
.then(descriptor => {
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
return promise_rejects(t, 'NetworkError', descriptor.readValue());
return promise_rejects_dom(t, 'NetworkError', descriptor.readValue());
});
}, 'Device goes out of range. Reject with NetworkError.');
</script>

View file

@ -17,7 +17,7 @@ promise_test(t => {
.then(characteristic => characteristic.getDescriptor(number_of_digitals.name))
.then(descriptor => {
gattServer.disconnect();
return promise_rejects(t, 'NetworkError', descriptor.readValue());
return promise_rejects_dom(t, 'NetworkError', descriptor.readValue());
});
});
}, 'disconnect() called before readValue. Reject with NetworkError.');

View file

@ -16,7 +16,7 @@ promise_test(t => {
.then(characteristic => characteristic.getDescriptor(number_of_digitals.name))
.then(descriptor => {
window.testRunner.setBluetoothMockDataSet(adapter_type.missing_service_heart_rate);
return promise_rejects(t, 'InvalidStateError', descriptor.readValue());
return promise_rejects_dom(t, 'InvalidStateError', descriptor.readValue());
});
}, 'Service gets removed. Reject with InvalidStateError.');
</script>

View file

@ -6,8 +6,8 @@
'use strict';
promise_test(t => {
window.testRunner.setBluetoothMockDataSet(adapter_type.glucose_heart_rate);
return promise_rejects(
t, new TypeError(),
return promise_rejects_js(
t, TypeError,
window.navigator.bluetooth.requestDevice({
filters: [{services: [heart_rate.name]}],
acceptAllDevices: true}));

View file

@ -8,6 +8,6 @@ promise_test(t => {
window.testRunner.setBluetoothMockDataSet(adapter_type.two_heart_rate);
return window.navigator.bluetooth.requestDevice({acceptAllDevices: true})
.then(device => device.gatt.connect())
.then(gattServer => promise_rejects(t, 'NotFoundError', gattServer.getPrimaryServices()));
.then(gattServer => promise_rejects_dom(t, 'NotFoundError', gattServer.getPrimaryServices()));
}, 'requestDevice called with acceptAllDevices: true and with no optionalServices. Should not get access to any services.');
</script>

View file

@ -6,7 +6,7 @@
'use strict';
promise_test(t => {
window.testRunner.setBluetoothMockDataSet(adapter_type.not_present);
return promise_rejects(
return promise_rejects_dom(
t, 'NotFoundError', window.navigator.bluetooth.requestDevice({filters: [{services: [generic_access.name]}]}),
'Bluetooth adapter is not present.');
}, 'Reject with NotFoundError if the adapter is not present.');

View file

@ -6,7 +6,7 @@
'use strict';
promise_test(t => {
window.testRunner.setBluetoothMockDataSet(adapter_type.not_powered);
return promise_rejects(
return promise_rejects_dom(
t, 'NotFoundError', window.navigator.bluetooth.requestDevice({filters: [{services: [generic_access.name]}]}),
'Bluetooth adapter is not powered.');
}, 'Reject with NotFoundError if the adapter is off.');

View file

@ -6,7 +6,7 @@
'use strict';
promise_test(t => {
window.testRunner.setBluetoothMockDataSet(adapter_type.blocklist);
return promise_rejects(
return promise_rejects_dom(
t, 'SecurityError', window.navigator.bluetooth.requestDevice({filters: [{services: [human_interface_device.name]}]}),
'Requesting blocklisted service rejects.');
}, 'Reject with SecurityError if requesting a blocklisted service.');

View file

@ -13,7 +13,7 @@ promise_test(t => {
})
.then(device => device.gatt.connect())
.then(gattServer => Promise.all([
promise_rejects(t, expected, gattServer.getPrimaryService(human_interface_device.name)),
promise_rejects(t, expected, gattServer.getPrimaryServices(human_interface_device.name))]));
promise_rejects_dom(t, expected, gattServer.getPrimaryService(human_interface_device.name)),
promise_rejects_dom(t, expected, gattServer.getPrimaryServices(human_interface_device.name))]));
}, 'Blocklisted UUID in optionalServices is removed and access not granted.');
</script>

View file

@ -46,7 +46,7 @@ promise_test(t => {
window.testRunner.setBluetoothMockDataSet(adapter_type.glucose_heart_rate);
let promises = [];
blocklisted_keys.forEach(args => {
promises.push(promise_rejects(t, 'SecurityError', window.navigator.bluetooth.requestDevice(args)));
promises.push(promise_rejects_dom(t, 'SecurityError', window.navigator.bluetooth.requestDevice(args)));
});
return Promise.all(promises);
}, 'Rejects with SecurityError, if a serviceData key is blocklisted.');

View file

@ -6,6 +6,6 @@
'use strict';
promise_test(t => {
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
return promise_rejects(t, new TypeError(), window.navigator.bluetooth.requestDevice({filters: [{}]}));
return promise_rejects_js(t, TypeError, window.navigator.bluetooth.requestDevice({filters: [{}]}));
}, 'A filter must restrict the devices in some way.');
</script>

View file

@ -6,7 +6,7 @@
'use strict';
promise_test(t => {
window.testRunner.setBluetoothMockDataSet(adapter_type.glucose_heart_rate);
return promise_rejects(t, new TypeError(), window.navigator.bluetooth.requestDevice({filters: []}),
return promise_rejects_js(t, TypeError, window.navigator.bluetooth.requestDevice({filters: []}),
'An empty |filters| member should result in a TypeError');
}, 'An empty |filters| member should result in a TypeError');
</script>

View file

@ -31,7 +31,7 @@ promise_test(t => {
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
let promises = [];
test_specs.forEach(args => {
promises.push(promise_rejects(t, new TypeError(), window.navigator.bluetooth.requestDevice(args)));
promises.push(promise_rejects_js(t, TypeError, window.navigator.bluetooth.requestDevice(args)));
});
return Promise.all(promises);
}, 'requestDevice with empty namePrefix. Should reject with TypeError.');

View file

@ -31,7 +31,7 @@ promise_test(t => {
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
let promises = [];
test_specs.forEach(args => {
promises.push(promise_rejects(t, new TypeError(), window.navigator.bluetooth.requestDevice(args)));
promises.push(promise_rejects_js(t, TypeError, window.navigator.bluetooth.requestDevice(args)));
});
return Promise.all(promises);
}, 'Services member must contain at least one service.');

View file

@ -6,7 +6,7 @@
'use strict';
promise_test(t => {
window.testRunner.setBluetoothMockDataSet(adapter_type.glucose_heart_rate);
return promise_rejects(t, new TypeError(), window.navigator.bluetooth.requestDevice({
return promise_rejects_js(t, TypeError, window.navigator.bluetooth.requestDevice({
filters: [{services: [battery_service.name]},
{services: [heart_rate.name]},
{acceptAllDevices: true},

Some files were not shown because too many files have changed in this diff Show more