https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 822e9c88e5c38174de80ea6a822b32578d07fa94 authored by moz-wptsync-bot on 28 March 2018, 19:30:44 UTC
Correct readyState in WebSocket when worker goes away,
Tip revision: 822e9c8
usbIsochronousOutTransferPacket.https.html
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
'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(TypeError(), () => {
    new USBIsochronousOutTransferPacket('invalid_status');
  });
}, 'Cannot construct USBIsochronousOutTransferPacket with an invalid status');

test(t => {
  assert_throws(TypeError(), () => new USBIsochronousOutTransferPacket());
}, 'Cannot construct USBIsochronousOutTransferPacket without a status');
</script>
back to top