1 // META: script=/resources/test-only-api.js
2 // META: script=/serial/resources/common.js
3 // META: script=resources/automation.js
5 serial_test(async (t, fake) => {
6 const {port, fakePort} = await getFakeSerialPort(fake);
8 await port.open({baudRate: 9600});
9 assert_true(port.readable instanceof ReadableStream);
11 const reader = port.readable.getReader();
12 await promise_rejects_js(t, TypeError, port.close());
16 assert_equals(port.readable, null);
17 }, 'Port cannot be closed while readable is locked');