Automatic update from web-platform-tests Replace some "assert_throws(FooError(), stuff)" calls with assert_throws_js. (#21378) This diff was generated by running: find . -type f -print0 | xargs -0 perl -pi -e 'BEGIN { $/ = undef; } s/assert_throws\(([ \n]*)([A-Za-z]*Error) *\(\) *(, *.)/assert_throws_js(\1\2\3/gs' and then: 1) Manually editing dom/nodes/Element-matches.js to get the TypeError constructor from the element's global. 2) Manually editing dom/nodes/ParentNode-querySelector-All.js to get the TypeError constructor from root's global, whether "root" is a Document or some other kind of node. Co-authored-by: Boris Zbarsky <bzbarsky@mit.edu> -- wpt-commits: f06523527a0735d23879f4e687d6efc095f780b7 wpt-pr: 21378
22 lines
719 B
JavaScript
22 lines
719 B
JavaScript
'use strict';
|
|
|
|
test(t => {
|
|
let packet = new USBIsochronousOutTransferPacket('ok', 42);
|
|
assert_equals(packet.status, 'ok');
|
|
assert_equals(packet.bytesWritten, 42);
|
|
|
|
packet = new USBIsochronousOutTransferPacket('stall');
|
|
assert_equals(packet.status, 'stall');
|
|
assert_equals(packet.bytesWritten, 0);
|
|
}, 'Can construct USBIsochronousOutTransferPacket');
|
|
|
|
test(t => {
|
|
assert_throws_js(TypeError, () => {
|
|
new USBIsochronousOutTransferPacket('invalid_status');
|
|
});
|
|
}, 'Cannot construct USBIsochronousOutTransferPacket with an invalid status');
|
|
|
|
test(t => {
|
|
assert_throws_js(TypeError, () => new USBIsochronousOutTransferPacket());
|
|
}, 'Cannot construct USBIsochronousOutTransferPacket without a status');
|