diff --git a/accelerometer/idlharness.https.html b/accelerometer/idlharness.https.html index 3c3c96e88e8740..1f32be986855b7 100644 --- a/accelerometer/idlharness.https.html +++ b/accelerometer/idlharness.https.html @@ -15,7 +15,7 @@ const idl_array = new IdlArray(); idl_array.add_untested_idls(dom); idl_array.add_untested_idls('interface EventHandler {};'); - idl_array.add_idls(generic_sensor, { only: ['Sensor'] }); + idl_array.add_idls(generic_sensor, { only: ['Sensor', 'SensorOptions'] }); idl_array.add_idls(accelerometer); idl_array.add_objects({ Accelerometer: ['new Accelerometer();'], diff --git a/background-fetch/interfaces.html b/background-fetch/interfaces.html index f512e454071250..51e320e64379f0 100644 --- a/background-fetch/interfaces.html +++ b/background-fetch/interfaces.html @@ -12,15 +12,17 @@

idlharness test

diff --git a/background-fetch/interfaces.worker.js b/background-fetch/interfaces.worker.js index 89a7cb3da0ad73..9b8d0264a56f99 100644 --- a/background-fetch/interfaces.worker.js +++ b/background-fetch/interfaces.worker.js @@ -3,16 +3,18 @@ importScripts('/resources/testharness.js'); importScripts('/resources/WebIDLParser.js', '/resources/idlharness.js'); -promise_test(function() { - return fetch('/interfaces/background-fetch.idl') - .then(response => response.text()) - .then(idls => { - var idlArray = new IdlArray(); - idlArray.add_untested_idls('interface ServiceWorkerRegistration {};'); - idlArray.add_untested_idls('[Exposed=ServiceWorker] interface ServiceWorkerGlobalScope {};'); - idlArray.add_idls(idls); - idlArray.test(); - }); +promise_test(async function() { + const idls = await fetch('/interfaces/background-fetch.idl').then(r => r.text()); + const dom = await fetch('/interfaces/dom.idl').then(r => r.text()); + + var idlArray = new IdlArray(); + idlArray.add_untested_idls('interface ServiceWorkerRegistration {};'); + idlArray.add_untested_idls('[Exposed=ServiceWorker] interface ServiceWorkerGlobalScope {};'); + idlArray.add_untested_idls('interface ExtendableEvent{};'); + idlArray.add_untested_idls('dictionary ExtendableEventInit{};'); + idlArray.add_untested_idls(dom, { only: ['EventTarget'] }); + idlArray.add_idls(idls); + idlArray.test(); }, 'Exposed interfaces in a Service Worker.'); done(); diff --git a/clipboard-apis/async-interfaces.https.html b/clipboard-apis/async-interfaces.https.html index d69fb70a731dfd..1f523e5d565dec 100644 --- a/clipboard-apis/async-interfaces.https.html +++ b/clipboard-apis/async-interfaces.https.html @@ -9,13 +9,13 @@ diff --git a/content-security-policy/securitypolicyviolation/idl.html b/content-security-policy/securitypolicyviolation/idl.html index a4f9e68f8314db..2853b868e57a4b 100644 --- a/content-security-policy/securitypolicyviolation/idl.html +++ b/content-security-policy/securitypolicyviolation/idl.html @@ -21,9 +21,6 @@ long lineNumber; long columnNumber; }; - - interface Event { - }; diff --git a/cookie-store/idlharness.tentative.html b/cookie-store/idlharness.tentative.html index e9ffab3730f3b5..e313b04ff8f3ab 100644 --- a/cookie-store/idlharness.tentative.html +++ b/cookie-store/idlharness.tentative.html @@ -10,21 +10,38 @@ 'use strict'; promise_test(async t => { - const urls = ['/interfaces/html.idl', '/interfaces/cookie-store.idl']; - const [html, cookie_store] = await Promise.all( - urls.map(url => fetch(url).then(response => response.text()))); + const urls = [ + '/interfaces/uievents.idl', + '/interfaces/dom.idl', + '/interfaces/html.idl', + '/interfaces/cookie-store.idl' + ]; + const [uievents, dom, html, cookie_store] = await Promise.all( + urls.map(url => fetch(url).then(r => r.text()))); const idl_array = new IdlArray(); // Dependencies of HTML + idl_array.add_untested_idls(dom, { only: [ + 'Event', + 'EventInit', + 'EventTarget', + 'HTMLCollection', + 'NodeList', + ] }); idl_array.add_untested_idls('interface Document {};'); + idl_array.add_untested_idls('interface Element {};'); idl_array.add_untested_idls('interface LinkStyle {};'); idl_array.add_untested_idls('interface SVGElement {};'); idl_array.add_untested_idls(html); + idl_array.add_untested_idls(uievents, { only: [ + 'UIEvent', + 'UIEventInit', + 'MouseEvent', + 'MouseEventInit', + 'EventModifierInit', + ] }); - idl_array.add_untested_idls('interface Event {};'); - idl_array.add_untested_idls('dictionary EventInit {};'); - idl_array.add_untested_idls('interface EventTarget {};'); idl_array.add_untested_idls( `[Global=ServiceWorker, Exposed=ServiceWorker] interface ServiceWorkerGlobalScope {};`); diff --git a/css/cssom-view/interfaces.html b/css/cssom-view/interfaces.html index c6e3662334e780..308c1b4e2647c6 100644 --- a/css/cssom-view/interfaces.html +++ b/css/cssom-view/interfaces.html @@ -17,11 +17,12 @@

CSSOM View IDL tests

diff --git a/mediacapture-streams/MediaDevices-IDL-all.html b/mediacapture-streams/MediaDevices-IDL-all.html index f6dfb361bb48f7..a793bedc78d66e 100644 --- a/mediacapture-streams/MediaDevices-IDL-all.html +++ b/mediacapture-streams/MediaDevices-IDL-all.html @@ -19,10 +19,11 @@

Description

diff --git a/mediacapture-streams/MediaDevices-IDL-enumerateDevices.html b/mediacapture-streams/MediaDevices-IDL-enumerateDevices.html index c2449ae6ce03c2..0d6c6c00bf5927 100644 --- a/mediacapture-streams/MediaDevices-IDL-enumerateDevices.html +++ b/mediacapture-streams/MediaDevices-IDL-enumerateDevices.html @@ -20,10 +20,10 @@

Description

diff --git a/pointerevents/idlharness.html b/pointerevents/idlharness.html index 729d3573e87502..bdc7ad789ce758 100644 --- a/pointerevents/idlharness.html +++ b/pointerevents/idlharness.html @@ -91,14 +91,21 @@ }; diff --git a/remote-playback/idlharness.html b/remote-playback/idlharness.html index bd9cbf6cc43e67..274771af684e4a 100644 --- a/remote-playback/idlharness.html +++ b/remote-playback/idlharness.html @@ -19,20 +19,32 @@

Remote Playback API IDL tests

diff --git a/resources/idlharness.js b/resources/idlharness.js index c3045c49f909c9..bfa8c2a2709b9c 100644 --- a/resources/idlharness.js +++ b/resources/idlharness.js @@ -683,6 +683,19 @@ IdlArray.prototype.test = function() } this["includes"] = {}; + // Assert B defined for A : B + for (const member of Object.values(this.members).filter(m => m.base)) { + const lhs = member.name; + const rhs = member.base; + if (!(rhs in this.members)) throw new IdlHarnessError(`${lhs} inherits ${rhs}, but ${rhs} is undefined.`); + const lhs_is_interface = this.members[lhs] instanceof IdlInterface; + const rhs_is_interface = this.members[rhs] instanceof IdlInterface; + if (rhs_is_interface != lhs_is_interface) { + if (!lhs_is_interface) throw new IdlHarnessError(`${lhs} inherits ${rhs}, but ${lhs} is not an interface.`); + if (!rhs_is_interface) throw new IdlHarnessError(`${lhs} inherits ${rhs}, but ${rhs} is not an interface.`); + } + } + Object.getOwnPropertyNames(this.members).forEach(function(memberName) { var member = this.members[memberName]; if (!(member instanceof IdlInterface)) { diff --git a/resources/test/tests/idlharness/IdlDictionary/get_inheritance_stack.html b/resources/test/tests/idlharness/IdlDictionary/get_inheritance_stack.html index 3540afb3346e2f..98168ee119b428 100644 --- a/resources/test/tests/idlharness/IdlDictionary/get_inheritance_stack.html +++ b/resources/test/tests/idlharness/IdlDictionary/get_inheritance_stack.html @@ -29,6 +29,19 @@ var A = idl.members["A"]; assert_array_equals(A.get_inheritance_stack().map(d => d.name), ["A", "B", "C"]); }, 'should return an array of inherited dictionaries in order of inheritance, starting with itself.'); + + test(function () { + let i = new IdlArray(); + i.add_untested_idls('dictionary A : B {};'); + i.assert_throws(new IdlHarnessError('A inherits B, but B is undefined.'), i => i.test()); + }, 'A : B with B undeclared should throw IdlHarnessError'); + + test(function () { + let i = new IdlArray(); + i.add_untested_idls('dictionary A : B {};'); + i.add_untested_idls('interface B {};'); + i.assert_throws(new IdlHarnessError('A inherits B, but A is not an interface.'), i => i.test()); + }, 'dictionary A : B with B interface should throw IdlHarnessError'); diff --git a/resources/test/tests/idlharness/IdlInterface/test_primary_interface_of_undefined.html b/resources/test/tests/idlharness/IdlInterface/test_primary_interface_of_undefined.html new file mode 100644 index 00000000000000..0031558ad42ce5 --- /dev/null +++ b/resources/test/tests/idlharness/IdlInterface/test_primary_interface_of_undefined.html @@ -0,0 +1,29 @@ + + + + + idlharness test_primary_interface_of_undefined + + + + + + + + + + diff --git a/service-workers/service-worker/interfaces-window.https.html b/service-workers/service-worker/interfaces-window.https.html index 307472444d63e0..54f83f202c3131 100644 --- a/service-workers/service-worker/interfaces-window.https.html +++ b/service-workers/service-worker/interfaces-window.https.html @@ -11,9 +11,11 @@ promise_test(async (t) => { var idlArray = new IdlArray(); - let serviceWorkerIdl = await fetch('/interfaces/ServiceWorker.idl').then(r => r.text()); + const dom = await fetch('/interfaces/dom.idl').then(r => r.text()); + const serviceWorkerIdl = await fetch('/interfaces/ServiceWorker.idl').then(r => r.text()); idlArray.add_untested_idls(idls.untested); + idlArray.add_untested_idls(dom, { only: ['EventTarget'] }); idlArray.add_idls(serviceWorkerIdl, { only: [ 'ServiceWorkerGlobalScope', 'Client', diff --git a/service-workers/service-worker/resources/interfaces-worker.sub.js b/service-workers/service-worker/resources/interfaces-worker.sub.js index e8147f73fca649..29c859bb91456a 100644 --- a/service-workers/service-worker/resources/interfaces-worker.sub.js +++ b/service-workers/service-worker/resources/interfaces-worker.sub.js @@ -7,9 +7,11 @@ importScripts('/resources/idlharness.js'); promise_test(async (t) => { var idlArray = new IdlArray(); - let serviceWorkerIdl = await fetch('/interfaces/ServiceWorker.idl').then(r => r.text()); + const dom = await fetch('/interfaces/dom.idl').then(r => r.text()); + const serviceWorkerIdl = await fetch('/interfaces/ServiceWorker.idl').then(r => r.text()); idlArray.add_untested_idls(idls.untested); + idlArray.add_untested_idls(dom, { only: ['EventTarget'] }); idlArray.add_idls(serviceWorkerIdl, { only: [ 'ServiceWorkerGlobalScope', 'Client', diff --git a/webaudio/idlharness.https.html b/webaudio/idlharness.https.html index aed91706eb9ee6..09ec2c430bccde 100644 --- a/webaudio/idlharness.https.html +++ b/webaudio/idlharness.https.html @@ -10,13 +10,16 @@ 'use strict'; promise_test(async t => { - const [html, dom, mediacapture, webaudio] = await Promise.all([ + const [html, dom, uievents, mediacapture, webaudio] = await Promise.all([ // Needed for EventTarget, HTMLMediaElement '/interfaces/html.idl', // Needed for Event, EventListener '/interfaces/dom.idl', + // Needed for MouseEvent + '/interfaces/uievents.idl', + // Needed for MediaStream, MediaStreamTrack '/interfaces/mediacapture-main.idl', @@ -28,7 +31,15 @@ // Dependencies of HTML idl_array.add_untested_idls('interface LinkStyle {};'); idl_array.add_untested_idls('interface SVGElement {};'); + idl_array.add_untested_idls('interface WorkletGlobalScope {};'); idl_array.add_untested_idls(html); + idl_array.add_untested_idls(uievents, { only: [ + 'MouseEvent', + 'MouseEventInit', + 'EventModifierInit', + 'UIEvent', + 'UIEventInit', + ]}); idl_array.add_untested_idls(dom); idl_array.add_untested_idls(mediacapture); diff --git a/webaudio/the-audio-api/the-delaynode-interface/idl-test.html b/webaudio/the-audio-api/the-delaynode-interface/idl-test.html index 5922b96f6975e4..eb42a4a003c893 100644 --- a/webaudio/the-audio-api/the-delaynode-interface/idl-test.html +++ b/webaudio/the-audio-api/the-delaynode-interface/idl-test.html @@ -138,8 +138,11 @@
diff --git a/webaudio/the-audio-api/the-gainnode-interface/idl-test.html b/webaudio/the-audio-api/the-gainnode-interface/idl-test.html index 7ad8bc90364bf7..69606c977eda42 100644 --- a/webaudio/the-audio-api/the-gainnode-interface/idl-test.html +++ b/webaudio/the-audio-api/the-gainnode-interface/idl-test.html @@ -136,8 +136,11 @@
diff --git a/webauthn/interfaces.https.any.js b/webauthn/interfaces.https.any.js index bd5f9dc4a285cc..22766e650ce142 100644 --- a/webauthn/interfaces.https.any.js +++ b/webauthn/interfaces.https.any.js @@ -20,6 +20,7 @@ promise_test(async () => { idlArray.add_untested_idls('interface CredentialCreationOptions {};'); idlArray.add_untested_idls('interface CredentialRequestOptions {};'); idlArray.add_untested_idls("interface Navigator { };"); + idlArray.add_untested_idls("interface Credential { };"); // TODO: change to "tested" for real browsers? idlArray.add_untested_idls("partial interface Navigator { readonly attribute WebAuthentication authentication; };"); idlArray.add_objects({ diff --git a/webstorage/idlharness.html b/webstorage/idlharness.html index cd880a33f03476..4204344e165e06 100644 --- a/webstorage/idlharness.html +++ b/webstorage/idlharness.html @@ -18,12 +18,6 @@

Web Storage IDL tests

[Global=Window, Exposed=Window] interface Window { }; - -interface Event { -}; - -interface EventInit { -};
@@ -65,16 +59,21 @@ 

Web Storage IDL tests