Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up IDL tests which reference SVG #12225

Merged
merged 11 commits into from Jul 31, 2018

Clean up HTML test

  • Loading branch information...
Luke Bjerring
Luke Bjerring committed Jul 28, 2018
commit 5924ba38539c063032c5bd79809a990a1c495a63
@@ -35,195 +35,190 @@ <h1>HTML IDL tests</h1>
promise_test(async () => {
await new Promise(resolve => { addEventListener('load', resolve); })

This comment has been minimized.

Copy link
@foolip

foolip Jul 30, 2018

Contributor

Whether this is needed I don't know, but to avoid the extra test (now implicitly called "HTML IDL tests"?) can the await part be moved into the async setup of idl_test? (The even listener itself needs to be added here, since otherwise the fetches and the load event will be racing.)

This comment has been minimized.

Copy link
@lukebjerring

lukebjerring Jul 31, 2018

Author Contributor

Done.

const srcs = ['html', 'SVG', 'dom', 'cssom', 'touchevents', 'uievents'];
const [html, svg, dom, cssom, touchevents, uievents] = await Promise.all(
srcs.map(i => fetch(`/interfaces/${i}.idl`).then(r => r.text())));
var idlArray = new IdlArray();
idlArray.add_idls(html);
idlArray.add_dependency_idls(dom);
idlArray.add_dependency_idls(cssom);
idlArray.add_dependency_idls(uievents);
idlArray.add_dependency_idls(touchevents);
idlArray.add_dependency_idls(svg);
idlArray.add_objects({
NodeList: ['document.getElementsByName("name")'],
HTMLAllCollection: ['document.all'],
HTMLFormControlsCollection: ['document.createElement("form").elements'],
RadioNodeList: [],
HTMLOptionsCollection: ['document.createElement("select").options'],
DOMStringMap: ['document.head.dataset'],
Transferable: [],
Document: ['iframe.contentDocument', 'new Document()'],
XMLDocument: ['document.implementation.createDocument(null, "", null)'],
HTMLElement: ['document.createElement("noscript")'], // more tests in html/semantics/interfaces.js
HTMLUnknownElement: ['document.createElement("bgsound")'], // more tests in html/semantics/interfaces.js
HTMLHtmlElement: ['document.createElement("html")'],
HTMLHeadElement: ['document.createElement("head")'],
HTMLTitleElement: ['document.createElement("title")'],
HTMLBaseElement: ['document.createElement("base")'],
HTMLLinkElement: ['document.createElement("link")'],
HTMLMetaElement: ['document.createElement("meta")'],
HTMLStyleElement: ['document.createElement("style")'],
HTMLScriptElement: ['document.createElement("script")'],
HTMLBodyElement: ['document.createElement("body")'],
HTMLHeadingElement: ['document.createElement("h1")'],
HTMLParagraphElement: ['document.createElement("p")'],
HTMLHRElement: ['document.createElement("hr")'],
HTMLPreElement: [
'document.createElement("pre")',
'document.createElement("listing")',
'document.createElement("xmp")',
],
HTMLQuoteElement: [
'document.createElement("blockquote")',
'document.createElement("q")',
],
HTMLOlistElement: ['document.createElement("ol")'],
HTMLUlistElement: ['document.createElement("ul")'],
HTMLLIElement: ['document.createElement("li")'],
HTMLDlistElement: ['document.createElement("dl")'],
HTMLDivElement: ['document.createElement("div")'],
HTMLAnchorElement: ['document.createElement("a")'],
HTMLDataElement: ['document.createElement("data")'],
HTMLTimeElement: ['document.createElement("time")'],
HTMLSpanElement: ['document.createElement("span")'],
HTMLBRElement: ['document.createElement("br")'],
HTMLModElement: [
'document.createElement("ins")',
'document.createElement("del")',
],
HTMLPictureElement: ['document.createElement("picture")'],
HTMLImageElement: ['document.createElement("img")', 'new Image()'],
HTMLIframeElement: ['document.createElement("iframe")'],
HTMLEmbedElement: ['document.createElement("embed")'],
HTMLObjectElement: ['document.createElement("object")'],
HTMLParamElement: ['document.createElement("param")'],
HTMLVideoElement: ['document.createElement("video")'],
HTMLAudioElement: ['document.createElement("audio")', 'new Audio()'],
HTMLSourceElement: ['document.createElement("source")'],
HTMLTrackElement: ['document.createElement("track")'],
HTMLMediaElement: [],
MediaError: ['errorVideo.error'],
AudioTrackList: [],
AudioTrack: [],
VideoTrackList: [],
VideoTrack: [],
TextTrackList: ['document.createElement("video").textTracks'],
TextTrack: ['document.createElement("track").track'],
TextTrackCueList: ['document.createElement("video").addTextTrack("subtitles").cues'],
TextTrackCue: [],
DataCue: [],
TimeRanges: ['document.createElement("video").buffered'],
TrackEvent: ['new TrackEvent("addtrack", {track:document.createElement("track").track})'],
HTMLTemplateElement: ['document.createElement("template")'],
HTMLSlotElement: ['document.createElement("slot")'],
HTMLCanvasElement: ['document.createElement("canvas")'],
CanvasRenderingContext2D: ['document.createElement("canvas").getContext("2d")'],
CanvasGradient: [],
CanvasPattern: [],
TextMetrics: [],
ImageData: [],
HTMLMapElement: ['document.createElement("map")'],
HTMLAreaElement: ['document.createElement("area")'],
HTMLTableElement: ['document.createElement("table")'],
HTMLTableCaptionElement: ['document.createElement("caption")'],
HTMLTableColElement: [
'document.createElement("colgroup")',
'document.createElement("col")',
],
HTMLTableSectionElement: [
'document.createElement("tbody")',
'document.createElement("thead")',
'document.createElement("tfoot")',
],
HTMLTableRowElement: ['document.createElement("tr")'],
HTMLTableCellElement: [
'document.createElement("td")',
'document.createElement("th")',
],
HTMLFormElement: ['document.createElement("form")'],
HTMLFieldsetElement: ['document.createElement("fieldset")'],
HTMLLegendElement: ['document.createElement("legend")'],
HTMLLabelElement: ['document.createElement("label")'],
HTMLInputElement: [
'document.createElement("input")',
'createInput("text")',
'createInput("hidden")',
'createInput("search")',
'createInput("tel")',
'createInput("url")',
'createInput("email")',
'createInput("password")',
'createInput("date")',
'createInput("month")',
'createInput("week")',
'createInput("time")',
'createInput("datetime-local")',
'createInput("number")',
'createInput("range")',
'createInput("color")',
'createInput("checkbox")',
'createInput("radio")',
'createInput("file")',
'createInput("submit")',
'createInput("image")',
'createInput("reset")',
'createInput("button")'
],
HTMLButtonElement: ['document.createElement("button")'],
HTMLSelectElement: ['document.createElement("select")'],
HTMLDataListElement: ['document.createElement("datalist")'],
HTMLOptGroupElement: ['document.createElement("optgroup")'],
HTMLOptionElement: ['document.createElement("option")', 'new Option()'],
HTMLTextAreaElement: ['document.createElement("textarea")'],
HTMLOutputElement: ['document.createElement("output")'],
HTMLProgressElement: ['document.createElement("progress")'],
HTMLMeterElement: ['document.createElement("meter")'],
ValidityState: ['document.createElement("input").validity'],
HTMLDetailsElement: ['document.createElement("details")'],
HTMLMenuElement: ['document.createElement("menu")'],
Window: ['window'],
BarProp: [],
History: ['window.history'],
Location: ['window.location'],
PopStateEvent: ['new PopStateEvent("popstate", { data: {} })'],
HashChangeEvent: [],
PageTransitionEvent: [],
BeforeUnloadEvent: [],
ApplicationCache: ['window.applicationCache'],
WindowModal: [],
Navigator: ['window.navigator'],
External: ['window.external'],
DataTransfer: [],
DataTransferItemList: [],
DataTransferItem: [],
DragEvent: [],
NavigatorUserMediaError: [],
MediaStream: [],
LocalMediaStream: [],
MediaStreamTrack: [],
MediaStreamRecorder: [],
PeerConnection: [],
MediaStreamEvent: [],
ErrorEvent: [],
WebSocket: ['new WebSocket("wss://foo")'],
CloseEvent: ['new CloseEvent("close")'],
AbstractWorker: [],
Worker: [],
SharedWorker: [],
MessageEvent: ['new MessageEvent("message", { data: 5 })'],
MessageChannel: [],
MessagePort: [],
HTMLMarqueeElement: ['document.createElement("marquee")'],
HTMLFrameSetElement: ['document.createElement("frameset")'],
HTMLFrameElement: ['document.createElement("frame")'],
HTMLDirectoryElement: ['document.createElement("dir")'],
HTMLFontElement: ['document.createElement("font")'],
});
idlArray.prevent_multiple_testing('HTMLElement');
idlArray.test();
}, 'html interfaces');
idl_test(
['html'],
['SVG', 'dom', 'cssom', 'touchevents', 'uievents'],
idlArray => {
idlArray.add_objects({
NodeList: ['document.getElementsByName("name")'],
HTMLAllCollection: ['document.all'],
HTMLFormControlsCollection: ['document.createElement("form").elements'],
RadioNodeList: [],
HTMLOptionsCollection: ['document.createElement("select").options'],
DOMStringMap: ['document.head.dataset'],
Transferable: [],
Document: ['iframe.contentDocument', 'new Document()'],
XMLDocument: ['document.implementation.createDocument(null, "", null)'],
HTMLElement: ['document.createElement("noscript")'], // more tests in html/semantics/interfaces.js
HTMLUnknownElement: ['document.createElement("bgsound")'], // more tests in html/semantics/interfaces.js
HTMLHtmlElement: ['document.createElement("html")'],
HTMLHeadElement: ['document.createElement("head")'],
HTMLTitleElement: ['document.createElement("title")'],
HTMLBaseElement: ['document.createElement("base")'],
HTMLLinkElement: ['document.createElement("link")'],
HTMLMetaElement: ['document.createElement("meta")'],
HTMLStyleElement: ['document.createElement("style")'],
HTMLScriptElement: ['document.createElement("script")'],
HTMLBodyElement: ['document.createElement("body")'],
HTMLHeadingElement: ['document.createElement("h1")'],
HTMLParagraphElement: ['document.createElement("p")'],
HTMLHRElement: ['document.createElement("hr")'],
HTMLPreElement: [
'document.createElement("pre")',
'document.createElement("listing")',
'document.createElement("xmp")',
],
HTMLQuoteElement: [
'document.createElement("blockquote")',
'document.createElement("q")',
],
HTMLOlistElement: ['document.createElement("ol")'],
HTMLUlistElement: ['document.createElement("ul")'],
HTMLLIElement: ['document.createElement("li")'],
HTMLDlistElement: ['document.createElement("dl")'],
HTMLDivElement: ['document.createElement("div")'],
HTMLAnchorElement: ['document.createElement("a")'],
HTMLDataElement: ['document.createElement("data")'],
HTMLTimeElement: ['document.createElement("time")'],
HTMLSpanElement: ['document.createElement("span")'],
HTMLBRElement: ['document.createElement("br")'],
HTMLModElement: [
'document.createElement("ins")',
'document.createElement("del")',
],
HTMLPictureElement: ['document.createElement("picture")'],
HTMLImageElement: ['document.createElement("img")', 'new Image()'],
HTMLIframeElement: ['document.createElement("iframe")'],
HTMLEmbedElement: ['document.createElement("embed")'],
HTMLObjectElement: ['document.createElement("object")'],
HTMLParamElement: ['document.createElement("param")'],
HTMLVideoElement: ['document.createElement("video")'],
HTMLAudioElement: ['document.createElement("audio")', 'new Audio()'],
HTMLSourceElement: ['document.createElement("source")'],
HTMLTrackElement: ['document.createElement("track")'],
HTMLMediaElement: [],
MediaError: ['errorVideo.error'],
AudioTrackList: [],
AudioTrack: [],
VideoTrackList: [],
VideoTrack: [],
TextTrackList: ['document.createElement("video").textTracks'],
TextTrack: ['document.createElement("track").track'],
TextTrackCueList: ['document.createElement("video").addTextTrack("subtitles").cues'],
TextTrackCue: [],
DataCue: [],
TimeRanges: ['document.createElement("video").buffered'],
TrackEvent: ['new TrackEvent("addtrack", {track:document.createElement("track").track})'],
HTMLTemplateElement: ['document.createElement("template")'],
HTMLSlotElement: ['document.createElement("slot")'],
HTMLCanvasElement: ['document.createElement("canvas")'],
CanvasRenderingContext2D: ['document.createElement("canvas").getContext("2d")'],
CanvasGradient: [],
CanvasPattern: [],
TextMetrics: [],
ImageData: [],
HTMLMapElement: ['document.createElement("map")'],
HTMLAreaElement: ['document.createElement("area")'],
HTMLTableElement: ['document.createElement("table")'],
HTMLTableCaptionElement: ['document.createElement("caption")'],
HTMLTableColElement: [
'document.createElement("colgroup")',
'document.createElement("col")',
],
HTMLTableSectionElement: [
'document.createElement("tbody")',
'document.createElement("thead")',
'document.createElement("tfoot")',
],
HTMLTableRowElement: ['document.createElement("tr")'],
HTMLTableCellElement: [
'document.createElement("td")',
'document.createElement("th")',
],
HTMLFormElement: ['document.createElement("form")'],
HTMLFieldsetElement: ['document.createElement("fieldset")'],
HTMLLegendElement: ['document.createElement("legend")'],
HTMLLabelElement: ['document.createElement("label")'],
HTMLInputElement: [
'document.createElement("input")',
'createInput("text")',
'createInput("hidden")',
'createInput("search")',
'createInput("tel")',
'createInput("url")',
'createInput("email")',
'createInput("password")',
'createInput("date")',
'createInput("month")',
'createInput("week")',
'createInput("time")',
'createInput("datetime-local")',
'createInput("number")',
'createInput("range")',
'createInput("color")',
'createInput("checkbox")',
'createInput("radio")',
'createInput("file")',
'createInput("submit")',
'createInput("image")',
'createInput("reset")',
'createInput("button")'
],
HTMLButtonElement: ['document.createElement("button")'],
HTMLSelectElement: ['document.createElement("select")'],
HTMLDataListElement: ['document.createElement("datalist")'],
HTMLOptGroupElement: ['document.createElement("optgroup")'],
HTMLOptionElement: ['document.createElement("option")', 'new Option()'],
HTMLTextAreaElement: ['document.createElement("textarea")'],
HTMLOutputElement: ['document.createElement("output")'],
HTMLProgressElement: ['document.createElement("progress")'],
HTMLMeterElement: ['document.createElement("meter")'],
ValidityState: ['document.createElement("input").validity'],
HTMLDetailsElement: ['document.createElement("details")'],
HTMLMenuElement: ['document.createElement("menu")'],
Window: ['window'],
BarProp: [],
History: ['window.history'],
Location: ['window.location'],
PopStateEvent: ['new PopStateEvent("popstate", { data: {} })'],
HashChangeEvent: [],
PageTransitionEvent: [],
BeforeUnloadEvent: [],
ApplicationCache: ['window.applicationCache'],
WindowModal: [],
Navigator: ['window.navigator'],
External: ['window.external'],
DataTransfer: [],
DataTransferItemList: [],
DataTransferItem: [],
DragEvent: [],
NavigatorUserMediaError: [],
MediaStream: [],
LocalMediaStream: [],
MediaStreamTrack: [],
MediaStreamRecorder: [],
PeerConnection: [],
MediaStreamEvent: [],
ErrorEvent: [],
WebSocket: ['new WebSocket("wss://foo")'],
CloseEvent: ['new CloseEvent("close")'],
AbstractWorker: [],
Worker: [],
SharedWorker: [],
MessageEvent: ['new MessageEvent("message", { data: 5 })'],
MessageChannel: [],
MessagePort: [],
HTMLMarqueeElement: ['document.createElement("marquee")'],
HTMLFrameSetElement: ['document.createElement("frameset")'],
HTMLFrameElement: ['document.createElement("frame")'],
HTMLDirectoryElement: ['document.createElement("dir")'],
HTMLFontElement: ['document.createElement("font")'],
});
idlArray.prevent_multiple_testing('HTMLElement');
},
'html interfaces'
);
});
</script>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.