This fake spec tried to exercise all aspects of WebIDL so as to do regression testing in this complex piece of code.
CUSTOM PARAGRAPH
dictionary RTCConfiguration { sequence<RTCIceServer> iceServers; RTCIceTransportPolicy iceTransportPolicy = "all"; RTCBundlePolicy bundlePolicy = "balanced"; DOMString peerIdentity; }; enum RTCIceCredentialType { "password", "token" }; dictionary RTCIceServer { (DOMString or sequence<DOMString>) urls; DOMString username; DOMString credential; RTCIceCredentialType credentialType = "password"; }; enum RTCIceTransportPolicy { "none", "relay", "all" }; enum RTCBundlePolicy { "balanced", "max-compat", "max-bundle" }; dictionary RTCOfferOptions { long offerToReceiveVideo; long offerToReceiveAudio; boolean voiceActivityDetection = true; boolean iceRestart = false; }; enum RTCIdentityOption { "yes", "no", "ifconfigured" }; [ Constructor (optional RTCConfiguration configuration)] interface RTCPeerConnection : EventTarget { Promise<RTCSessionDescription> createOffer (optional RTCOfferOptions options); Promise<RTCSessionDescription> createAnswer (); Promise<void> setLocalDescription (RTCSessionDescription description); readonly attribute RTCSessionDescription? localDescription; Promise<void> setRemoteDescription (RTCSessionDescription description); readonly attribute RTCSessionDescription? remoteDescription; readonly attribute RTCSignalingState signalingState; void updateIce (RTCConfiguration configuration); Promise<void> addIceCandidate (RTCIceCandidate candidate); readonly attribute RTCIceGatheringState iceGatheringState; readonly attribute RTCIceConnectionState iceConnectionState; readonly attribute boolean? canTrickleIceCandidates; RTCConfiguration getConfiguration (); void close (); attribute EventHandler onnegotiationneeded; attribute EventHandler onicecandidate; attribute EventHandler onsignalingstatechange; attribute EventHandler oniceconnectionstatechange; attribute EventHandler onicegatheringstatechange; }; partial interface RTCPeerConnection { void createOffer (RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback, optional RTCOfferOptions options); void setLocalDescription (RTCSessionDescription description, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback); void createAnswer (RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback); void setRemoteDescription (RTCSessionDescription description, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback); void addIceCandidate (RTCIceCandidate candidate, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback); }; enum RTCSignalingState { "stable", "have-local-offer", "have-remote-offer", "have-local-pranswer", "have-remote-pranswer", "closed" }; enum RTCIceGatheringState { "new", "gathering", "complete" }; enum RTCIceConnectionState { "new", "checking", "connected", "completed", "failed", "disconnected", "closed" }; callback RTCPeerConnectionErrorCallback = void (DOMError error); interface RTCSdpError : DOMError { readonly attribute long sdpLineNumber; }; enum RTCSdpType { "offer", "pranswer", "answer" }; dictionary RTCSessionDescriptionInit { RTCSdpType type; DOMString sdp; };[ Constructor (optional RTCSessionDescriptionInit descriptionInitDict)] interface RTCSessionDescription { attribute RTCSdpType? type; attribute DOMString? sdp; serializer = {attribute}; }; callback RTCSessionDescriptionCallback = void (RTCSessionDescription sdp); dictionary RTCIceCandidateInit { DOMString candidate; DOMString sdpMid; unsigned short sdpMLineIndex; };[ Constructor (RTCIceCandidateInit candidateInitDict)] interface RTCIceCandidate { attribute DOMString candidate; attribute DOMString? sdpMid; attribute unsigned short? sdpMLineIndex; serializer = {attribute}; }; dictionary RTCPeerConnectionIceEventInit : EventInit { RTCIceCandidate candidate; };[ Constructor (DOMString type, RTCPeerConnectionIceEventInit eventInitDict)] interface RTCPeerConnectionIceEvent : Event { readonly attribute RTCIceCandidate? candidate; }; partial interface RTCPeerConnection { sequence<RTCRtpSender> getSenders (); sequence<RTCRtpReceiver> getReceivers (); RTCRtpSender addTrack (MediaStreamTrack track, MediaStream... streams); void removeTrack (RTCRtpSender sender); attribute EventHandler ontrack; }; interface RTCRtpSender { readonly attribute MediaStreamTrack track; }; interface RTCRtpReceiver { readonly attribute MediaStreamTrack track; }; dictionary RTCTrackEventInit : EventInit { RTCRtpReceiver receiver; MediaStreamTrack track; MediaStream[] streams; };[ Constructor (DOMString type, RTCTrackEventInit eventInitDict)] interface RTCTrackEvent : Event { readonly attribute RTCRtpReceiver receiver; readonly attribute MediaStreamTrack track; readonly attribute MediaStream[] streams; }; partial interface RTCPeerConnection { RTCDataChannel createDataChannel ([TreatNullAs=EmptyString] DOMString label, optional RTCDataChannelInit dataChannelDict); attribute EventHandler ondatachannel; }; dictionary RTCDataChannelInit { boolean ordered = true; unsigned short maxPacketLifeTime; unsigned short maxRetransmits; DOMString protocol = ""; boolean negotiated = false; unsigned short id; };interface RTCDataChannel : EventTarget { readonly attribute DOMString label; readonly attribute boolean ordered; readonly attribute unsigned short? maxPacketLifeTime; readonly attribute unsigned short? maxRetransmits; readonly attribute DOMString protocol; readonly attribute boolean negotiated; readonly attribute unsigned short id; readonly attribute RTCDataChannelState readyState; readonly attribute unsigned long bufferedAmount; attribute EventHandler onopen; attribute EventHandler onerror; attribute EventHandler onclose; void close (); attribute EventHandler onmessage; attribute DOMString binaryType; void send (DOMString data); void send (Blob data); void send (ArrayBuffer data); void send (ArrayBufferView data); }; enum RTCDataChannelState { "connecting", "open", "closing", "closed" }; dictionary RTCDataChannelEventInit : EventInit { RTCDataChannel channel; };[ Constructor (DOMString type, RTCDataChannelEventInit eventInitDict)] interface RTCDataChannelEvent : Event { readonly attribute RTCDataChannel channel; }; partial interface RTCPeerConnection { readonly attribute RTCDTMFSender? dtmf; }; [NoInterfaceObject] interface RTCDTMFSender { void insertDTMF (DOMString tones, optional long duration = 100, optional long interToneGap = 70); attribute EventHandler ontonechange; readonly attribute DOMString toneBuffer; readonly attribute long duration; readonly attribute long interToneGap; }; dictionary RTCDTMFToneChangeEventInit : EventInit { DOMString tone; };[ Constructor (DOMString type, RTCDTMFToneChangeEventInit eventInitDict)] interface RTCDTMFToneChangeEvent : Event { readonly attribute DOMString tone; }; partial interface RTCPeerConnection { void getStats (MediaStreamTrack? selector, RTCStatsCallback successCallback, RTCPeerConnectionErrorCallback failureCallback); }; callback RTCStatsCallback = void (RTCStatsReport report); interface RTCStatsReport { getter RTCStats (DOMString id); }; dictionary RTCStats { DOMHiResTimeStamp timestamp; RTCStatsType type; DOMString id; }; enum RTCStatsType { "inbound-rtp", "outbound-rtp" }; dictionary RTCRTPStreamStats : RTCStats { DOMString ssrc; DOMString remoteId; }; dictionary RTCInboundRTPStreamStats : RTCRTPStreamStats { unsigned long packetsReceived; unsigned long bytesReceived; }; dictionary RTCOutboundRTPStreamStats : RTCRTPStreamStats { unsigned long packetsSent; unsigned long bytesSent; }; partial interface RTCPeerConnection { void setIdentityProvider (DOMString provider, optional DOMString protocol, optional DOMString username); void getIdentityAssertion (); readonly attribute RTCIdentityAssertion? peerIdentity; attribute EventHandler onidentityresult; attribute EventHandler onpeeridentity; attribute EventHandler onidpassertionerror; attribute EventHandler onidpvalidationerror; }; dictionary RTCIdentityAssertion { DOMString idp; DOMString name; }; [NoInterfaceObject] interface RTCIdentityEvent : Event { attribute DOMString assertion; }; [NoInterfaceObject] interface RTCIdentityErrorEvent : Event { attribute DOMString idp; attribute DOMString protocol; attribute DOMString? loginUrl; }; partial dictionary MediaStreamConstraints { DOMString peerIdentity; }; partial interface MediaStreamTrack { readonly attribute boolean isolated; attribute EventHandler onisolationchange; };
isolated