Update web-platform-tests to revision d7afcb8708eac08a614d161d5622a48172daf7e3

This commit is contained in:
WPT Sync Bot 2019-05-15 10:40:54 -04:00 committed by Josh Matthews
parent 6f8bb4dd40
commit edff458e23
791 changed files with 17647 additions and 10322 deletions

View file

@ -0,0 +1,60 @@
// META: title=SMS Receiver API: Constructor
'use strict';
promise_test(async t => {
let used = false;
new SMSReceiver({
get timeout() {
used = true;
return 60;
}
});
assert_true(used, 'constructor options "timeout" member was used');
}, 'constructor uses timeout property');
promise_test(async t => {
try {
new SMSReceiver({timeout: 0});
assert_unreached('Timeout 0 should reject');
} catch (error) {
assert_equals(error.name, 'TypeError');
}
}, 'constructor throws with invalid timeout (0)');
promise_test(async t => {
try {
new SMSReceiver({timeout: null});
assert_unreached('Timeout of null should reject');
} catch (error) {
assert_equals(error.name, 'TypeError');
}
}, 'constructor throws with invalid timeout (null)');
promise_test(async t => {
try {
new SMSReceiver({timeout: -1});
assert_unreached('Timeout negative numbers should reject');
} catch (error) {
assert_equals(error.name, 'TypeError');
}
}, 'constructor throws with invalid timeout (-1)');
promise_test(async t => {
try {
new SMSReceiver({timeout: NaN});
assert_unreached('Timeout of NaN should reject');
} catch (error) {
assert_equals(error.name, 'TypeError');
}
}, 'constructor throws with invalid timeout (NaN)');
promise_test(async t => {
new SMSReceiver();
}, 'constructor uses a default value for the timeout when none is passed');
promise_test(async t => {
new SMSReceiver({timeout: undefined});
}, 'constructor uses a default value for the timeout');