Fix some misused promise_tests.

This commit is contained in:
Ms2ger 2016-11-07 16:06:59 +01:00
parent dd34b2a335
commit a059b3e320
3 changed files with 8 additions and 15 deletions

View file

@ -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>

View file

@ -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>

View file

@ -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) {