mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Fix some misused promise_tests.
This commit is contained in:
parent
dd34b2a335
commit
a059b3e320
3 changed files with 8 additions and 15 deletions
|
@ -4,13 +4,8 @@
|
|||
<script src="/bluetooth/bluetooth-helpers.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
promise_test(() => {
|
||||
promise_test(t => {
|
||||
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
|
||||
try {
|
||||
window.navigator.bluetooth.requestDevice()
|
||||
.then(() => assert_unreached('requestDevice() should have thrown an error'));
|
||||
} catch(error) {
|
||||
assert_equals('TypeError', error.name);
|
||||
}
|
||||
return promise_rejects(t, new TypeError(), window.navigator.bluetooth.requestDevice());
|
||||
}, 'requestDevice() requires an argument.');
|
||||
</script>
|
||||
|
|
|
@ -4,13 +4,11 @@
|
|||
<script src="/bluetooth/bluetooth-helpers.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
promise_test(() => {
|
||||
promise_test(t => {
|
||||
window.testRunner.setBluetoothMockDataSet(adapter_type.empty);
|
||||
try {
|
||||
window.navigator.bluetooth.requestDevice([{}, {optionalServices: ['wrong_service']}])
|
||||
.then(() => assert_unreached('requestDevice() should have thrown an error'));
|
||||
} catch(error) {
|
||||
assert_equals('TypeError', error.name);
|
||||
}
|
||||
return promise_rejects(
|
||||
t,
|
||||
new TypeError(),
|
||||
window.navigator.bluetooth.requestDevice([{}, {optionalServices: ['wrong_service']}]));
|
||||
}, 'RequestDeviceOptions requires a |filters| member.');
|
||||
</script>
|
||||
|
|
|
@ -36,7 +36,7 @@ promise_test(function() {
|
|||
}, "Test: Service Worker Registration property scope when provided a scope");
|
||||
|
||||
promise_test(function (p) {
|
||||
promise_rejects(p, new TypeError(), register_sw('./in%5Csome%5fdir/sw.js'));
|
||||
return promise_rejects(p, new TypeError(), register_sw('./in%5Csome%5fdir/sw.js'));
|
||||
}, "Test: Throws Error when Invalid Url Path");
|
||||
|
||||
promise_test(function (p) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue