diff --git a/Tests/LibWeb/Text/expected/wpt-import/serial/idlharness.https.any.txt b/Tests/LibWeb/Text/expected/wpt-import/serial/idlharness.https.any.txt new file mode 100644 index 00000000000..c60f122ea71 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/serial/idlharness.https.any.txt @@ -0,0 +1,62 @@ +Harness status: OK + +Found 57 tests + +57 Pass +Pass idl_test setup +Pass idl_test validation +Pass Partial interface Navigator: original interface defined +Pass Partial interface Navigator: valid exposure set +Pass Partial interface Navigator: member names are unique +Pass Partial interface WorkerNavigator: original interface defined +Pass Partial interface WorkerNavigator: valid exposure set +Pass Partial interface WorkerNavigator: member names are unique +Pass Partial interface Navigator[2]: member names are unique +Pass Partial interface mixin NavigatorID: member names are unique +Pass Navigator includes NavigatorID: member names are unique +Pass Navigator includes NavigatorLanguage: member names are unique +Pass Navigator includes NavigatorOnLine: member names are unique +Pass Navigator includes NavigatorContentUtils: member names are unique +Pass Navigator includes NavigatorCookies: member names are unique +Pass Navigator includes NavigatorPlugins: member names are unique +Pass Navigator includes NavigatorConcurrentHardware: member names are unique +Pass WorkerNavigator includes NavigatorID: member names are unique +Pass WorkerNavigator includes NavigatorLanguage: member names are unique +Pass WorkerNavigator includes NavigatorOnLine: member names are unique +Pass WorkerNavigator includes NavigatorConcurrentHardware: member names are unique +Pass Serial interface: existence and properties of interface object +Pass Serial interface object length +Pass Serial interface object name +Pass Serial interface: existence and properties of interface prototype object +Pass Serial interface: existence and properties of interface prototype object's "constructor" property +Pass Serial interface: existence and properties of interface prototype object's @@unscopables property +Pass Serial interface: attribute onconnect +Pass Serial interface: attribute ondisconnect +Pass Serial interface: operation getPorts() +Pass Serial interface: operation requestPort(optional SerialPortRequestOptions) +Pass Serial must be primary interface of navigator.serial +Pass Stringification of navigator.serial +Pass Serial interface: navigator.serial must inherit property "onconnect" with the proper type +Pass Serial interface: navigator.serial must inherit property "ondisconnect" with the proper type +Pass Serial interface: navigator.serial must inherit property "getPorts()" with the proper type +Pass Serial interface: navigator.serial must inherit property "requestPort(optional SerialPortRequestOptions)" with the proper type +Pass Serial interface: calling requestPort(optional SerialPortRequestOptions) on navigator.serial with too few arguments must throw TypeError +Pass SerialPort interface: existence and properties of interface object +Pass SerialPort interface object length +Pass SerialPort interface object name +Pass SerialPort interface: existence and properties of interface prototype object +Pass SerialPort interface: existence and properties of interface prototype object's "constructor" property +Pass SerialPort interface: existence and properties of interface prototype object's @@unscopables property +Pass SerialPort interface: attribute onconnect +Pass SerialPort interface: attribute ondisconnect +Pass SerialPort interface: attribute connected +Pass SerialPort interface: attribute readable +Pass SerialPort interface: attribute writable +Pass SerialPort interface: operation getInfo() +Pass SerialPort interface: operation open(SerialOptions) +Pass SerialPort interface: operation setSignals(optional SerialOutputSignals) +Pass SerialPort interface: operation getSignals() +Pass SerialPort interface: operation close() +Pass SerialPort interface: operation forget() +Pass Navigator interface: attribute serial +Pass Navigator interface: navigator must inherit property "serial" with the proper type \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/interfaces/serial.idl b/Tests/LibWeb/Text/input/wpt-import/interfaces/serial.idl new file mode 100644 index 00000000000..37986b7ac2f --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/interfaces/serial.idl @@ -0,0 +1,89 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: Web Serial API (https://wicg.github.io/serial/) + +[Exposed=Window, SecureContext] +partial interface Navigator { + [SameObject] readonly attribute Serial serial; +}; + +[Exposed=DedicatedWorker, SecureContext] +partial interface WorkerNavigator { + [SameObject] readonly attribute Serial serial; +}; + +[Exposed=(DedicatedWorker, Window), SecureContext] +interface Serial : EventTarget { + attribute EventHandler onconnect; + attribute EventHandler ondisconnect; + Promise> getPorts(); + [Exposed=Window] Promise requestPort(optional SerialPortRequestOptions options = {}); +}; + +dictionary SerialPortRequestOptions { + sequence filters; + sequence allowedBluetoothServiceClassIds; +}; + +dictionary SerialPortFilter { + unsigned short usbVendorId; + unsigned short usbProductId; + BluetoothServiceUUID bluetoothServiceClassId; +}; + +[Exposed=(DedicatedWorker,Window), SecureContext] +interface SerialPort : EventTarget { + attribute EventHandler onconnect; + attribute EventHandler ondisconnect; + readonly attribute boolean connected; + readonly attribute ReadableStream readable; + readonly attribute WritableStream writable; + + SerialPortInfo getInfo(); + + Promise open(SerialOptions options); + Promise setSignals(optional SerialOutputSignals signals = {}); + Promise getSignals(); + Promise close(); + Promise forget(); +}; + +dictionary SerialPortInfo { + unsigned short usbVendorId; + unsigned short usbProductId; + BluetoothServiceUUID bluetoothServiceClassId; +}; + +dictionary SerialOptions { + [EnforceRange] required unsigned long baudRate; + [EnforceRange] octet dataBits = 8; + [EnforceRange] octet stopBits = 1; + ParityType parity = "none"; + [EnforceRange] unsigned long bufferSize = 255; + FlowControlType flowControl = "none"; +}; + +enum ParityType { + "none", + "even", + "odd" +}; + +enum FlowControlType { + "none", + "hardware" +}; + +dictionary SerialOutputSignals { + boolean dataTerminalReady; + boolean requestToSend; + boolean break; +}; + +dictionary SerialInputSignals { + required boolean dataCarrierDetect; + required boolean clearToSend; + required boolean ringIndicator; + required boolean dataSetReady; +}; diff --git a/Tests/LibWeb/Text/input/wpt-import/serial/idlharness.https.any.html b/Tests/LibWeb/Text/input/wpt-import/serial/idlharness.https.any.html new file mode 100644 index 00000000000..a76b59fbc1b --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/serial/idlharness.https.any.html @@ -0,0 +1,16 @@ + + + + + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/serial/idlharness.https.any.js b/Tests/LibWeb/Text/input/wpt-import/serial/idlharness.https.any.js new file mode 100644 index 00000000000..b240da933ad --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/serial/idlharness.https.any.js @@ -0,0 +1,22 @@ +// META: script=/resources/WebIDLParser.js +// META: script=/resources/idlharness.js + +'use strict'; + +idl_test( + ['serial'], + ['html', 'dom'], + idl_array => { + idl_array.add_objects({ + Serial: ['navigator.serial'], + // TODO: SerialPort + // TODO: SerialPortInfo + }); + + if (self.GLOBAL.isWorker()) { + idl_array.add_objects({ WorkerNavigator: ['navigator'] }); + } else { + idl_array.add_objects({ Navigator: ['navigator'] }); + } + } +);