diff options
182 files changed, 4785 insertions, 1943 deletions
diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 313e7aad293..603020309fb 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -127531,6 +127531,30 @@ {} ] ], + "css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-028.html": [ + [ + "/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-028.html", + [ + [ + "/css/css-shapes/shape-outside/supported-shapes/inset/reference/shape-outside-inset-010-ref.html", + "==" + ] + ], + {} + ] + ], + "css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-029.html": [ + [ + "/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-029.html", + [ + [ + "/css/css-shapes/shape-outside/supported-shapes/inset/reference/shape-outside-inset-010-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-shapes/shape-outside/supported-shapes/polygon/shape-outside-polygon-007.html": [ [ "/css/css-shapes/shape-outside/supported-shapes/polygon/shape-outside-polygon-007.html", @@ -273736,31 +273760,6 @@ {} ] ], - "fetch/api/basic/integrity.js": [ - [ - {} - ] - ], - "fetch/api/basic/mode-no-cors.js": [ - [ - {} - ] - ], - "fetch/api/basic/response-url.js": [ - [ - {} - ] - ], - "fetch/api/basic/scheme-blob.js": [ - [ - {} - ] - ], - "fetch/api/basic/scheme-others.js": [ - [ - {} - ] - ], "fetch/api/cors/cors-expose-star.js": [ [ {} @@ -287516,6 +287515,31 @@ {} ] ], + "images/wpt-logo/wpt-logo-darkblue-bg.svg": [ + [ + {} + ] + ], + "images/wpt-logo/wpt-logo-darkblue.svg": [ + [ + {} + ] + ], + "images/wpt-logo/wpt-logo-lightblue-bg.svg": [ + [ + {} + ] + ], + "images/wpt-logo/wpt-logo-orange-bg.svg": [ + [ + {} + ] + ], + "images/wpt-logo/wpt-logo-white.svg": [ + [ + {} + ] + ], "images/yellow.png": [ [ {} @@ -297191,6 +297215,11 @@ {} ] ], + "webaudio/resources/audionodeoptions.js": [ + [ + {} + ] + ], "webaudio/resources/audioparam-testing.js": [ [ {} @@ -326584,14 +326613,6 @@ } ] ], - "encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-href-ascii.html": [ - [ - "/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-href-ascii.html", - { - "timeout": "long" - } - ] - ], "encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-href-errors-han.html": [ [ "/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-href-errors-han.html", @@ -326928,14 +326949,6 @@ } ] ], - "encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-hangul.html": [ - [ - "/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-hangul.html", - { - "timeout": "long" - } - ] - ], "encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-misc.html": [ [ "/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-misc.html", @@ -328634,21 +328647,17 @@ {} ] ], - "fetch/api/basic/integrity-sharedworker.html": [ + "fetch/api/basic/integrity.sub.any.js": [ [ - "/fetch/api/basic/integrity-sharedworker.html", + "/fetch/api/basic/integrity.sub.any.html", {} - ] - ], - "fetch/api/basic/integrity-worker.html": [ + ], [ - "/fetch/api/basic/integrity-worker.html", + "/fetch/api/basic/integrity.sub.any.sharedworker.html", {} - ] - ], - "fetch/api/basic/integrity.html": [ + ], [ - "/fetch/api/basic/integrity.html", + "/fetch/api/basic/integrity.sub.any.worker.html", {} ] ], @@ -328664,15 +328673,13 @@ {} ] ], - "fetch/api/basic/mode-no-cors-worker.html": [ + "fetch/api/basic/mode-no-cors.sub.any.js": [ [ - "/fetch/api/basic/mode-no-cors-worker.html", + "/fetch/api/basic/mode-no-cors.sub.any.html", {} - ] - ], - "fetch/api/basic/mode-no-cors.html": [ + ], [ - "/fetch/api/basic/mode-no-cors.html", + "/fetch/api/basic/mode-no-cors.sub.any.worker.html", {} ] ], @@ -328762,15 +328769,13 @@ {} ] ], - "fetch/api/basic/response-url-worker.html": [ + "fetch/api/basic/response-url.sub.any.js": [ [ - "/fetch/api/basic/response-url-worker.html", + "/fetch/api/basic/response-url.sub.any.html", {} - ] - ], - "fetch/api/basic/response-url.html": [ + ], [ - "/fetch/api/basic/response-url.html", + "/fetch/api/basic/response-url.sub.any.worker.html", {} ] ], @@ -328784,15 +328789,13 @@ {} ] ], - "fetch/api/basic/scheme-blob-worker.html": [ + "fetch/api/basic/scheme-blob.sub.any.js": [ [ - "/fetch/api/basic/scheme-blob-worker.html", + "/fetch/api/basic/scheme-blob.sub.any.html", {} - ] - ], - "fetch/api/basic/scheme-blob.html": [ + ], [ - "/fetch/api/basic/scheme-blob.html", + "/fetch/api/basic/scheme-blob.sub.any.worker.html", {} ] ], @@ -328806,15 +328809,13 @@ {} ] ], - "fetch/api/basic/scheme-others-worker.html": [ + "fetch/api/basic/scheme-others.sub.any.js": [ [ - "/fetch/api/basic/scheme-others-worker.html", + "/fetch/api/basic/scheme-others.sub.any.html", {} - ] - ], - "fetch/api/basic/scheme-others.html": [ + ], [ - "/fetch/api/basic/scheme-others.html", + "/fetch/api/basic/scheme-others.sub.any.worker.html", {} ] ], @@ -369114,6 +369115,12 @@ {} ] ], + "webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html": [ + [ + "/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html", + {} + ] + ], "webaudio/the-audio-api/the-analysernode-interface/test-analyser-gain.html": [ [ "/webaudio/the-audio-api/the-analysernode-interface/test-analyser-gain.html", @@ -369150,6 +369157,12 @@ {} ] ], + "webaudio/the-audio-api/the-audiobuffersourcenode-interface/ctor-audiobuffersource.html": [ + [ + "/webaudio/the-audio-api/the-audiobuffersourcenode-interface/ctor-audiobuffersource.html", + {} + ] + ], "webaudio/the-audio-api/the-audiodestinationnode-interface/idl-test.html": [ [ "/webaudio/the-audio-api/the-audiodestinationnode-interface/idl-test.html", @@ -369462,6 +369475,12 @@ {} ] ], + "webaudio/the-audio-api/the-biquadfilternode-interface/ctor-biquadfilter.html": [ + [ + "/webaudio/the-audio-api/the-biquadfilternode-interface/ctor-biquadfilter.html", + {} + ] + ], "webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering.html": [ [ "/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering.html", @@ -369492,12 +369511,24 @@ {} ] ], + "webaudio/the-audio-api/the-channelmergernode-interface/ctor-channelmerger.html": [ + [ + "/webaudio/the-audio-api/the-channelmergernode-interface/ctor-channelmerger.html", + {} + ] + ], "webaudio/the-audio-api/the-channelsplitternode-interface/audiochannelsplitter.html": [ [ "/webaudio/the-audio-api/the-channelsplitternode-interface/audiochannelsplitter.html", {} ] ], + "webaudio/the-audio-api/the-channelsplitternode-interface/ctor-channelsplitter.html": [ + [ + "/webaudio/the-audio-api/the-channelsplitternode-interface/ctor-channelsplitter.html", + {} + ] + ], "webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-basic.html": [ [ "/webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-basic.html", @@ -369516,6 +369547,12 @@ {} ] ], + "webaudio/the-audio-api/the-constantsourcenode-interface/ctor-constantsource.html": [ + [ + "/webaudio/the-audio-api/the-constantsourcenode-interface/ctor-constantsource.html", + {} + ] + ], "webaudio/the-audio-api/the-constantsourcenode-interface/test-constantsourcenode.html": [ [ "/webaudio/the-audio-api/the-constantsourcenode-interface/test-constantsourcenode.html", @@ -369564,6 +369601,18 @@ {} ] ], + "webaudio/the-audio-api/the-convolvernode-interface/ctor-convolver.html": [ + [ + "/webaudio/the-audio-api/the-convolvernode-interface/ctor-convolver.html", + {} + ] + ], + "webaudio/the-audio-api/the-delaynode-interface/ctor-delay.html": [ + [ + "/webaudio/the-audio-api/the-delaynode-interface/ctor-delay.html", + {} + ] + ], "webaudio/the-audio-api/the-delaynode-interface/delaynode-max-default-delay.html": [ [ "/webaudio/the-audio-api/the-delaynode-interface/delaynode-max-default-delay.html", @@ -369606,12 +369655,24 @@ {} ] ], + "webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html": [ + [ + "/webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html", + {} + ] + ], "webaudio/the-audio-api/the-dynamicscompressornode-interface/dynamicscompressor-basic.html": [ [ "/webaudio/the-audio-api/the-dynamicscompressornode-interface/dynamicscompressor-basic.html", {} ] ], + "webaudio/the-audio-api/the-gainnode-interface/ctor-gain.html": [ + [ + "/webaudio/the-audio-api/the-gainnode-interface/ctor-gain.html", + {} + ] + ], "webaudio/the-audio-api/the-gainnode-interface/gain-basic.html": [ [ "/webaudio/the-audio-api/the-gainnode-interface/gain-basic.html", @@ -369636,6 +369697,12 @@ {} ] ], + "webaudio/the-audio-api/the-iirfilternode-interface/ctor-iirfilter.html": [ + [ + "/webaudio/the-audio-api/the-iirfilternode-interface/ctor-iirfilter.html", + {} + ] + ], "webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-basic.html": [ [ "/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-basic.html", @@ -369666,12 +369733,30 @@ {} ] ], + "webaudio/the-audio-api/the-offlineaudiocontext-interface/ctor-offlineaudiocontext.html": [ + [ + "/webaudio/the-audio-api/the-offlineaudiocontext-interface/ctor-offlineaudiocontext.html", + {} + ] + ], "webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html": [ [ "/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html", {} ] ], + "webaudio/the-audio-api/the-oscillatornode-interface/ctor-oscillator.html": [ + [ + "/webaudio/the-audio-api/the-oscillatornode-interface/ctor-oscillator.html", + {} + ] + ], + "webaudio/the-audio-api/the-pannernode-interface/ctor-panner.html": [ + [ + "/webaudio/the-audio-api/the-pannernode-interface/ctor-panner.html", + {} + ] + ], "webaudio/the-audio-api/the-pannernode-interface/distance-exponential.html": [ [ "/webaudio/the-audio-api/the-pannernode-interface/distance-exponential.html", @@ -369744,6 +369829,12 @@ {} ] ], + "webaudio/the-audio-api/the-stereopanner-interface/ctor-stereopanner.html": [ + [ + "/webaudio/the-audio-api/the-stereopanner-interface/ctor-stereopanner.html", + {} + ] + ], "webaudio/the-audio-api/the-stereopanner-interface/no-dezippering.html": [ [ "/webaudio/the-audio-api/the-stereopanner-interface/no-dezippering.html", @@ -369762,6 +369853,12 @@ {} ] ], + "webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper.html": [ + [ + "/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper.html", + {} + ] + ], "webaudio/the-audio-api/the-waveshapernode-interface/curve-tests.html": [ [ "/webaudio/the-audio-api/the-waveshapernode-interface/curve-tests.html", @@ -375554,6 +375651,12 @@ {} ] ], + "xhr/close-worker-with-xhr-in-progress.html": [ + [ + "/xhr/close-worker-with-xhr-in-progress.html", + {} + ] + ], "xhr/data-uri.htm": [ [ "/xhr/data-uri.htm", @@ -400600,7 +400703,7 @@ "support" ], "FileAPI/historical.https.html": [ - "93903b4f58bc215ea2a67fc6d281593ec5ce79e9", + "e1cf63d05a0e401cc38a11d2b42efb9e8d315610", "testharness" ], "FileAPI/idlharness-manual.html": [ @@ -400840,7 +400943,7 @@ "testharness" ], "IndexedDB/historical.html": [ - "0c4584e1b021a286445a2a9d3388ff011a1b933e", + "2a5eaca2bbe1d0c9495ab7c48560d611f60a007c", "testharness" ], "IndexedDB/idb-binary-key-detached.htm": [ @@ -425476,7 +425579,7 @@ "testharness" ], "content-security-policy/frame-ancestors/frame-ancestors-overrides-xfo.html": [ - "988cf59388b862631a33dfab0565c937e9515763", + "a1f179dec77eec4b0172613c56b2ba9608e24b12", "testharness" ], "content-security-policy/frame-ancestors/frame-ancestors-self-allow.html": [ @@ -514356,7 +514459,7 @@ "reftest" ], "css/css-shapes/shape-outside/shape-image/shape-image-010.html": [ - "69b7cd75faad315f1c87214d7f74cbebeba0f37d", + "6dcfc209b1e08c1a3f41036a301fa3e0a434b4af", "reftest" ], "css/css-shapes/shape-outside/shape-image/shape-image-011.html": [ @@ -514556,7 +514659,7 @@ "reftest" ], "css/css-shapes/shape-outside/supported-shapes/circle/shape-outside-circle-027.html": [ - "97237d7bc6fb98fc1cc0b27d493b2610d91b483b", + "87477b60302ae3f7e20c488b5a944d7b9169ba0d", "reftest" ], "css/css-shapes/shape-outside/supported-shapes/circle/shape-outside-circle-028.html": [ @@ -514596,7 +514699,7 @@ "reftest" ], "css/css-shapes/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-015.html": [ - "e6001d6ecc8565842fa1fe68ce280c06a17ee62a", + "121434db8bfc63877d10383c167ee3f2f8d65d7a", "reftest" ], "css/css-shapes/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-016.html": [ @@ -514604,7 +514707,7 @@ "reftest" ], "css/css-shapes/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-017.html": [ - "ff109f0d61bd487df7834e8c56330a5c6f4bc52d", + "c16469402616b77d502ed4a65b623022a883c902", "reftest" ], "css/css-shapes/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-018.html": [ @@ -514652,27 +514755,35 @@ "support" ], "css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-010.html": [ - "7878c4b4b0cd5b36e153d4fad565b37a1aeb746d", + "0a1a7449964d3dc18dbabb4da8777f7e1aedbf7e", "reftest" ], "css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-011.html": [ - "bda8e62930c2f084005998d1e1679c5ff85f25a0", + "e98e70e094d84a2434d5d634caa482df9e6aeb07", "reftest" ], "css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-012.html": [ - "5ef1e674163f358a2dbac6fd6175ff424e2a46ba", + "39ba9b59b93ada88d6655529a8af3d3d6d7c00be", "reftest" ], "css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-013.html": [ - "2347978786094f1a6bb4a5a9a030c7a11cc85781", + "d53115c05401ffd274b55c6a95c9e4fd05011da1", "reftest" ], "css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-014.html": [ - "124c822825bb26bec99543892f75ea0b11b0e74c", + "2ef7ecd7321bb6639490110e45118ec58ee2aa9c", "reftest" ], "css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-015.html": [ - "23eab9e83a350804230169f4edc5e50a55716fe7", + "04a6a67837127ba47e757e5cc3a9ff91c1e01d9a", + "reftest" + ], + "css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-028.html": [ + "cafd680e210a6d677bde00ae4c5f9263c1e7b48e", + "reftest" + ], + "css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-029.html": [ + "67161f08b8aec3fe9bd94e14cbe865dd4c9d3664", "reftest" ], "css/css-shapes/shape-outside/supported-shapes/polygon/reference/shape-outside-polygon-007-ref.html": [ @@ -539864,7 +539975,7 @@ "testharness" ], "css/cssom/overflow-serialization.html": [ - "48ca70f4c20da103276e1b053ca0e4613fcc2819", + "85952fbd040de03f5082f28ba8116fd4827a1fc3", "testharness" ], "css/cssom/selectorSerialize.html": [ @@ -539908,7 +540019,7 @@ "testharness" ], "css/cssom/shorthand-values.html": [ - "8bfc0dff5da1859e17df31ceeca710d17a982109", + "9211674fd69ddfa32d3bafcf2bc967977eb3ec31", "testharness" ], "css/cssom/style-sheet-interfaces-001.html": [ @@ -540676,7 +540787,7 @@ "testharness" ], "css/geometry/DOMQuad-001.html": [ - "1fe1fb785f99b90bae48f0f2d8eb46765c6f6fbb", + "cd82e18b88904531ffbfa88f11d90dfef571a30a", "testharness" ], "css/geometry/DOMQuad-002.html": [ @@ -540692,7 +540803,7 @@ "testharness" ], "css/geometry/DOMRectList.html": [ - "382b6c7ea9bc4c75d1b007b59ccdcb9c642f51ce", + "3b63015ab3dbe4b7ea4ac7ede67f6db603c0f65c", "testharness" ], "css/geometry/OWNERS": [ @@ -552756,7 +552867,7 @@ "testharness" ], "dom/historical.html": [ - "ccf3d9d2d8eb3e7353ecedd8a4d8ba232f9374ec", + "291d078c4424d0491aeab7524d350eab7304f989", "testharness" ], "dom/interface-objects.html": [ @@ -555031,10 +555142,6 @@ "cb27b3ae6b3fb2d85f462cb5a1d0e703a3379e5c", "support" ], - "encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-href-ascii.html": [ - "08ce23f14166644363f128d80330804706fdfd3f", - "testharness" - ], "encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-href-errors-han.html": [ "c250dd2597bf3e6b66d4bed1484363ee186197e3", "testharness" @@ -555411,10 +555518,6 @@ "c79f9150befa2f7ce67d17069da7fb66f7f22ca0", "support" ], - "encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-hangul.html": [ - "3a2d013060c95824579de848af715c1c8135c206", - "testharness" - ], "encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-hangul.html.headers": [ "c79f9150befa2f7ce67d17069da7fb66f7f22ca0", "support" @@ -557371,22 +557474,10 @@ "54181cd222c7a5428f9468f4777c273ecc553f4f", "testharness" ], - "fetch/api/basic/integrity-sharedworker.html": [ - "00d7eae5a324653caae19ab83bef76dd3503fb3b", - "testharness" - ], - "fetch/api/basic/integrity-worker.html": [ - "1a0a6abd1c6bf8c4665a242d64f50bbbff4982f8", + "fetch/api/basic/integrity.sub.any.js": [ + "7f25bf12a25919d07f2fd04fabaf8cd90f4cf77a", "testharness" ], - "fetch/api/basic/integrity.html": [ - "aa6d9159321e410d1e96c045f8f4d8700494beeb", - "testharness" - ], - "fetch/api/basic/integrity.js": [ - "59e8c5ebf0dfd2ab2432f28dcee5db82e9505cff", - "support" - ], "fetch/api/basic/keepalive.html": [ "1ecdcb478b65b258e79242ae17af79ba903db412", "testharness" @@ -557395,18 +557486,10 @@ "5e2e35f820982002b967d7444507a2bfc0d3aa34", "testharness" ], - "fetch/api/basic/mode-no-cors-worker.html": [ - "39992b8abf3ab30182dfbaa5816cc154a22ae0ad", + "fetch/api/basic/mode-no-cors.sub.any.js": [ + "5ccf57aa2feb7d11e4372ba71f81d6726875ae03", "testharness" ], - "fetch/api/basic/mode-no-cors.html": [ - "ff174cb1a76a63473028b72b3319602685689cb5", - "testharness" - ], - "fetch/api/basic/mode-no-cors.js": [ - "311ecadfe0c44430846b2f11facf53c1fafc6df0", - "support" - ], "fetch/api/basic/mode-same-origin.any.js": [ "1027de012d62a36a0df53bfadbfb8341a22558c0", "testharness" @@ -557443,50 +557526,26 @@ "8c85a2549ca2108b07f8065699a8dd182acc6268", "testharness" ], - "fetch/api/basic/response-url-worker.html": [ - "3d615668cb0122600af10d80cac4a7ebfe051528", - "testharness" - ], - "fetch/api/basic/response-url.html": [ - "9e7c61ac685654e355174c960ba2084d17ff7f2e", + "fetch/api/basic/response-url.sub.any.js": [ + "f43c11ef52661046824b328112f6ab8826bed027", "testharness" ], - "fetch/api/basic/response-url.js": [ - "444ef1e53b422f74a4bb322099d8b1147ed8f52b", - "support" - ], "fetch/api/basic/scheme-about.any.js": [ "68b11deaa95a691a8e0c76bdc9b7a07b5dea9868", "testharness" ], - "fetch/api/basic/scheme-blob-worker.html": [ - "adfea540164a4113484ea29007ac3738bb7456c4", - "testharness" - ], - "fetch/api/basic/scheme-blob.html": [ - "5835c0c3b108f05b61ef0db945f272264b377d6c", + "fetch/api/basic/scheme-blob.sub.any.js": [ + "ec722257d9e93842751547b5a2a8cfff9da6d9de", "testharness" ], - "fetch/api/basic/scheme-blob.js": [ - "ab29ee7bde800b3ffaade990d86816ea9b6cb2c7", - "support" - ], "fetch/api/basic/scheme-data.any.js": [ "d312396ed3c5a90004d46c3d630525cb3e8228e1", "testharness" ], - "fetch/api/basic/scheme-others-worker.html": [ - "4ea145afbbe3b349c227c19ac5612db94b10c61c", - "testharness" - ], - "fetch/api/basic/scheme-others.html": [ - "e7594d1119e1c937663b4bb0385b69c442f1c78f", + "fetch/api/basic/scheme-others.sub.any.js": [ + "9b82765bb46386db2408260c14a511afb0ba662e", "testharness" ], - "fetch/api/basic/scheme-others.js": [ - "e9f99ee8112a0e0983322aece2034461125a46b5", - "support" - ], "fetch/api/basic/stream-response.any.js": [ "b989131e8cf68e37c6d27397d801bfcc9c97b7ed", "testharness" @@ -558256,7 +558315,7 @@ "support" ], "fetch/corb/README.md": [ - "7f3ebd888c16f457c7f137362cff620ae2cc82b3", + "d532c359cdb1359f88ef79afff88052b3387dbf6", "support" ], "fetch/corb/img-html-correctly-labeled.sub-expected.html": [ @@ -558268,7 +558327,7 @@ "reftest" ], "fetch/corb/img-mime-types-coverage.tentative.sub.html": [ - "ccceb2eab638a0e7c88c6e3eed45c51148e0f406", + "58422f923455c1f62e0c4e743b1c900061657146", "testharness" ], "fetch/corb/img-png-mislabeled-as-html-nosniff.tentative.sub-expected.html": [ @@ -579191,6 +579250,26 @@ "6a8595f419a6ec6bc13222f348ed42ad4c7b9783", "support" ], + "images/wpt-logo/wpt-logo-darkblue-bg.svg": [ + "d2f8fe86fa19cfeada7285eb9fdd1c7d8aeae500", + "support" + ], + "images/wpt-logo/wpt-logo-darkblue.svg": [ + "2cdd9e0004bfb27185f1d306b84b39e7b260bc06", + "support" + ], + "images/wpt-logo/wpt-logo-lightblue-bg.svg": [ + "79ba6641c99eacdedc2c9279ece8622944a37830", + "support" + ], + "images/wpt-logo/wpt-logo-orange-bg.svg": [ + "af4e23f30394794d87eb96dfa1b4e940c6b743f1", + "support" + ], + "images/wpt-logo/wpt-logo-white.svg": [ + "9c6494169ea074ede142c00b0e34f27df43007bd", + "support" + ], "images/yellow.png": [ "50eab1cff1bf2b1e68403ac724aa8043205901be", "support" @@ -590580,7 +590659,7 @@ "testharness" ], "referrer-policy/generic/common.js": [ - "00233e7d4513c8e3c4b7f7fa60f313ef1b6dbddd", + "583f61d9d6f30742f8144ded8ea31035a07034a3", "support" ], "referrer-policy/generic/iframe-inheritance.html": [ @@ -590592,7 +590671,7 @@ "testharness" ], "referrer-policy/generic/referrer-policy-test-case.js": [ - "20c8273fd2a2cad07d3a607717d69d6ae94cf27e", + "62d77f2911b075bfa2de6138faffd8f5997ac7d5", "support" ], "referrer-policy/generic/sandboxed-iframe-with-opaque-origin.html": [ @@ -608935,6 +609014,10 @@ "9ef52c13448d19b241b40a5c81f4a0480c05c5de", "support" ], + "webaudio/resources/audionodeoptions.js": [ + "d7712311bddd23e171e7e1f024aec0a565b08a13", + "support" + ], "webaudio/resources/audioparam-testing.js": [ "2855fbee30e629ea397166911b9bcdec74bd4fdf", "support" @@ -608999,6 +609082,10 @@ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" ], + "webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html": [ + "7e35ac29f00d39c84230535212c0b9ea081951d3", + "testharness" + ], "webaudio/the-audio-api/the-analysernode-interface/test-analyser-gain.html": [ "e2320e33ef1df0155d5fcf536550e0e398b15407", "testharness" @@ -609031,6 +609118,10 @@ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" ], + "webaudio/the-audio-api/the-audiobuffersourcenode-interface/ctor-audiobuffersource.html": [ + "ce84d25460435564021a13dc9e26384bc30e9d96", + "testharness" + ], "webaudio/the-audio-api/the-audiocontext-interface/.gitkeep": [ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" @@ -609311,6 +609402,10 @@ "f24a473f695c2d10788ba7d50728259a08ed53c8", "testharness" ], + "webaudio/the-audio-api/the-biquadfilternode-interface/ctor-biquadfilter.html": [ + "475916d4aba810c017c385d98d51d353ad0fc561", + "testharness" + ], "webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering.html": [ "348376a643b765700342e9620e1346d432a28131", "testharness" @@ -609335,6 +609430,10 @@ "250c35e36dda600c30554024cbd500a37180292a", "testharness" ], + "webaudio/the-audio-api/the-channelmergernode-interface/ctor-channelmerger.html": [ + "72bfba4cbca1b4d3e7692ef236afb905f852fadd", + "testharness" + ], "webaudio/the-audio-api/the-channelsplitternode-interface/.gitkeep": [ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" @@ -609343,6 +609442,10 @@ "80cfd321970b37df7995d6e0d262a2c008e6e10c", "testharness" ], + "webaudio/the-audio-api/the-channelsplitternode-interface/ctor-channelsplitter.html": [ + "743fd6af6f67958f67f4a63cef432515518edf41", + "testharness" + ], "webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-basic.html": [ "d60c7c7c6d9236f773199a213bef6b1103e02e2e", "testharness" @@ -609355,6 +609458,10 @@ "ce90b4d7ca5840abdc830d734df26028958fadd7", "testharness" ], + "webaudio/the-audio-api/the-constantsourcenode-interface/ctor-constantsource.html": [ + "1fa8892c98ce5f979a08294a838b3b91ce11a3a3", + "testharness" + ], "webaudio/the-audio-api/the-constantsourcenode-interface/test-constantsourcenode.html": [ "711b3f183d847e437a4c332f33054cc5a648fd22", "testharness" @@ -609391,10 +609498,18 @@ "f32f5acdf031b1a2b32bc37324b105d1df7c5fdb", "testharness" ], + "webaudio/the-audio-api/the-convolvernode-interface/ctor-convolver.html": [ + "70f49ae8525bd998d3b51bada7a296ba4cef03e5", + "testharness" + ], "webaudio/the-audio-api/the-delaynode-interface/.gitkeep": [ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" ], + "webaudio/the-audio-api/the-delaynode-interface/ctor-delay.html": [ + "473c5e05ab6ee4930de9e3a3ec47075af7e9650d", + "testharness" + ], "webaudio/the-audio-api/the-delaynode-interface/delaynode-max-default-delay.html": [ "c732635549f5eab61f8bdce05b27f0f3e8a3f6c2", "testharness" @@ -609427,6 +609542,10 @@ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" ], + "webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html": [ + "6338104e8199673ff7de6f41d310b79a2ee51f04", + "testharness" + ], "webaudio/the-audio-api/the-dynamicscompressornode-interface/dynamicscompressor-basic.html": [ "6ceaf50b8cacdfa246bc997f2c8e46aefd789659", "testharness" @@ -609435,6 +609554,10 @@ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" ], + "webaudio/the-audio-api/the-gainnode-interface/ctor-gain.html": [ + "3c77f0ac735a224fa6d905f62585beba39643393", + "testharness" + ], "webaudio/the-audio-api/the-gainnode-interface/gain-basic.html": [ "70165c60c482d6507670af965756f639e7b3ba78", "testharness" @@ -609455,6 +609578,10 @@ "bf2de43e568c79b96fd5b0602e26346c483162a5", "testharness" ], + "webaudio/the-audio-api/the-iirfilternode-interface/ctor-iirfilter.html": [ + "3627d5b4a447a62de6c6a6f10556fa9f9dec1700", + "testharness" + ], "webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-basic.html": [ "176168861bc667b2b05312dbae48f76f7f90d791", "testharness" @@ -609491,6 +609618,10 @@ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" ], + "webaudio/the-audio-api/the-offlineaudiocontext-interface/ctor-offlineaudiocontext.html": [ + "4264798e9e64d30c72f9f0577a9648efa2d0a50a", + "testharness" + ], "webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html": [ "d0b1fefa6c0f75c0666cd5b7e8305099e9925d62", "testharness" @@ -609499,10 +609630,18 @@ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" ], + "webaudio/the-audio-api/the-oscillatornode-interface/ctor-oscillator.html": [ + "53df9d36a96c61a6ce9215cbc2830783e26c91be", + "testharness" + ], "webaudio/the-audio-api/the-pannernode-interface/.gitkeep": [ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" ], + "webaudio/the-audio-api/the-pannernode-interface/ctor-panner.html": [ + "2b59d21a54b2216c1171a6ba2c7809291955a8af", + "testharness" + ], "webaudio/the-audio-api/the-pannernode-interface/distance-exponential.html": [ "c1c94753ebcd1930e326d73c085e6c3197967cd5", "testharness" @@ -609559,6 +609698,10 @@ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" ], + "webaudio/the-audio-api/the-stereopanner-interface/ctor-stereopanner.html": [ + "1908ffc477d8c16b81ab371f5b9dbca46cc16a83", + "testharness" + ], "webaudio/the-audio-api/the-stereopanner-interface/no-dezippering.html": [ "b3525a2c459125281196201216417c39030e79a8", "testharness" @@ -609575,6 +609718,10 @@ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" ], + "webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper.html": [ + "80b585554acf22f357264e3a024d2159fd184f13", + "testharness" + ], "webaudio/the-audio-api/the-waveshapernode-interface/curve-tests.html": [ "f88431616d6a8084a3434c1606e3543178d019fb", "testharness" @@ -609768,7 +609915,7 @@ "wdspec" ], "webdriver/tests/cookies/add_cookie.py": [ - "c87dc51111c10bbc29339ba0d1be85fb35ee6d6f", + "29891e121def1917c47c70efd19b40ed5f2ea61d", "wdspec" ], "webdriver/tests/cookies/delete_cookie.py": [ @@ -616703,6 +616850,10 @@ "54a03fefabfad02e09baa4e9d37e19b6403dad9b", "testharness" ], + "xhr/close-worker-with-xhr-in-progress.html": [ + "c1907caa8cbe6b30cd70e174163e7c4cd510934d", + "testharness" + ], "xhr/data-uri.htm": [ "d42eb014a32cf82d7eba31ad9b80f51bff43eeea", "testharness" diff --git a/tests/wpt/metadata/css/css-fonts/variations/font-weight-matching.html.ini b/tests/wpt/metadata/css/css-fonts/variations/font-weight-matching.html.ini index 719179298dc..7c80799aece 100644 --- a/tests/wpt/metadata/css/css-fonts/variations/font-weight-matching.html.ini +++ b/tests/wpt/metadata/css/css-fonts/variations/font-weight-matching.html.ini @@ -8,9 +8,6 @@ [Test @font-face matching for weight 400] expected: FAIL - [Test @font-face matching for weight 420] - expected: FAIL - [Test @font-face matching for weight 470] expected: FAIL @@ -32,3 +29,12 @@ [Test @font-face matching for weight 1000] expected: FAIL + [Test @font-face matching for weight 99] + expected: FAIL + + [Test @font-face matching for weight 100] + expected: FAIL + + [Test @font-face matching for weight 249] + expected: FAIL + diff --git a/tests/wpt/metadata/css/css-values/vh_not_refreshing_on_chrome.html.ini b/tests/wpt/metadata/css/css-values/vh_not_refreshing_on_chrome.html.ini new file mode 100644 index 00000000000..26435e28b09 --- /dev/null +++ b/tests/wpt/metadata/css/css-values/vh_not_refreshing_on_chrome.html.ini @@ -0,0 +1,2 @@ +[vh_not_refreshing_on_chrome.html] + expected: FAIL diff --git a/tests/wpt/metadata/css/cssom/shorthand-values.html.ini b/tests/wpt/metadata/css/cssom/shorthand-values.html.ini index b8f37ce1f26..cb0502d1dcd 100644 --- a/tests/wpt/metadata/css/cssom/shorthand-values.html.ini +++ b/tests/wpt/metadata/css/cssom/shorthand-values.html.ini @@ -26,9 +26,6 @@ [The serialization of border: solid; border-style: dotted should be canonical.] expected: FAIL - [The serialization of overflow-x: scroll; overflow-y: hidden; should be canonical.] - expected: FAIL - [The serialization of outline-width: 2px; outline-style: dotted; outline-color: blue; should be canonical.] expected: FAIL diff --git a/tests/wpt/metadata/css/geometry/DOMQuad-001.html.ini b/tests/wpt/metadata/css/geometry/DOMQuad-001.html.ini index 4e4725b3b63..826a7c7c3cf 100644 --- a/tests/wpt/metadata/css/geometry/DOMQuad-001.html.ini +++ b/tests/wpt/metadata/css/geometry/DOMQuad-001.html.ini @@ -24,3 +24,6 @@ [boundsAttribute1: points] expected: FAIL + [p1Top4Attributes1: bounds] + expected: FAIL + diff --git a/tests/wpt/metadata/css/geometry/DOMRectList.html.ini b/tests/wpt/metadata/css/geometry/DOMRectList.html.ini index e110991bf13..810eaeba14f 100644 --- a/tests/wpt/metadata/css/geometry/DOMRectList.html.ini +++ b/tests/wpt/metadata/css/geometry/DOMRectList.html.ini @@ -2,3 +2,9 @@ [DOMRectList item()] expected: FAIL + [DOMRectList is not [NoInterfaceObject\]] + expected: FAIL + + [DOMRectList is not [LegacyArrayClass\]] + expected: FAIL + diff --git a/tests/wpt/metadata/fetch/api/basic/integrity-sharedworker.html.ini b/tests/wpt/metadata/fetch/api/basic/integrity-sharedworker.html.ini deleted file mode 100644 index 28b184537a6..00000000000 --- a/tests/wpt/metadata/fetch/api/basic/integrity-sharedworker.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[integrity-sharedworker.html] - type: testharness - [Fetch in sharedworker: integrity handling] - expected: FAIL - diff --git a/tests/wpt/metadata/fetch/api/basic/integrity-worker.html.ini b/tests/wpt/metadata/fetch/api/basic/integrity-worker.html.ini deleted file mode 100644 index b0388b78fe4..00000000000 --- a/tests/wpt/metadata/fetch/api/basic/integrity-worker.html.ini +++ /dev/null @@ -1,20 +0,0 @@ -[integrity-worker.html] - type: testharness - [Invalid integrity] - expected: FAIL - - [Multiple integrities: invalid stronger than valid] - expected: FAIL - - [Multiple integrities: both are invalid] - expected: FAIL - - [CORS invalid integrity] - expected: FAIL - - [Empty string integrity for opaque response] - expected: FAIL - - [SHA-* integrity for opaque response] - expected: FAIL - diff --git a/tests/wpt/metadata/fetch/api/basic/integrity.html.ini b/tests/wpt/metadata/fetch/api/basic/integrity.html.ini deleted file mode 100644 index 9bdd3c7398e..00000000000 --- a/tests/wpt/metadata/fetch/api/basic/integrity.html.ini +++ /dev/null @@ -1,20 +0,0 @@ -[integrity.html] - type: testharness - [Invalid integrity] - expected: FAIL - - [Multiple integrities: invalid stronger than valid] - expected: FAIL - - [Multiple integrities: both are invalid] - expected: FAIL - - [CORS invalid integrity] - expected: FAIL - - [Empty string integrity for opaque response] - expected: FAIL - - [SHA-* integrity for opaque response] - expected: FAIL - diff --git a/tests/wpt/metadata/fetch/api/basic/integrity.sub.any.js.ini b/tests/wpt/metadata/fetch/api/basic/integrity.sub.any.js.ini new file mode 100644 index 00000000000..595efba71cd --- /dev/null +++ b/tests/wpt/metadata/fetch/api/basic/integrity.sub.any.js.ini @@ -0,0 +1,44 @@ +[integrity.sub.any.sharedworker.html] + [Untitled] + expected: FAIL + + +[integrity.sub.any.worker.html] + [Invalid integrity] + expected: FAIL + + [Multiple integrities: invalid stronger than valid] + expected: FAIL + + [Multiple integrities: both are invalid] + expected: FAIL + + [CORS invalid integrity] + expected: FAIL + + [Empty string integrity for opaque response] + expected: FAIL + + [SHA-* integrity for opaque response] + expected: FAIL + + +[integrity.sub.any.html] + [Invalid integrity] + expected: FAIL + + [Multiple integrities: invalid stronger than valid] + expected: FAIL + + [Multiple integrities: both are invalid] + expected: FAIL + + [CORS invalid integrity] + expected: FAIL + + [Empty string integrity for opaque response] + expected: FAIL + + [SHA-* integrity for opaque response] + expected: FAIL + diff --git a/tests/wpt/metadata/fetch/api/basic/mode-no-cors-worker.html.ini b/tests/wpt/metadata/fetch/api/basic/mode-no-cors-worker.html.ini deleted file mode 100644 index c4bbb4a0c0c..00000000000 --- a/tests/wpt/metadata/fetch/api/basic/mode-no-cors-worker.html.ini +++ /dev/null @@ -1,8 +0,0 @@ -[mode-no-cors-worker.html] - type: testharness - [Fetch https://web-platform.test:8443/fetch/api/resources/top.txt with no-cors mode] - expected: FAIL - - [Fetch http://web-platform.test:8001/fetch/api/resources/top.txt with no-cors mode] - expected: FAIL - diff --git a/tests/wpt/metadata/fetch/api/basic/mode-no-cors.html.ini b/tests/wpt/metadata/fetch/api/basic/mode-no-cors.html.ini deleted file mode 100644 index 83125d3da86..00000000000 --- a/tests/wpt/metadata/fetch/api/basic/mode-no-cors.html.ini +++ /dev/null @@ -1,8 +0,0 @@ -[mode-no-cors.html] - type: testharness - [Fetch https://web-platform.test:8443/fetch/api/resources/top.txt with no-cors mode] - expected: FAIL - - [Fetch http://web-platform.test:8001/fetch/api/resources/top.txt with no-cors mode] - expected: FAIL - diff --git a/tests/wpt/metadata/fetch/api/basic/mode-no-cors.sub.any.js.ini b/tests/wpt/metadata/fetch/api/basic/mode-no-cors.sub.any.js.ini new file mode 100644 index 00000000000..2f4e3c3d3b6 --- /dev/null +++ b/tests/wpt/metadata/fetch/api/basic/mode-no-cors.sub.any.js.ini @@ -0,0 +1,15 @@ +[mode-no-cors.sub.any.worker.html] + [Fetch https://web-platform.test:8443/fetch/api/resources/top.txt with no-cors mode] + expected: FAIL + + [Fetch http://web-platform.test:8001/fetch/api/resources/top.txt with no-cors mode] + expected: FAIL + + +[mode-no-cors.sub.any.html] + [Fetch https://web-platform.test:8443/fetch/api/resources/top.txt with no-cors mode] + expected: FAIL + + [Fetch http://web-platform.test:8001/fetch/api/resources/top.txt with no-cors mode] + expected: FAIL + diff --git a/tests/wpt/metadata/fetch/corb/img-mime-types-coverage.tentative.sub.html.ini b/tests/wpt/metadata/fetch/corb/img-mime-types-coverage.tentative.sub.html.ini index 18a49345106..e607184f037 100644 --- a/tests/wpt/metadata/fetch/corb/img-mime-types-coverage.tentative.sub.html.ini +++ b/tests/wpt/metadata/fetch/corb/img-mime-types-coverage.tentative.sub.html.ini @@ -2,3 +2,45 @@ [Untitled] expected: FAIL + [CORB should allow the response if Content-Type is: 'image/svg+xml'. ] + expected: FAIL + + [CORB should block the response if Content-Type is: 'text/html'. ] + expected: FAIL + + [CORB should block the response if Content-Type is: 'text/json'. ] + expected: FAIL + + [CORB should block the response if Content-Type is: 'application/json'. ] + expected: FAIL + + [CORB should block the response if Content-Type is: 'text/xml'. ] + expected: FAIL + + [CORB should block the response if Content-Type is: 'application/xml'. ] + expected: FAIL + + [CORB should block the response if Content-Type is: 'application/blah+json'. ] + expected: FAIL + + [CORB should block the response if Content-Type is: 'text/blah+json'. ] + expected: FAIL + + [CORB should block the response if Content-Type is: 'application/blah+xml'. ] + expected: FAIL + + [CORB should block the response if Content-Type is: 'text/blah+xml'. ] + expected: FAIL + + [CORB should block the response if Content-Type is: 'TEXT/HTML'. ] + expected: FAIL + + [CORB should block the response if Content-Type is: 'TEXT/JSON'. ] + expected: FAIL + + [CORB should block the response if Content-Type is: 'TEXT/BLAH+JSON'. ] + expected: FAIL + + [CORB should block the response if Content-Type is: 'APPLICATION/BLAH+XML'. ] + expected: FAIL + diff --git a/tests/wpt/metadata/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-undefined.tentative.html.ini b/tests/wpt/metadata/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-undefined.tentative.html.ini index 5b38c37b086..78879bad5f1 100644 --- a/tests/wpt/metadata/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-undefined.tentative.html.ini +++ b/tests/wpt/metadata/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-undefined.tentative.html.ini @@ -1,4 +1,5 @@ [javascript-url-abort-return-value-undefined.tentative.html] + expected: TIMEOUT [Not aborting fetch for javascript:undefined navigation] - expected: FAIL + expected: TIMEOUT diff --git a/tests/wpt/web-platform-tests/FileAPI/historical.https.html b/tests/wpt/web-platform-tests/FileAPI/historical.https.html index 9d78b5690fb..877aed06466 100644 --- a/tests/wpt/web-platform-tests/FileAPI/historical.https.html +++ b/tests/wpt/web-platform-tests/FileAPI/historical.https.html @@ -10,17 +10,20 @@ <body> <div id="log"></div> <script> - test(function() { - assert_false('toNativeLineEndings' in window); - }, '"toNativeLineEndings" should not be supported'); - - test(function() { - assert_false('FileError' in window); - }, '"FileError" should not be supported'); + var removedFromWindow = [ + 'toNativeLineEndings', + 'FileError', + 'FileException', + 'FileHandle', + 'FileRequest', + 'MutableFile', + ]; - test(function() { - assert_false('FileException' in window); - }, '"FileException" should not be supported'); + removedFromWindow.forEach(function(name) { + test(function() { + assert_false(name in window); + }, '"' + name + '" should not be supported'); + }); test(function() { var b = new Blob(); diff --git a/tests/wpt/web-platform-tests/IndexedDB/historical.html b/tests/wpt/web-platform-tests/IndexedDB/historical.html index 73d78c81676..8e7097eb46f 100644 --- a/tests/wpt/web-platform-tests/IndexedDB/historical.html +++ b/tests/wpt/web-platform-tests/IndexedDB/historical.html @@ -63,4 +63,18 @@ test(function() { // Replaced circa May 2012 by a DOMString (later, IDBTransactionMode enum). assert_false('VERSION_CHANGE' in IDBTransaction); }, '"VERSION_CHANGE" should not be supported on IDBTransaction.'); + +// Gecko-proprietary interfaces. +var removedFromWindow = [ + 'IDBFileHandle', + 'IDBFileRequest', + 'IDBMutableFile', +]; + +removedFromWindow.forEach(function(name) { + test(function() { + assert_false(name in window); + }, '"' + name + '" should not be supported'); +}); + </script> diff --git a/tests/wpt/web-platform-tests/content-security-policy/frame-ancestors/frame-ancestors-overrides-xfo.html b/tests/wpt/web-platform-tests/content-security-policy/frame-ancestors/frame-ancestors-overrides-xfo.html index 2db0b7f6f7f..4b7b0994c00 100644 --- a/tests/wpt/web-platform-tests/content-security-policy/frame-ancestors/frame-ancestors-overrides-xfo.html +++ b/tests/wpt/web-platform-tests/content-security-policy/frame-ancestors/frame-ancestors-overrides-xfo.html @@ -10,7 +10,7 @@ var i = document.createElement('iframe'); i.src = "support/frame-ancestors-and-x-frame-options.sub.html?policy='self'&xfo=DENY"; i.onload = t.step_func_done(function () { - assert_equals(i.contentDocument.origin, document.origin, "The same-origin page loaded."); + assert_equals(i.contentWindow.origin, window.origin, "The same-origin page loaded."); }); document.body.appendChild(i); }, "A 'frame-ancestors' CSP directive overrides an 'x-frame-options' header which would block the page."); diff --git a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/shape-image/shape-image-010.html b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/shape-image/shape-image-010.html index aedab213e57..df993be751b 100644 --- a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/shape-image/shape-image-010.html +++ b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/shape-image/shape-image-010.html @@ -40,7 +40,7 @@ height: 100px; shape-outside: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAALpJREFUeNrs0UEVABAURcHP5pcRSxpR9FHGhhycuQ3emxI9TnxQ7pxttfH6jhoCIiBABASIgAARECACIiBABASIgAARECACIiBABASIgAARECACIiBABASIgAARECACIiBABASIgAARECACIiBABASIgAARECACIiBABASIgAARECACIiBABASIgAARECACIiBABASIgAARECACAsQFQAQEiIAAERAgAgJEQAQEiIAAEZDPuwAAAP//AwCf+AWUylJrCQAAAABJRU5ErkJggg==); shape-margin: 5%; - shape-image-threshold: 0.25; + shape-image-threshold: 0.7; } .blue { width: 2px; diff --git a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/circle/shape-outside-circle-027.html b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/circle/shape-outside-circle-027.html index 2141c12efab..b00f6c47583 100644 --- a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/circle/shape-outside-circle-027.html +++ b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/circle/shape-outside-circle-027.html @@ -36,7 +36,7 @@ padding: 10px; border: 10px solid transparent; shape-margin: 15px; - shape-outside: margin-box circle(35% at 85px 75px); + shape-outside: margin-box circle(60px); } #line { position: absolute; diff --git a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-015.html b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-015.html index 3502f8b960a..1a434a0ef6e 100644 --- a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-015.html +++ b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-015.html @@ -34,7 +34,7 @@ margin: 10px; padding: 10px; border: 10px solid transparent; - shape-outside: padding-box ellipse(closest-side at 75px 80px); + shape-outside: padding-box ellipse(closest-side closest-side at 75px 80px); } #line { position: absolute; diff --git a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-017.html b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-017.html index 3cf6089f11a..fd9b816d4a1 100644 --- a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-017.html +++ b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-017.html @@ -36,7 +36,7 @@ padding: 10px; border: 10px solid transparent; shape-margin: 10px; - shape-outside: content-box ellipse(farthest-side); + shape-outside: content-box ellipse(farthest-side closest-side); } #line { position: absolute; diff --git a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-010.html b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-010.html index 72147aaf5da..49627c8f1f0 100644 --- a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-010.html +++ b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-010.html @@ -19,8 +19,7 @@ #test-container { width: 200px; height: 200px; - font-family: Ahem; - font-size: 25px; + font: 25px/1 Ahem; background-color: red; color: green; } diff --git a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-011.html b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-011.html index 9a651844dc0..96d242148b0 100644 --- a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-011.html +++ b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-011.html @@ -21,6 +21,7 @@ height: 200px; font-family: Ahem; font-size: 25px; + line-height: 1; background-color: red; color: green; } diff --git a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-012.html b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-012.html index d7988c251f0..b9dbe52bbcc 100644 --- a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-012.html +++ b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-012.html @@ -22,6 +22,7 @@ height: 200px; font-family: Ahem; font-size: 25px; + line-height: 1; background-color: red; color: green; } diff --git a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-013.html b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-013.html index 03e4baaa987..d49dd703cc7 100644 --- a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-013.html +++ b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-013.html @@ -22,6 +22,7 @@ height: 200px; font-family: Ahem; font-size: 25px; + line-height: 1; background-color: red; color: green; } diff --git a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-014.html b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-014.html index bb791a5285a..30604af7613 100644 --- a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-014.html +++ b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-014.html @@ -22,6 +22,7 @@ height: 200px; font-family: Ahem; font-size: 25px; + line-height: 1; background-color: red; color: green; } diff --git a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-015.html b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-015.html index b2e0e06b030..da54fb23dad 100644 --- a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-015.html +++ b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-015.html @@ -22,6 +22,7 @@ height: 200px; font-family: Ahem; font-size: 25px; + line-height: 1; background-color: red; color: green; } diff --git a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-028.html b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-028.html new file mode 100644 index 00000000000..2e0d9abed54 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-028.html @@ -0,0 +1,56 @@ +<!DOCTYPE html> +<html> + <head> + <title>CSS Test: left float, inset, px units</title> + <link rel="author" title="Brad Werth" href="mailto:bwerth@mozilla.com"> + <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#funcdef-inset"> + <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property"> + <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-margin-property"> + <link rel="match" href="reference/shape-outside-inset-010-ref.html"/> + <meta name="flags" content="ahem" /> + <meta name="assert" content="The test verfies that text flows around a + right float with a shape-outside defined as + an inset rounded rectangle in px units with + a shape-margin."> + </head> + <style> + #container { + position: relative; + margin-left: 25px; + } + #test-container { + width: 200px; + height: 200px; + font: 25px/1 Ahem; + background-color: red; + color: green; + text-align: right; + } + #test-shape { + float: right; + width: 200px; + height: 200px; + background-color: green; + shape-margin: 10px; + shape-outside: inset(60px 10px 60px 110px round 20px); + } + #static-shape { + position: absolute; + left: 100px; + width: 100px; + height: 100px; + top: 50px; + background-color: green; + } + </style> + <body> + <p>The test passes if there is a green square and no red.</p> + <div id="container"> + <div id="test-container"> + <div id="test-shape"></div> + XXXXXXXX XXXXXXXX XXXX XXXX XXXX XXXX XXXXXXXX XXXXXXXX + </div> + <div id="static-shape"></div> + </div> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-029.html b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-029.html new file mode 100644 index 00000000000..fe30d4371f7 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-shapes/shape-outside/supported-shapes/inset/shape-outside-inset-029.html @@ -0,0 +1,56 @@ +<!DOCTYPE html> +<html> + <head> + <title>CSS Test: left float, inset, px units</title> + <link rel="author" title="Brad Werth" href="mailto:bwerth@mozilla.com"> + <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#funcdef-inset"> + <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property"> + <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-margin-property"> + <link rel="match" href="reference/shape-outside-inset-010-ref.html"/> + <meta name="flags" content="ahem" /> + <meta name="assert" content="The test verfies that text flows around a + right float with a shape-outside defined as + an inset irregular elliptically rounded + rectangle in px units with a shape-margin."> + </head> + <style> + #container { + position: relative; + margin-left: 25px; + } + #test-container { + width: 200px; + height: 200px; + font: 25px/1 Ahem; + background-color: red; + color: green; + text-align: right; + } + #test-shape { + float: right; + width: 200px; + height: 200px; + background-color: green; + shape-margin: 10px; + shape-outside: inset(60px 10px 60px 110px round 70px 0px 0px 10px / 10px 0px 0px 20px); + } + #static-shape { + position: absolute; + left: 100px; + width: 100px; + height: 100px; + top: 50px; + background-color: green; + } + </style> + <body> + <p>The test passes if there is a green square and no red.</p> + <div id="container"> + <div id="test-container"> + <div id="test-shape"></div> + XXXXXXXX XXXXXXXX XXXX XXXX XXXX XXXX XXXXXXXX XXXXXXXX + </div> + <div id="static-shape"></div> + </div> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/css/cssom/overflow-serialization.html b/tests/wpt/web-platform-tests/css/cssom/overflow-serialization.html index 7e2d1767a0b..136b8aba117 100644 --- a/tests/wpt/web-platform-tests/css/cssom/overflow-serialization.html +++ b/tests/wpt/web-platform-tests/css/cssom/overflow-serialization.html @@ -2,7 +2,7 @@ <html> <head> <meta charset="utf-8"> - <title>CSSOM - Overlow property has different serialization than other shorthands.</title> + <title>CSSOM - Overflow shorthand serialization</title> <link rel="help" href="https://drafts.csswg.org/cssom/#serialize-a-css-value"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -11,7 +11,7 @@ div { overflow: hidden; } div { overflow-x: initial; overflow-y: initial; } div { overflow-x: scroll; overflow-y: scroll; } - div { overflow-x: inherit; overflow-y: unset; } + div { overflow-x: scroll; overflow-y: hidden; } </style> <script> @@ -22,7 +22,7 @@ assert_equals(styleSheet.cssRules[1].style.cssText, "overflow: hidden;", "Single value overflow with non-CSS-wide keyword should serialize correctly."); assert_equals(styleSheet.cssRules[2].style.cssText, "overflow: initial;", "Overflow-x/y longhands with same CSS-wide keyword should serialize correctly."); assert_equals(styleSheet.cssRules[3].style.cssText, "overflow: scroll;", "Overflow-x/y longhands with same non-CSS-wide keyword should serialize correctly."); - assert_equals(styleSheet.cssRules[4].style.cssText, "overflow-x: inherit; overflow-y: unset;", "Overflow-x/y longhands with different keywords should serialize correctly."); + assert_equals(styleSheet.cssRules[4].style.cssText, "overflow: scroll hidden;", "Overflow-x/y longhands with different keywords should serialize correctly."); var div = document.createElement('div'); div.style.overflow = "inherit"; @@ -40,9 +40,9 @@ div.style.overflowY = "scroll"; assert_equals(div.style.overflow, "scroll", "Overflow-x/y longhands with same non-CSS-wide keyword should serialize correctly."); - div.style.overflowX = "inherit"; - div.style.overflowY = "unset"; - assert_equals(div.style.overflow, "", "Overflow-x/y longhands with different keywords shouldn't serialize."); + div.style.overflowX = "scroll"; + div.style.overflowY = "hidden"; + assert_equals(div.style.overflow, "scroll hidden", "Overflow-x/y longhands with different keywords should serialize correctly."); }); </script> </head> diff --git a/tests/wpt/web-platform-tests/css/cssom/shorthand-values.html b/tests/wpt/web-platform-tests/css/cssom/shorthand-values.html index eb756b53927..d8d7f5349a4 100644 --- a/tests/wpt/web-platform-tests/css/cssom/shorthand-values.html +++ b/tests/wpt/web-platform-tests/css/cssom/shorthand-values.html @@ -32,7 +32,7 @@ 'border: 1px; border-top-color: red;': 'border-width: 1px; border-top-color: red;', 'border: solid; border-style: dotted': 'border: dotted;', 'border-width: 1px;': 'border-width: 1px;', - 'overflow-x: scroll; overflow-y: hidden;': 'overflow-x: scroll; overflow-y: hidden;', + 'overflow-x: scroll; overflow-y: hidden;': 'overflow: scroll hidden;', 'overflow-x: scroll; overflow-y: scroll;': 'overflow: scroll;', 'outline-width: 2px; outline-style: dotted; outline-color: blue;': 'outline: blue dotted 2px;', 'margin-top: 1px; margin-right: 2px; margin-bottom: 3px; margin-left: 4px;': 'margin: 1px 2px 3px 4px;', diff --git a/tests/wpt/web-platform-tests/css/geometry/DOMQuad-001.html b/tests/wpt/web-platform-tests/css/geometry/DOMQuad-001.html index cfeaed7589f..4cafa02e98c 100644 --- a/tests/wpt/web-platform-tests/css/geometry/DOMQuad-001.html +++ b/tests/wpt/web-platform-tests/css/geometry/DOMQuad-001.html @@ -44,31 +44,31 @@ },'testConstructor4'); checkDOMQuad( - function() { return new DOMQuad(new DOMRect(10, 20, 100, 200)); }, + function() { return DOMQuad.fromRect(new DOMRect(10, 20, 100, 200)); }, { p1: { x: 10, y: 20, z: 0, w: 1 }, p2: { x: 110, y: 20, z: 0, w: 1 }, p3: { x: 110, y: 220, z: 0, w: 1 }, p4: { x: 10, y: 220, z: 0, w: 1 }, bounds: { x: 10, y: 20, width: 100, height: 200 } }, - 'testConstructor5'); + 'fromRect() method on DOMQuad'); checkDOMQuad( - function() { return new DOMQuad(new DOMRect(10, 20, -100, -200)) }, + function() { return DOMQuad.fromRect(new DOMRect(10, 20, -100, -200)) }, { p1: { x: 10, y: 20, z: 0, w: 1 }, p2: { x: -90, y: 20, z: 0, w: 1 }, p3: { x: -90, y: -180, z: 0, w: 1 }, p4: { x: 10, y: -180, z: 0, w: 1 }, bounds: { x: -90, y: -180, width: 100, height: 200 } }, - 'testConstructor6'); + 'fromRect() method on DOMQuad with negatives'); checkDOMQuad( - function() { return new DOMQuad(new DOMRect(-Infinity, -Infinity, Infinity, Infinity)) }, + function() { return DOMQuad.fromRect(new DOMRect(-Infinity, -Infinity, Infinity, Infinity)) }, { p1: { x: -Infinity, y: -Infinity, z: 0, w: 1 }, p2: { x: NaN, y: -Infinity, z: 0, w: 1 }, p3: { x: NaN, y: NaN, z: 0, w: 1 }, p4: { x: -Infinity, y: NaN, z: 0, w: 1 }, bounds: { x: -Infinity, y: -Infinity, width: NaN, height: NaN } }, - 'testConstructor7'); + 'fromRect() method on DOMQuad with Infinity'); checkDOMQuad(function() { return new DOMQuad(new DOMRect()); }, initial, 'testConstructor8'); @@ -120,15 +120,9 @@ p2: { x: 2, y: 0, z: 0, w: 1 }, p3: { x: 2, y: 0, z: 0, w: 1 }, p4: { x: 2, y: 0, z: 0, w: 1 }, - bounds: { x: 2, y: 0, width: 0, height: 0 } }, + bounds: { x: 0, y: 0, width: 0, height: 0 } }, 'p1Top4Attributes1'); - checkDOMQuad(function() { - var q = new DOMQuad({}, {}, {}, {}); - q.bounds = new DOMRect(10, 10, 100, 100); - return q; - }, initial, 'boundsAttribute0'); - function checkDOMQuad(createQuad, exp, name) { test(function() { var q = createQuad(); diff --git a/tests/wpt/web-platform-tests/css/geometry/DOMRectList.html b/tests/wpt/web-platform-tests/css/geometry/DOMRectList.html index f128a059cc5..f3d050cd5f2 100644 --- a/tests/wpt/web-platform-tests/css/geometry/DOMRectList.html +++ b/tests/wpt/web-platform-tests/css/geometry/DOMRectList.html @@ -10,12 +10,12 @@ setup(() => { }); test(() => { - assert_false('DOMRectList' in window); -}, 'DOMRectList [NoInterfaceObject]'); + assert_true('DOMRectList' in window); +}, 'DOMRectList is not [NoInterfaceObject]'); test(() => { - assert_true(domRectList instanceof Array); -}, 'DOMRectList [LegacyArrayClass]'); + assert_false(domRectList instanceof Array); +}, 'DOMRectList is not [LegacyArrayClass]'); test(() => { assert_equals(domRectList.length, 1); diff --git a/tests/wpt/web-platform-tests/dom/historical.html b/tests/wpt/web-platform-tests/dom/historical.html index 388366c084c..b45bebfb662 100644 --- a/tests/wpt/web-platform-tests/dom/historical.html +++ b/tests/wpt/web-platform-tests/dom/historical.html @@ -12,12 +12,14 @@ function isInterfaceNuked(name) { } var nukedInterfaces = [ "DOMConfiguration", + "DOMCursor", "DOMError", "DOMErrorHandler", "DOMImplementationList", "DOMImplementationSource", "DOMLocator", "DOMObject", + "DOMRequest", "DOMSettableTokenList", "DOMUserData", "Entity", diff --git a/tests/wpt/web-platform-tests/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-href-ascii.html b/tests/wpt/web-platform-tests/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-href-ascii.html deleted file mode 100644 index d5a747b12e0..00000000000 --- a/tests/wpt/web-platform-tests/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-href-ascii.html +++ /dev/null @@ -1,72 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta charset="iso-2022-jp"> <!-- test breaks if the server overrides this --> -<title>ISO 2022-JP encoding (href)</title> -<meta name="timeout" content="long"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="jis0208_index.js"></script> -<script src="iso2022jp-encoder.js"></script> -<link rel="author" title="Richard Ishida" href="mailto:ishida@w3.org"> -<link rel="help" href="https://encoding.spec.whatwg.org/#iso-2022-jp"> -<meta name="assert" content="The browser produces the expected byte sequences for all characters in the iso-2022-jp encoding after 0x9F when writing characters to an href value, using the encoder steps in the specification."> -<script> -function XnormalizeStr(str) { - str = encodeURIComponent(str); - var ptr = 0; - var out = ""; - for (c = 0; c < str.length; c++) { - if (str.charAt(ptr) == "%") { - out += String.fromCodePoint( - parseInt(str.charAt(ptr + 1) + str.charAt(ptr + 2), 16) - ); - ptr += 2; - } else out += str.charAt(ptr); - ptr++; - } -} - -function encode(input, expected, desc) { - // tests whether a Unicode character is converted to an equivalent byte sequence by href - // input: a Unicode character - // expected: expected byte sequence - // desc: what's being tested - test(function() { - var a = document.createElement("a"); // <a> uses document encoding for URL's query - a.href = "https://example.com/?" + input; - var result = a.search.substr(1); // remove leading "?" - assert_equals(normalizeStr(result), normalizeStr(expected)); - }, desc); -} - -// create a simple list of just those code points for which there is an encoding possible -codepoints = []; -for (var i = 0x00; i < 0xfe; i++) { - result = iso2022jpEncoder(String.fromCodePoint(i)); - if (result) { - var item = {}; - codepoints.push(item); - item.cp = i; - item.expected = "%" + result.replace(/ /g, "%"); - item.expected = item.expected.replace(/%1B%28%42$/, ""); - } -} - -// run the tests -encode(String.fromCodePoint(0x65), "e;", "%65"); -encode(String.fromCodePoint(0x1b), "d;", "%1B"); - -//for (var x=0;x<codepoints.length;x++) { -// encode(String.fromCodePoint(codepoints[x].cp), codepoints[x].expected, "U+"+codepoints[x].cp.toString(16).toUpperCase()+' '+String.fromCodePoint(codepoints[x].cp)+" "+codepoints[x].expected) -// } - -// NOTES -// this test relies on support for String.fromCodePoint, which appears to be supported by major desktop browsers -// the test excludes ASCII characters -</script> -</head> -<body> -<div id="log"></div> -</body> -</html> diff --git a/tests/wpt/web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-hangul.html b/tests/wpt/web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-hangul.html deleted file mode 100644 index 1a79c6fc9ae..00000000000 --- a/tests/wpt/web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-hangul.html +++ /dev/null @@ -1,181 +0,0 @@ -<!DOCTYPE html> -<html> <!-- DOESN'T WORK, NOT SURE WHY - THERE ARE 11 CHARACTERS PRODUCED, BUT ALL ARE UNASSIGNED CODE POINTS, SO SAFE TO IGNORE FOR NOW --> -<head> -<title>EUC-KR encoding errors (form, hangul)</title> -<meta charset="euc-kr"> <!-- test breaks if the server overrides this --> -<meta name="timeout" content="long"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="euckr_index.js"></script> -<link rel="author" title="Richard Ishida" href="mailto:ishida@w3.org"> -<link rel="help" href="https://encoding.spec.whatwg.org/#euc-kr"> -<meta name="assert" content="The browser produces percent-escaped character references when encoding bytes for a URL produced by a form when encoding hangul characters that are not in the euc-kr encoding."> -<style> - iframe { display:none } - form { display:none } -</style> -</head> -<body> -<div id="log"></div> -<script> -var tests = []; -var cplist = []; -var numTests = null; -var numFrames = 2; -var chunkSize = 400; -var numChunks = null; -var frames = null; -var frames = null; -var forms = null; -var seperator = ","; -var encodedSeperator = encodeURIComponent(","); -var currentChunkIndex = 0; - -function getByteSequence(cp) { - // uses the Encoding spec algorithm to derive a sequence of bytes for a character that can be encoded - // the result is either a percent-encoded value or null (if the character can't be encoded) - // cp: integer, a code point number - var cps = [cp]; - var out = ""; - - while (cps.length > 0) { - cp = cps.shift(); - if (cp >= 0x00 && cp <= 0x7f) { - // ASCII - out += "%" + cp.toString(16); - continue; - } - var ptr = indexcodepoints[cp]; - if (ptr == null) { - return null; - } - var lead = Math.floor(ptr / 190) + 0x81; - var trail = ptr % 190 + 0x41; - out += - "%" + - lead.toString(16).toUpperCase() + - "%" + - trail.toString(16).toUpperCase(); - } - return out; -} - -// set up a sparse array of all unicode codepoints listed in the index -// this will be used for lookup in getByteSequence -var indexcodepoints = []; // index is unicode cp, value is pointer -for (p = 0; p < euckr.length; p++) { - if (euckr[p] != null && indexcodepoints[euckr[p]] == null) { - indexcodepoints[euckr[p]] = p; - } -} - -setup(function() { - // set up a simple array of all unicode codepoints that are not encoded - var codepoints = []; - - for (i = 0xac00; i < 0xd7af; i++) { - result = getByteSequence(i); - if (!result) { - var item = {}; - codepoints.push(item); - item.cp = i; - item.expected = "%26%23" + item.cp + "%3B"; - item.desc = "hangul "; - } - } - - // convert the information into a simple array of objects that can be easily traversed - var currentChunk = []; - var currentTests = []; - cplist = [currentChunk]; - tests = [currentTests]; - for (i = 161; i < codepoints.length; i++) { - if (currentChunk.length == chunkSize) { - currentChunk = []; - cplist.push(currentChunk); - currentTests = []; - tests.push(currentTests); - } - var item = {}; - currentChunk.push(item); - item.cp = codepoints[i].cp; - item.expected = codepoints[i].expected; - item.desc = codepoints[i].desc; - currentTests.push( - async_test( - item.desc + - " U+" + - item.cp.toString(16).toUpperCase() + - " " + - String.fromCodePoint(item.cp) + - item.expected - ) - ); - } - - numChunks = cplist.length; - - for (var i = 0; i < numFrames; i++) { - var frame = document.createElement("iframe"); - frame.id = frame.name = "frame-" + i; - document.body.appendChild(frame); - var form = document.createElement("form"); - form.id = "form-" + i; - form.method = "GET"; - form.action = "/common/blank.html"; - form.acceptCharset = "euc-kr"; - form.target = frame.id; - var input = document.createElement("input"); - input.id = input.name = "input-" + i; - form.appendChild(input); - document.body.appendChild(form); - } - - addEventListener("load", function() { - frames = Array.prototype.slice.call( - document.getElementsByTagName("iframe") - ); - forms = Array.prototype.slice.call(document.getElementsByTagName("form")); - inputs = Array.prototype.slice.call(document.getElementsByTagName("input")); - for (var i = 0; i < Math.min(numFrames, numChunks); i++) { - runNext(i); - } - }); -}); - -function runNext(id) { - var i = currentChunkIndex; - currentChunkIndex += 1; - - var iframe = frames[id]; - var form = forms[id]; - var input = inputs[id]; - - input.value = cplist[i] - .map(function(x) { - return String.fromCodePoint(x.cp); - }) - .join(seperator); - form.submit(); - - iframe.onload = function() { - var url = iframe.contentWindow.location; - var query = url.search; - var result_string = query.substr(query.indexOf("=") + 1); - var results = result_string.split(encodedSeperator); - - for (var j = 0; j < cplist[i].length; j++) { - var t = tests[i][j]; - t.step(function() { - assert_equals(results[j], cplist[i][j].expected); // HERE'S THE TEST - }); - t.done(); - } - if (currentChunkIndex < numChunks) { - runNext(id); - } - }; -} -</script> -</body> -</html> diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/integrity-sharedworker.html b/tests/wpt/web-platform-tests/fetch/api/basic/integrity-sharedworker.html deleted file mode 100644 index fa90a60ce98..00000000000 --- a/tests/wpt/web-platform-tests/fetch/api/basic/integrity-sharedworker.html +++ /dev/null @@ -1,15 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>Fetch in sharedworker: integrity handling</title> - <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch"> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - </head> - <body> - <script> - fetch_tests_from_worker(new SharedWorker("integrity.js?pipe=sub")); - </script> - </body> -</html> diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/integrity-worker.html b/tests/wpt/web-platform-tests/fetch/api/basic/integrity-worker.html deleted file mode 100644 index 9240bc6325a..00000000000 --- a/tests/wpt/web-platform-tests/fetch/api/basic/integrity-worker.html +++ /dev/null @@ -1,16 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>Fetch in worker: integrity handling</title> - <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr"> - <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch"> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - </head> - <body> - <script> - fetch_tests_from_worker(new Worker("integrity.js?pipe=sub")); - </script> - </body> -</html>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/integrity.html b/tests/wpt/web-platform-tests/fetch/api/basic/integrity.html deleted file mode 100644 index 150c9b71d54..00000000000 --- a/tests/wpt/web-platform-tests/fetch/api/basic/integrity.html +++ /dev/null @@ -1,15 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>Fetch: integrity handling</title> - <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr"> - <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch"> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - </head> - <body> - <script src="../resources/utils.js"></script> - <script src="integrity.js?pipe=sub"></script> - </body> -</html>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/integrity.js b/tests/wpt/web-platform-tests/fetch/api/basic/integrity.sub.any.js index fb3f252ea68..d487c3738ac 100644 --- a/tests/wpt/web-platform-tests/fetch/api/basic/integrity.js +++ b/tests/wpt/web-platform-tests/fetch/api/basic/integrity.sub.any.js @@ -1,7 +1,5 @@ -if (this.document === undefined) { - importScripts("/resources/testharness.js"); - importScripts("../resources/utils.js"); -} +// META: global=sharedworker +// META: script=../resources/utils.js function integrity(desc, url, integrity, initRequestMode, shouldPass) { var fetchRequestInit = {'integrity': integrity} diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/mode-no-cors-worker.html b/tests/wpt/web-platform-tests/fetch/api/basic/mode-no-cors-worker.html deleted file mode 100644 index 87376a130f8..00000000000 --- a/tests/wpt/web-platform-tests/fetch/api/basic/mode-no-cors-worker.html +++ /dev/null @@ -1,17 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>Fetch in worker: no-cors mode and opaque filtering</title> - <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch"> - <meta name="help" href="https://fetch.spec.whatwg.org/#concept-filtered-response-opaque"> - <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr"> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - </head> - <body> - <script> - fetch_tests_from_worker(new Worker("mode-no-cors.js?pipe=sub")); - </script> - </body> -</html>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/mode-no-cors.html b/tests/wpt/web-platform-tests/fetch/api/basic/mode-no-cors.html deleted file mode 100644 index 7aee3790933..00000000000 --- a/tests/wpt/web-platform-tests/fetch/api/basic/mode-no-cors.html +++ /dev/null @@ -1,16 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>Fetch: no-cors mode and opaque filtering</title> - <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch"> - <meta name="help" href="https://fetch.spec.whatwg.org/#concept-filtered-response-opaque"> - <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr"> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - </head> - <body> - <script src="../resources/utils.js"></script> - <script src="mode-no-cors.js?pipe=sub"></script> - </body> -</html>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/mode-no-cors.js b/tests/wpt/web-platform-tests/fetch/api/basic/mode-no-cors.sub.any.js index 53e849051ef..709eef5bf1d 100644 --- a/tests/wpt/web-platform-tests/fetch/api/basic/mode-no-cors.js +++ b/tests/wpt/web-platform-tests/fetch/api/basic/mode-no-cors.sub.any.js @@ -1,7 +1,4 @@ -if (this.document === undefined) { - importScripts("/resources/testharness.js"); - importScripts("../resources/utils.js"); -} +// META: script=../resources/utils.js function fetchNoCors(url, isOpaqueFiltered) { var urlQuery = "?pipe=header(x-is-filtered,value)" diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/response-url-worker.html b/tests/wpt/web-platform-tests/fetch/api/basic/response-url-worker.html deleted file mode 100644 index 03374e0f635..00000000000 --- a/tests/wpt/web-platform-tests/fetch/api/basic/response-url-worker.html +++ /dev/null @@ -1,15 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>Fetch in worker: response url getter</title> - <meta name="help" href="https://fetch.spec.whatwg.org/#response-class"> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - </head> - <body> - <script> - fetch_tests_from_worker(new Worker("response-url.js?pipe=sub")); - </script> - </body> -</html> diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/response-url.html b/tests/wpt/web-platform-tests/fetch/api/basic/response-url.html deleted file mode 100644 index dfe9d96c7a4..00000000000 --- a/tests/wpt/web-platform-tests/fetch/api/basic/response-url.html +++ /dev/null @@ -1,13 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>Fetch: response url getter</title> - <meta name="help" href="https://fetch.spec.whatwg.org/#response-class"> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - </head> - <body> - <script src="response-url.js?pipe=sub"></script> - </body> -</html> diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/response-url.js b/tests/wpt/web-platform-tests/fetch/api/basic/response-url.sub.any.js index 91b553aaef0..0d123c42944 100644 --- a/tests/wpt/web-platform-tests/fetch/api/basic/response-url.js +++ b/tests/wpt/web-platform-tests/fetch/api/basic/response-url.sub.any.js @@ -1,7 +1,3 @@ -if (this.document === undefined) { - importScripts("/resources/testharness.js"); -} - function checkResponseURL(fetchedURL, expectedURL) { promise_test(function() { @@ -18,4 +14,3 @@ checkResponseURL(baseURL + "/#ada", baseURL + "/"); checkResponseURL(baseURL + "#ada", baseURL + "/"); done(); - diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob-worker.html b/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob-worker.html deleted file mode 100644 index 961ecbd525b..00000000000 --- a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob-worker.html +++ /dev/null @@ -1,17 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>Fetch in worker: blob scheme</title> - <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch"> - <meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch"> - <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr"> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - </head> - <body> - <script> - fetch_tests_from_worker(new Worker("scheme-blob.js?pipe=sub")); - </script> - </body> -</html>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.html b/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.html deleted file mode 100644 index 7787c3710f6..00000000000 --- a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.html +++ /dev/null @@ -1,16 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>Fetch: blob scheme</title> - <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch"> - <meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch"> - <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr"> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - </head> - <body> - <script src="../resources/utils.js"></script> - <script src="scheme-blob.js?pipe=sub"></script> - </body> -</html>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.js b/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.sub.any.js index 9bf73a69365..fb1357eaf29 100644 --- a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.js +++ b/tests/wpt/web-platform-tests/fetch/api/basic/scheme-blob.sub.any.js @@ -1,7 +1,4 @@ -if (this.document === undefined) { - importScripts("/resources/testharness.js"); - importScripts("../resources/utils.js"); -} +// META: script=../resources/utils.js function checkFetchResponse(url, data, mime, size, desc) { promise_test(function(test) { diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-others-worker.html b/tests/wpt/web-platform-tests/fetch/api/basic/scheme-others-worker.html deleted file mode 100644 index 397d9257b1b..00000000000 --- a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-others-worker.html +++ /dev/null @@ -1,17 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>Fetch in worker: urls with unsupported schemes</title> - <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch"> - <meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch"> - <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr"> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - </head> - <body> - <script> - fetch_tests_from_worker(new Worker("scheme-others.js?pipe=sub")); - </script> - </body> -</html>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-others.html b/tests/wpt/web-platform-tests/fetch/api/basic/scheme-others.html deleted file mode 100644 index dd37143b0f1..00000000000 --- a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-others.html +++ /dev/null @@ -1,16 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>Fetch: urls with unsupported schemes</title> - <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch"> - <meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch"> - <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr"> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - </head> - <body> - <script src="../resources/utils.js"></script> - <script src="scheme-others.js?pipe=sub"></script> - </body> -</html>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-others.js b/tests/wpt/web-platform-tests/fetch/api/basic/scheme-others.sub.any.js index ce02ec1340a..5f9848ff4c2 100644 --- a/tests/wpt/web-platform-tests/fetch/api/basic/scheme-others.js +++ b/tests/wpt/web-platform-tests/fetch/api/basic/scheme-others.sub.any.js @@ -1,7 +1,4 @@ -if (this.document === undefined) { - importScripts("/resources/testharness.js"); - importScripts("../resources/utils.js"); -} +// META: script=../resources/utils.js function checkKoUrl(url, desc) { if (!desc) diff --git a/tests/wpt/web-platform-tests/fetch/corb/README.md b/tests/wpt/web-platform-tests/fetch/corb/README.md index f16943ebf72..04c5b8a8f3d 100644 --- a/tests/wpt/web-platform-tests/fetch/corb/README.md +++ b/tests/wpt/web-platform-tests/fetch/corb/README.md @@ -26,18 +26,8 @@ Tests that cover behavior that is changed by CORB have to be marked as is included in the official [Fetch spec](https://fetch.spec.whatwg.org/). Such tests may fail unless CORB is enabled. In practice this means that: -* Such tests will fail in default Chromium and have to be listed - in `third_party/WebKit/LayoutTests/TestExpectations` and associated - with https://crbug.com/802835. -* Such tests will pass in Chromium when either - 1) CORB is explicitly, manually enabled by passing extra cmdline flags to - `run-webkit-tests`: - `--additional-driver-flag=--enable-features=CrossSiteDocumentBlockingAlways` and - `--additional-expectations=third_party/WebKit/LayoutTests/FlagExpectations/site-per-process`. - 2) CORB is implicitly enabled via Site Isolation (e.g. in - `site_per_process_webkit_layout_tests` step on the test bots). The - expectations that the tests pass in this mode is controlled by the - `third_party/WebKit/LayoutTests/FlagExpectations/site-per-process` file. +* Such tests will pass in Chromium + (where CORB is enabled by default [since M68](https://crrev.com/553830)). * Such tests may fail in other browsers. diff --git a/tests/wpt/web-platform-tests/fetch/corb/img-mime-types-coverage.tentative.sub.html b/tests/wpt/web-platform-tests/fetch/corb/img-mime-types-coverage.tentative.sub.html index 4ed8f018e92..7ccc41b4b5f 100644 --- a/tests/wpt/web-platform-tests/fetch/corb/img-mime-types-coverage.tentative.sub.html +++ b/tests/wpt/web-platform-tests/fetch/corb/img-mime-types-coverage.tentative.sub.html @@ -28,7 +28,7 @@ // - https://tools.ietf.org/html/rfc7303 "text/x-json", "text/json+blah", "application/json+blah", "text/xml+blah", "application/xml+blah", - "application/blahjson", "text/blahxml", + "application/blahjson", "text/blahxml"] var fails = [ // CORB-protected MIME-types - i.e. ones covered by: diff --git a/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-darkblue-bg.svg b/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-darkblue-bg.svg new file mode 100644 index 00000000000..49f374c00cd --- /dev/null +++ b/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-darkblue-bg.svg @@ -0,0 +1,9 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 762 762"> +<rect x="0" y="0" fill="#003C56" width="762" height="762"/> +<rect x="183.9" y="511.4" fill="#FFFFFF" width="201.5" height="38"/> +<path fill="#FFFFFF" d="M504.9,549.4c37.3,0,67.6-30.3,67.6-67.6v-19h-38v19c0,16.3-13.3,29.6-29.6,29.6c-16.3,0-29.6-13.3-29.6-29.6 +V287.4h-38v56.5h-51.9v-92.6h112.4c25.5,0,46.3,20.8,46.3,46.3c0,20-13,37.8-31.8,44v39.1c40-6.9,69.8-42.1,69.8-83 +c0-46.5-37.8-84.3-84.3-84.3H366.4c-10.5,0-19,8.5-19,19V386l-46.4-79.4c-3.4-5.8-9.7-9.4-16.4-9.4c-6.7,0-13,3.6-16.4,9.4 +l-46.2,79.2V213.4h-38v242.7c0,8.6,5.8,16.1,14,18.3c8.3,2.2,17.1-1.4,21.4-8.8l65.2-111.8L350,465.7c3.4,5.8,9.7,9.4,16.4,9.4 +c1.7,0,3.3-0.2,5-0.7c8.3-2.2,14-9.8,14-18.3v-74.2h51.9v99.8C437.3,519.1,467.6,549.4,504.9,549.4z"/> +</svg> diff --git a/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-darkblue.svg b/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-darkblue.svg new file mode 100644 index 00000000000..2db07da7894 --- /dev/null +++ b/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-darkblue.svg @@ -0,0 +1,8 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 398 340"> +<rect x="0" y="300" fill="#003C56" width="201.5" height="38"/> +<path fill="#003C56" d="M320.9,338c37.3,0,67.6-30.3,67.6-67.6v-19h-38v19c0,16.3-13.3,29.6-29.6,29.6c-16.3,0-29.6-13.3-29.6-29.6V76 +h-38v56.5h-51.9V40h112.4c25.5,0,46.3,20.8,46.3,46.3c0,20-13,37.8-31.8,44v39.1c40-6.9,69.8-42.1,69.8-83 +C398,39.8,360.2,2,313.8,2H182.4c-10.5,0-19,8.5-19,19v153.6l-46.4-79.4c-3.4-5.8-9.7-9.4-16.4-9.4c-6.7,0-13,3.6-16.4,9.4 +l-46.2,79.2V2h-38v242.7c0,8.6,5.8,16.1,14,18.3c8.3,2.2,17.1-1.4,21.4-8.8l65.2-111.8L166,254.3c3.4,5.8,9.7,9.4,16.4,9.4 +c1.7,0,3.3-0.2,5-0.7c8.3-2.2,14-9.8,14-18.3v-74.2h51.9v99.8C253.3,307.7,283.6,338,320.9,338z"/> +</svg> diff --git a/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-lightblue-bg.svg b/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-lightblue-bg.svg new file mode 100644 index 00000000000..2f61672df33 --- /dev/null +++ b/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-lightblue-bg.svg @@ -0,0 +1,9 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 762 762"> +<rect x="0" y="0" fill="#78D9F4" width="762" height="762"/> +<rect x="183.9" y="511.4" fill="#003C56" width="201.5" height="38"/> +<path fill="#003C56" d="M504.9,549.4c37.3,0,67.6-30.3,67.6-67.6v-19h-38v19c0,16.3-13.3,29.6-29.6,29.6c-16.3,0-29.6-13.3-29.6-29.6 +V287.4h-38v56.5h-51.9v-92.6h112.4c25.5,0,46.3,20.8,46.3,46.3c0,20-13,37.8-31.8,44v39.1c40-6.9,69.8-42.1,69.8-83 +c0-46.5-37.8-84.3-84.3-84.3H366.4c-10.5,0-19,8.5-19,19V386l-46.4-79.4c-3.4-5.8-9.7-9.4-16.4-9.4c-6.7,0-13,3.6-16.4,9.4 +l-46.2,79.2V213.4h-38v242.7c0,8.6,5.8,16.1,14,18.3c8.3,2.2,17.1-1.4,21.4-8.8l65.2-111.8L350,465.7c3.4,5.8,9.7,9.4,16.4,9.4 +c1.7,0,3.3-0.2,5-0.7c8.3-2.2,14-9.8,14-18.3v-74.2h51.9v99.8C437.3,519.1,467.6,549.4,504.9,549.4z"/> +</svg> diff --git a/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-orange-bg.svg b/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-orange-bg.svg new file mode 100644 index 00000000000..fde2c15f1b2 --- /dev/null +++ b/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-orange-bg.svg @@ -0,0 +1,9 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 762 762"> +<rect x="0" y="0" fill="#E86E43" width="762" height="762"/> +<rect x="183.9" y="511.4" fill="#FFFFFF" width="201.5" height="38"/> +<path fill="#FFFFFF" d="M504.9,549.4c37.3,0,67.6-30.3,67.6-67.6v-19h-38v19c0,16.3-13.3,29.6-29.6,29.6c-16.3,0-29.6-13.3-29.6-29.6 +V287.4h-38v56.5h-51.9v-92.6h112.4c25.5,0,46.3,20.8,46.3,46.3c0,20-13,37.8-31.8,44v39.1c40-6.9,69.8-42.1,69.8-83 +c0-46.5-37.8-84.3-84.3-84.3H366.4c-10.5,0-19,8.5-19,19V386l-46.4-79.4c-3.4-5.8-9.7-9.4-16.4-9.4c-6.7,0-13,3.6-16.4,9.4 +l-46.2,79.2V213.4h-38v242.7c0,8.6,5.8,16.1,14,18.3c8.3,2.2,17.1-1.4,21.4-8.8l65.2-111.8L350,465.7c3.4,5.8,9.7,9.4,16.4,9.4 +c1.7,0,3.3-0.2,5-0.7c8.3-2.2,14-9.8,14-18.3v-74.2h51.9v99.8C437.3,519.1,467.6,549.4,504.9,549.4z"/> +</svg> diff --git a/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-white.svg b/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-white.svg new file mode 100644 index 00000000000..4cab7b53e87 --- /dev/null +++ b/tests/wpt/web-platform-tests/images/wpt-logo/wpt-logo-white.svg @@ -0,0 +1,8 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 398 340"> +<rect x="0" y="300" fill="#FFFFFF" width="201.5" height="38"/> +<path fill="#FFFFFF" d="M320.9,338c37.3,0,67.6-30.3,67.6-67.6v-19h-38v19c0,16.3-13.3,29.6-29.6,29.6c-16.3,0-29.6-13.3-29.6-29.6V76 +h-38v56.5h-51.9V40h112.4c25.5,0,46.3,20.8,46.3,46.3c0,20-13,37.8-31.8,44v39.1c40-6.9,69.8-42.1,69.8-83 +C398,39.8,360.2,2,313.8,2H182.4c-10.5,0-19,8.5-19,19v153.6l-46.4-79.4c-3.4-5.8-9.7-9.4-16.4-9.4c-6.7,0-13,3.6-16.4,9.4 +l-46.2,79.2V2h-38v242.7c0,8.6,5.8,16.1,14,18.3c8.3,2.2,17.1-1.4,21.4-8.8l65.2-111.8L166,254.3c3.4,5.8,9.7,9.4,16.4,9.4 +c1.7,0,3.3-0.2,5-0.7c8.3-2.2,14-9.8,14-18.3v-74.2h51.9v99.8C253.3,307.7,283.6,338,320.9,338z"/> +</svg> diff --git a/tests/wpt/web-platform-tests/referrer-policy/generic/common.js b/tests/wpt/web-platform-tests/referrer-policy/generic/common.js index 345940113de..1ccdaabf077 100644 --- a/tests/wpt/web-platform-tests/referrer-policy/generic/common.js +++ b/tests/wpt/web-platform-tests/referrer-policy/generic/common.js @@ -248,7 +248,3 @@ function queryScript(url, callback) { function SanityChecker() {} SanityChecker.prototype.checkScenario = function() {}; SanityChecker.prototype.checkSubresourceResult = function() {}; - -// TODO(kristijanburnik): document.origin is supported since Chrome 41, -// other browsers still don't support it. Remove once they do. -document.origin = document.origin || (location.protocol + "//" + location.host); diff --git a/tests/wpt/web-platform-tests/referrer-policy/generic/referrer-policy-test-case.js b/tests/wpt/web-platform-tests/referrer-policy/generic/referrer-policy-test-case.js index b90ecfd93cc..7c8cba41f4c 100644 --- a/tests/wpt/web-platform-tests/referrer-policy/generic/referrer-policy-test-case.js +++ b/tests/wpt/web-platform-tests/referrer-policy/generic/referrer-policy-test-case.js @@ -29,7 +29,7 @@ function ReferrerPolicyTestCase(scenario, testDescription, sanityChecker) { return undefined; }, "origin": function() { - return document.origin + "/"; + return self.origin + "/"; }, "stripped-referrer": function() { return stripUrlForUseAsReferrer(location.toString()); diff --git a/tests/wpt/web-platform-tests/resources/idlharness.js b/tests/wpt/web-platform-tests/resources/idlharness.js index c5c0c9848d4..fe7239544cf 100644 --- a/tests/wpt/web-platform-tests/resources/idlharness.js +++ b/tests/wpt/web-platform-tests/resources/idlharness.js @@ -2166,7 +2166,7 @@ IdlInterface.prototype.test_member_iterable = function(member) //@{ { var interfaceName = this.name; - var isPairIterator = member.idlType instanceof Array; + var isPairIterator = member.idlType.length === 2; test(function() { var descriptor = Object.getOwnPropertyDescriptor(self[interfaceName].prototype, Symbol.iterator); diff --git a/tests/wpt/web-platform-tests/resources/test/tests/idlharness/IdlInterface/test_to_json_operation.html b/tests/wpt/web-platform-tests/resources/test/tests/idlharness/IdlInterface/test_to_json_operation.html index d9c3fcf611c..856b4b03553 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/idlharness/IdlInterface/test_to_json_operation.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/idlharness/IdlInterface/test_to_json_operation.html @@ -176,7 +176,7 @@ "status_string": "FAIL" }, { - "message": "assert_true: {\"sequence\":false,\"generic\":null,\"nullable\":false,\"union\":false,\"idlType\":\"DOMException\"} is not an appropriate return value for the toJSON operation of N expected true got false", + "message": "assert_true: {\"type\":\"return-type\",\"sequence\":false,\"generic\":null,\"nullable\":false,\"union\":false,\"idlType\":\"DOMException\"} is not an appropriate return value for the toJSON operation of N expected true got false", "name": "Test toJSON operation of N", "properties": {}, "stack": "(implementation-defined)", diff --git a/tests/wpt/web-platform-tests/resources/testharness.js b/tests/wpt/web-platform-tests/resources/testharness.js index ec0090ce936..39a467c37a7 100644 --- a/tests/wpt/web-platform-tests/resources/testharness.js +++ b/tests/wpt/web-platform-tests/resources/testharness.js @@ -13,7 +13,7 @@ policies and contribution forms [3]. /* Documentation: http://web-platform-tests.org/writing-tests/testharness-api.html * (../docs/_writing-tests/testharness-api.md) */ -(function () +(function (global_scope) { var debug = false; // default timeout is 10 seconds, test can override if needed @@ -48,9 +48,6 @@ policies and contribution forms [3]. * * // Should return the test harness timeout duration in milliseconds. * float test_timeout(); - * - * // Should return the global scope object. - * object global_scope(); * }; */ @@ -248,10 +245,6 @@ policies and contribution forms [3]. return settings.harness_timeout.normal; }; - WindowTestEnvironment.prototype.global_scope = function() { - return window; - }; - /* * Base TestEnvironment implementation for a generic web worker. * @@ -344,10 +337,6 @@ policies and contribution forms [3]. return null; }; - WorkerTestEnvironment.prototype.global_scope = function() { - return self; - }; - /* * Dedicated web workers. * https://html.spec.whatwg.org/multipage/workers.html#dedicatedworkerglobalscope @@ -463,23 +452,23 @@ policies and contribution forms [3]. }; function create_test_environment() { - if ('document' in self) { + if ('document' in global_scope) { return new WindowTestEnvironment(); } - if ('DedicatedWorkerGlobalScope' in self && - self instanceof DedicatedWorkerGlobalScope) { + if ('DedicatedWorkerGlobalScope' in global_scope && + global_scope instanceof DedicatedWorkerGlobalScope) { return new DedicatedWorkerTestEnvironment(); } - if ('SharedWorkerGlobalScope' in self && - self instanceof SharedWorkerGlobalScope) { + if ('SharedWorkerGlobalScope' in global_scope && + global_scope instanceof SharedWorkerGlobalScope) { return new SharedWorkerTestEnvironment(); } - if ('ServiceWorkerGlobalScope' in self && - self instanceof ServiceWorkerGlobalScope) { + if ('ServiceWorkerGlobalScope' in global_scope && + global_scope instanceof ServiceWorkerGlobalScope) { return new ServiceWorkerTestEnvironment(); } - if ('WorkerGlobalScope' in self && - self instanceof WorkerGlobalScope) { + if ('WorkerGlobalScope' in global_scope && + global_scope instanceof WorkerGlobalScope) { return new DedicatedWorkerTestEnvironment(); } @@ -489,13 +478,13 @@ policies and contribution forms [3]. var test_environment = create_test_environment(); function is_shared_worker(worker) { - return 'SharedWorker' in self && worker instanceof SharedWorker; + return 'SharedWorker' in global_scope && worker instanceof SharedWorker; } function is_service_worker(worker) { // The worker object may be from another execution context, // so do not use instanceof here. - return 'ServiceWorker' in self && + return 'ServiceWorker' in global_scope && Object.prototype.toString.call(worker) == '[object ServiceWorker]'; } @@ -2824,7 +2813,7 @@ policies and contribution forms [3]. function expose(object, name) { var components = name.split("."); - var target = test_environment.global_scope(); + var target = global_scope; for (var i = 0; i < components.length - 1; i++) { if (!(components[i] in target)) { target[components[i]] = {}; @@ -2846,7 +2835,7 @@ policies and contribution forms [3]. /** Returns the 'src' URL of the first <script> tag in the page to include the file 'testharness.js'. */ function get_script_url() { - if (!('document' in self)) { + if (!('document' in global_scope)) { return undefined; } @@ -2954,5 +2943,5 @@ policies and contribution forms [3]. test_environment.on_tests_ready(); -})(); +})(this); // vim: set expandtab shiftwidth=4 tabstop=4: diff --git a/tests/wpt/web-platform-tests/resources/webidl2/.travis.yml b/tests/wpt/web-platform-tests/resources/webidl2/.travis.yml index fc1508961db..6dc8e2bdbaa 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/.travis.yml +++ b/tests/wpt/web-platform-tests/resources/webidl2/.travis.yml @@ -2,3 +2,4 @@ language: node_js node_js: - node - lts/* + - 6 diff --git a/tests/wpt/web-platform-tests/resources/webidl2/CHANGELOG.md b/tests/wpt/web-platform-tests/resources/webidl2/CHANGELOG.md index e6fa641e560..1596d71684a 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/CHANGELOG.md +++ b/tests/wpt/web-platform-tests/resources/webidl2/CHANGELOG.md @@ -1,5 +1,73 @@ # Change Log +## [v10.2.0](https://github.com/w3c/webidl2.js/tree/v10.2.0) (2018-01-30) +[Full Changelog](https://github.com/w3c/webidl2.js/compare/v10.1.0...v10.2.0) + +**Merged pull requests:** + +- Type on union idlType [\#135](https://github.com/w3c/webidl2.js/pull/135) ([saschanaz](https://github.com/saschanaz)) +- feat: add argument/return type [\#134](https://github.com/w3c/webidl2.js/pull/134) ([saschanaz](https://github.com/saschanaz)) +- feat: add dictionary/typedef-type [\#133](https://github.com/w3c/webidl2.js/pull/133) ([saschanaz](https://github.com/saschanaz)) +- feat: add const-type for idlTypes [\#132](https://github.com/w3c/webidl2.js/pull/132) ([saschanaz](https://github.com/saschanaz)) +- feat: add types on idlTypes [\#131](https://github.com/w3c/webidl2.js/pull/131) ([saschanaz](https://github.com/saschanaz)) +- Auto acquisition for parser result changes [\#130](https://github.com/w3c/webidl2.js/pull/130) ([saschanaz](https://github.com/saschanaz)) + +## [v10.1.0](https://github.com/w3c/webidl2.js/tree/v10.1.0) (2018-01-19) +[Full Changelog](https://github.com/w3c/webidl2.js/compare/v10.0.0...v10.1.0) + +**Closed issues:** + +- Support `raises` and `setraises` [\#128](https://github.com/w3c/webidl2.js/issues/128) +- Support `legacycaller` [\#127](https://github.com/w3c/webidl2.js/issues/127) +- Improve "No semicolon after enum" message [\#119](https://github.com/w3c/webidl2.js/issues/119) + +**Merged pull requests:** + +- Let error messages include the current definition name [\#129](https://github.com/w3c/webidl2.js/pull/129) ([saschanaz](https://github.com/saschanaz)) + +## [v10.0.0](https://github.com/w3c/webidl2.js/tree/v10.0.0) (2017-12-20) +[Full Changelog](https://github.com/w3c/webidl2.js/compare/v9.0.0...v10.0.0) + +**Closed issues:** + +- Always return an array for idlType, etc. [\#113](https://github.com/w3c/webidl2.js/issues/113) +- Maintain writer.js or not? [\#109](https://github.com/w3c/webidl2.js/issues/109) + +**Merged pull requests:** + +- Remove typeExtAttrs from docs [\#124](https://github.com/w3c/webidl2.js/pull/124) ([saschanaz](https://github.com/saschanaz)) +- Remove iterator documentation [\#123](https://github.com/w3c/webidl2.js/pull/123) ([saschanaz](https://github.com/saschanaz)) +- Maintain writer.js [\#122](https://github.com/w3c/webidl2.js/pull/122) ([saschanaz](https://github.com/saschanaz)) +- BREAKING CHANGE: remove deprecated iterator operation [\#121](https://github.com/w3c/webidl2.js/pull/121) ([saschanaz](https://github.com/saschanaz)) +- Use for-of on tests [\#120](https://github.com/w3c/webidl2.js/pull/120) ([saschanaz](https://github.com/saschanaz)) +- docs\(README\): iterables ildType is always array [\#118](https://github.com/w3c/webidl2.js/pull/118) ([marcoscaceres](https://github.com/marcoscaceres)) + +## [v9.0.0](https://github.com/w3c/webidl2.js/tree/v9.0.0) (2017-11-30) +[Full Changelog](https://github.com/w3c/webidl2.js/compare/v8.1.0...v9.0.0) + +**Closed issues:** + +- Code quality [\#116](https://github.com/w3c/webidl2.js/issues/116) +- Unable to parse HTMLAllCollection interface [\#114](https://github.com/w3c/webidl2.js/issues/114) +- Add support for mixin syntax [\#112](https://github.com/w3c/webidl2.js/issues/112) +- Whitespace issues [\#111](https://github.com/w3c/webidl2.js/issues/111) + +**Merged pull requests:** + +- Consistent array type for iterable.idlType [\#117](https://github.com/w3c/webidl2.js/pull/117) ([saschanaz](https://github.com/saschanaz)) +- Revert "chore: drop Node 6 support \(\#102\)" [\#115](https://github.com/w3c/webidl2.js/pull/115) ([TimothyGu](https://github.com/TimothyGu)) + +## [v8.1.0](https://github.com/w3c/webidl2.js/tree/v8.1.0) (2017-11-03) +[Full Changelog](https://github.com/w3c/webidl2.js/compare/v8.0.1...v8.1.0) + +**Closed issues:** + +- Extended Attributes `rhs` should always be there [\#96](https://github.com/w3c/webidl2.js/issues/96) + +**Merged pull requests:** + +- Always add rhs property [\#110](https://github.com/w3c/webidl2.js/pull/110) ([saschanaz](https://github.com/saschanaz)) + ## [v8.0.1](https://github.com/w3c/webidl2.js/tree/v8.0.1) (2017-11-03) [Full Changelog](https://github.com/w3c/webidl2.js/compare/v8.0.0...v8.0.1) @@ -9,7 +77,7 @@ **Merged pull requests:** -- Remove m postfix from all\_ws\(\) [\#108](https://github.com/w3c/webidl2.js/pull/108) ([SaschaNaz](https://github.com/SaschaNaz)) +- Remove m postfix from all\_ws\(\) [\#108](https://github.com/w3c/webidl2.js/pull/108) ([saschanaz](https://github.com/saschanaz)) ## [v8.0.0](https://github.com/w3c/webidl2.js/tree/v8.0.0) (2017-11-03) [Full Changelog](https://github.com/w3c/webidl2.js/compare/v7.0.0...v8.0.0) @@ -21,9 +89,9 @@ **Merged pull requests:** -- Support mixins + includes statements [\#105](https://github.com/w3c/webidl2.js/pull/105) ([SaschaNaz](https://github.com/SaschaNaz)) +- Support mixins + includes statements [\#105](https://github.com/w3c/webidl2.js/pull/105) ([saschanaz](https://github.com/saschanaz)) - chore: drop Node 6 support [\#102](https://github.com/w3c/webidl2.js/pull/102) ([marcoscaceres](https://github.com/marcoscaceres)) -- BREAKING CHANGE: drop creator support [\#101](https://github.com/w3c/webidl2.js/pull/101) ([SaschaNaz](https://github.com/SaschaNaz)) +- BREAKING CHANGE: drop creator support [\#101](https://github.com/w3c/webidl2.js/pull/101) ([saschanaz](https://github.com/saschanaz)) - Normalize some whitespace to pass wpt's lint [\#99](https://github.com/w3c/webidl2.js/pull/99) ([foolip](https://github.com/foolip)) ## [v7.0.0](https://github.com/w3c/webidl2.js/tree/v7.0.0) (2017-10-27) @@ -54,7 +122,7 @@ **Merged pull requests:** -- Use ES2015 syntax for tests [\#88](https://github.com/w3c/webidl2.js/pull/88) ([SaschaNaz](https://github.com/SaschaNaz)) +- Use ES2015 syntax for tests [\#88](https://github.com/w3c/webidl2.js/pull/88) ([saschanaz](https://github.com/saschanaz)) ## [v6.0.0](https://github.com/w3c/webidl2.js/tree/v6.0.0) (2017-10-17) [Full Changelog](https://github.com/w3c/webidl2.js/compare/v5.0.0...v6.0.0) @@ -73,7 +141,7 @@ **Merged pull requests:** -- BREAKING CHANGE: Use ES2015 syntax [\#84](https://github.com/w3c/webidl2.js/pull/84) ([SaschaNaz](https://github.com/SaschaNaz)) +- BREAKING CHANGE: Use ES2015 syntax [\#84](https://github.com/w3c/webidl2.js/pull/84) ([saschanaz](https://github.com/saschanaz)) ## [v4.2.0](https://github.com/w3c/webidl2.js/tree/v4.2.0) (2017-10-16) [Full Changelog](https://github.com/w3c/webidl2.js/compare/v4.1.0...v4.2.0) @@ -85,8 +153,8 @@ **Merged pull requests:** -- Check duplicated names [\#80](https://github.com/w3c/webidl2.js/pull/80) ([SaschaNaz](https://github.com/SaschaNaz)) -- Remove legacycaller [\#79](https://github.com/w3c/webidl2.js/pull/79) ([SaschaNaz](https://github.com/SaschaNaz)) +- Check duplicated names [\#80](https://github.com/w3c/webidl2.js/pull/80) ([saschanaz](https://github.com/saschanaz)) +- Remove legacycaller [\#79](https://github.com/w3c/webidl2.js/pull/79) ([saschanaz](https://github.com/saschanaz)) - Add "sequence" property to IDL Type AST definition [\#76](https://github.com/w3c/webidl2.js/pull/76) ([lerouche](https://github.com/lerouche)) ## [v4.1.0](https://github.com/w3c/webidl2.js/tree/v4.1.0) (2017-07-04) @@ -98,7 +166,7 @@ **Merged pull requests:** -- Support TypeWithExtendedAttributes on generics [\#75](https://github.com/w3c/webidl2.js/pull/75) ([SaschaNaz](https://github.com/SaschaNaz)) +- Support TypeWithExtendedAttributes on generics [\#75](https://github.com/w3c/webidl2.js/pull/75) ([saschanaz](https://github.com/saschanaz)) ## [v4.0.0](https://github.com/w3c/webidl2.js/tree/v4.0.0) (2017-06-27) [Full Changelog](https://github.com/w3c/webidl2.js/compare/v3.0.2...v4.0.0) @@ -112,7 +180,7 @@ **Merged pull requests:** - BREAKING CHANGE: remove serializers \(closes \#73\) [\#74](https://github.com/w3c/webidl2.js/pull/74) ([marcoscaceres](https://github.com/marcoscaceres)) -- Add documentation for namespaces [\#70](https://github.com/w3c/webidl2.js/pull/70) ([SaschaNaz](https://github.com/SaschaNaz)) +- Add documentation for namespaces [\#70](https://github.com/w3c/webidl2.js/pull/70) ([saschanaz](https://github.com/saschanaz)) ## [v3.0.2](https://github.com/w3c/webidl2.js/tree/v3.0.2) (2017-05-29) [Full Changelog](https://github.com/w3c/webidl2.js/compare/v3.0.1...v3.0.2) @@ -123,7 +191,7 @@ **Merged pull requests:** -- Test for latest LTS/stable node versions [\#69](https://github.com/w3c/webidl2.js/pull/69) ([SaschaNaz](https://github.com/SaschaNaz)) +- Test for latest LTS/stable node versions [\#69](https://github.com/w3c/webidl2.js/pull/69) ([saschanaz](https://github.com/saschanaz)) ## [v3.0.1](https://github.com/w3c/webidl2.js/tree/v3.0.1) (2017-05-18) [Full Changelog](https://github.com/w3c/webidl2.js/compare/v2.4.0...v3.0.1) @@ -135,8 +203,8 @@ **Merged pull requests:** -- Fix whitespace error on parsing extended attributes [\#68](https://github.com/w3c/webidl2.js/pull/68) ([SaschaNaz](https://github.com/SaschaNaz)) -- Remove deprecated IDL arrays and exceptions [\#67](https://github.com/w3c/webidl2.js/pull/67) ([SaschaNaz](https://github.com/SaschaNaz)) +- Fix whitespace error on parsing extended attributes [\#68](https://github.com/w3c/webidl2.js/pull/68) ([saschanaz](https://github.com/saschanaz)) +- Remove deprecated IDL arrays and exceptions [\#67](https://github.com/w3c/webidl2.js/pull/67) ([saschanaz](https://github.com/saschanaz)) ## [v2.4.0](https://github.com/w3c/webidl2.js/tree/v2.4.0) (2017-04-12) [Full Changelog](https://github.com/w3c/webidl2.js/compare/v2.1.0...v2.4.0) @@ -157,7 +225,7 @@ - Update webidl2.js [\#63](https://github.com/w3c/webidl2.js/pull/63) ([tqeto](https://github.com/tqeto)) - Remove support for MapClass \(no longer valid in WebIDL\) [\#62](https://github.com/w3c/webidl2.js/pull/62) ([dontcallmedom](https://github.com/dontcallmedom)) - Add support for annotated types [\#61](https://github.com/w3c/webidl2.js/pull/61) ([dontcallmedom](https://github.com/dontcallmedom)) -- Support namespaces [\#58](https://github.com/w3c/webidl2.js/pull/58) ([SaschaNaz](https://github.com/SaschaNaz)) +- Support namespaces [\#58](https://github.com/w3c/webidl2.js/pull/58) ([saschanaz](https://github.com/saschanaz)) - Add support for records [\#57](https://github.com/w3c/webidl2.js/pull/57) ([TimothyGu](https://github.com/TimothyGu)) - Refactor [\#50](https://github.com/w3c/webidl2.js/pull/50) ([marcoscaceres](https://github.com/marcoscaceres)) - feat\(lib\): add AMD export support \(closes \#48\) [\#49](https://github.com/w3c/webidl2.js/pull/49) ([marcoscaceres](https://github.com/marcoscaceres)) diff --git a/tests/wpt/web-platform-tests/resources/webidl2/README.md b/tests/wpt/web-platform-tests/resources/webidl2/README.md index 93cc78b9c48..8791360d1c1 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/README.md +++ b/tests/wpt/web-platform-tests/resources/webidl2/README.md @@ -310,7 +310,6 @@ A typedef looks like this: ```JS { "type": "typedef", - "typeExtAttrs": [], "idlType": { "sequence": true, "generic": "sequence", @@ -336,8 +335,6 @@ The fields are as follows: * `name`: The typedef's name. * `idlType`: An [IDL Type](#idl-type) describing what typedef's type. * `extAttrs`: A list of [extended attributes](#extended-attributes). -* `typeExtAttrs`: A list of [extended attributes](#extended-attributes) that apply to the -type rather than to the typedef as a whole. ### Implements @@ -489,34 +486,6 @@ The fields are as follows: * `value`: The constant value as described by [Const Values](#default-and-const-values) * `extAttrs`: A list of [extended attributes](#extended-attributes). -### Iterator Member - -Iterator members look like this - -```JS -{ - "type": "iterator", - "getter": false, - "setter": false, - "deleter": false, - "static": false, - "stringifier": false, - "idlType": { - "sequence": false, - "generic": null, - "nullable": false, - "union": false, - "idlType": "Session2" - }, - "iteratorObject": "SessionIterator", - "extAttrs": [] -} -``` - -* `type`: Always "iterator". -* `iteratorObject`: The string on the right-hand side; absent if there isn't one. -* the rest: same as on [operations](#operation-member). - ### Arguments The arguments (e.g. for an operation) look like this: @@ -611,7 +580,7 @@ These appear as members of interfaces that look like this: The fields are as follows: * `type`: Always one of "iterable", "legacyiterable", "maplike" or "setlike". -* `idlType`: An [IDL Type](#idl-type) (or an array of two types) representing the declared type arguments. +* `idlType`: An array with one or more [IDL Types](#idl-type) representing the declared type arguments. * `readonly`: Whether the maplike or setlike is declared as read only. * `extAttrs`: A list of [extended attributes](#extended-attributes). diff --git a/tests/wpt/web-platform-tests/resources/webidl2/lib/webidl2.js b/tests/wpt/web-platform-tests/resources/webidl2/lib/webidl2.js index 0c9a1faacf7..a7a61d957b5 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/lib/webidl2.js +++ b/tests/wpt/web-platform-tests/resources/webidl2/lib/webidl2.js @@ -1,33 +1,82 @@ "use strict"; (() => { + // These regular expressions use the sticky flag so they will only match at + // the current location (ie. the offset of lastIndex). + const tokenRe = { + // This expression uses a lookahead assertion to catch false matches + // against integers early. + "float": /-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y, + "integer": /-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y, + "identifier": /[A-Z_a-z][0-9A-Z_a-z-]*/y, + "string": /"[^"]*"/y, + "whitespace": /[\t\n\r ]+/y, + "comment": /((\/(\/.*|\*([^*]|\*[^\/])*\*\/)[\t\n\r ]*)+)/y, + "other": /[^\t\n\r 0-9A-Z_a-z]/y + }; + + function attemptTokenMatch(str, type, re, lastIndex, tokens) { + re.lastIndex = lastIndex; + const result = re.exec(str); + if (result) { + tokens.push({ type, value: result[0] }); + return re.lastIndex; + } + return -1; + } + function tokenise(str) { const tokens = []; - const re = { - "float": /^-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/, - "integer": /^-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/, - "identifier": /^[A-Z_a-z][0-9A-Z_a-z-]*/, - "string": /^"[^"]*"/, - "whitespace": /^(?:[\t\n\r ]+|[\t\n\r ]*((\/\/.*|\/\*(.|\n|\r)*?\*\/)[\t\n\r ]*))+/, - "other": /^[^\t\n\r 0-9A-Z_a-z]/ - }; - const types = ["float", "integer", "identifier", "string", "whitespace", "other"]; - while (str.length > 0) { - let matched = false; - for (var i in types) { - const type = types[i]; - str = str.replace(re[type], tok => { - tokens.push({ type, value: tok }); - matched = true; - return ""; - }); - if (matched) break; + let lastIndex = 0; + while (lastIndex < str.length) { + const nextChar = str.charAt(lastIndex); + let result = -1; + if (/[-0-9.]/.test(nextChar)) { + result = attemptTokenMatch(str, "float", tokenRe.float, lastIndex, + tokens); + if (result === -1) { + result = attemptTokenMatch(str, "integer", tokenRe.integer, lastIndex, + tokens); + } + if (result === -1) { + // '-' and '.' can also match "other". + result = attemptTokenMatch(str, "other", tokenRe.other, + lastIndex, tokens); + } + } else if (/[A-Z_a-z]/.test(nextChar)) { + result = attemptTokenMatch(str, "identifier", tokenRe.identifier, + lastIndex, tokens); + } else if (nextChar === '"') { + result = attemptTokenMatch(str, "string", tokenRe.string, + lastIndex, tokens); + if (result === -1) { + // '"' can also match "other". + result = attemptTokenMatch(str, "other", tokenRe.other, + lastIndex, tokens); + } + } else if (/[\t\n\r ]/.test(nextChar)) { + result = attemptTokenMatch(str, "whitespace", tokenRe.whitespace, + lastIndex, tokens); + } else if (nextChar === '/') { + // The parser expects comments to be labelled as "whitespace". + result = attemptTokenMatch(str, "whitespace", tokenRe.comment, + lastIndex, tokens); + if (result === -1) { + // '/' can also match "other". + result = attemptTokenMatch(str, "other", tokenRe.other, + lastIndex, tokens); + } + } else { + result = attemptTokenMatch(str, "other", tokenRe.other, + lastIndex, tokens); + } + if (result === -1) { + throw new Error("Token stream not progressing"); } - if (matched) continue; - throw new Error("Token stream not progressing"); + lastIndex = result; } return tokens; - }; + } class WebIDLParseError { constructor(str, line, input, tokens) { @@ -46,6 +95,7 @@ let line = 1; tokens = tokens.slice(); const names = new Map(); + let current = null; const FLOAT = "float"; const INT = "integer"; @@ -58,7 +108,7 @@ getter: false, setter: false, deleter: false, - "static": false, + static: false, stringifier: false }); @@ -70,8 +120,18 @@ tok += tokens[numTokens].value; numTokens++; } - throw new WebIDLParseError(str, line, tok, tokens.slice(0, maxTokens)); - }; + + let message; + if (current) { + message = `Got an error during or right after parsing \`${current.partial ? "partial " : ""}${current.type} ${current.name}\`: ${str}` + } + else { + // throwing before any valid definition + message = `Got an error before parsing any named definition: ${str}`; + } + + throw new WebIDLParseError(message, line, tok, tokens.slice(0, maxTokens)); + } function sanitize_name(name, type) { if (names.has(name)) { @@ -87,23 +147,34 @@ if (!tokens.length || tokens[0].type !== type) return; if (typeof value === "undefined" || tokens[0].value === value) { last_token = tokens.shift(); - if (type === ID) last_token.value = last_token.value.replace(/^_/, ""); + if (type === ID && last_token.value.startsWith('_')) + last_token.value = last_token.value.substring(1); return last_token; } - }; + } + + function count(str, char) { + let total = 0; + for (let i = str.indexOf(char); i !== -1; i = str.indexOf(char, i + 1)) { + ++total; + } + return total; + } function ws() { if (!tokens.length) return; if (tokens[0].type === "whitespace") { const t = tokens.shift(); - t.value.replace(/\n/g, m => { - line++; - return m; - }); + line += count(t.value, '\n'); return t; } - }; + } + const all_ws_re = { + "ws": /([\t\n\r ]+)/y, + "line-comment": /\/\/(.*)\r?\n?/y, + "multiline-comment": /\/\*((?:[^*]|\*[^/])*)\*\//y + }; function all_ws(store, pea) { // pea == post extended attribute, tpea = same for types const t = { type: "whitespace", value: "" }; while (true) { @@ -114,31 +185,30 @@ if (t.value.length > 0) { if (store) { let w = t.value; - const re = { - "ws": /^([\t\n\r ]+)/, - "line-comment": /^\/\/(.*)\r?\n?/, - "multiline-comment": /^\/\*((?:.|\n|\r)*?)\*\// - }; - const wsTypes = []; - for (var k in re) wsTypes.push(k); - while (w.length) { + let lastIndex = 0; + while (lastIndex < w.length) { let matched = false; - for (var i in wsTypes) { - const type = wsTypes[i]; - w = w.replace(re[type], (tok, m1) => { - store.push({ type: type + (pea ? ("-" + pea) : ""), value: m1 }); + // Servo doesn't support using "const" in this construction yet. + // See https://github.com/servo/servo/issues/20231. + // |type| can be made const once Servo supports it. + for (let type in all_ws_re) { + const re = all_ws_re[type]; + re.lastIndex = lastIndex; + const result = re.exec(w); + if (result) { + store.push({ type: type + (pea ? ("-" + pea) : ""), value: result[1] }); matched = true; - return ""; - }); - if (matched) break; + lastIndex = re.lastIndex; + break; + } } - if (matched) continue; - throw new Error("Surprising white space construct."); // this shouldn't happen + if (!matched) + throw new Error("Surprising white space construct."); // this shouldn't happen } } return t; } - }; + } function integer_type() { let ret = ""; @@ -153,7 +223,7 @@ return ret; } if (ret) error("Failed to parse integer type"); - }; + } function float_type() { let ret = ""; @@ -163,7 +233,7 @@ if (consume(ID, "float")) return ret + "float"; if (consume(ID, "double")) return ret + "double"; if (ret) error("Failed to parse float type"); - }; + } function primitive_type() { const num_type = integer_type() || float_type(); @@ -172,7 +242,7 @@ if (consume(ID, "boolean")) return "boolean"; if (consume(ID, "byte")) return "byte"; if (consume(ID, "octet")) return "octet"; - }; + } function const_value() { if (consume(ID, "true")) return { type: "boolean", value: true }; @@ -187,7 +257,7 @@ if (consume(ID, "Infinity")) return { type: "Infinity", negative: true }; else tokens.unshift(tok); } - }; + } function type_suffix(obj) { while (true) { @@ -197,11 +267,11 @@ obj.nullable = true; } else return; } - }; + } - function single_type() { + function single_type(typeName) { const prim = primitive_type(); - const ret = { sequence: false, generic: null, nullable: false, union: false }; + const ret = { type: typeName || null, sequence: false, generic: null, nullable: false, union: false }; let name; let value; if (prim) { @@ -219,7 +289,7 @@ const types = []; do { all_ws(); - types.push(type_with_extended_attributes() || error("Error parsing generic type " + value)); + types.push(type_with_extended_attributes(typeName) || error("Error parsing generic type " + value)); all_ws(); } while (consume(OTHER, ",")); @@ -248,12 +318,12 @@ type_suffix(ret); if (ret.nullable && ret.idlType === "any") error("Type any cannot be made nullable"); return ret; - }; + } - function union_type() { + function union_type(typeName) { all_ws(); if (!consume(OTHER, "(")) return; - const ret = { sequence: false, generic: null, nullable: false, union: true, idlType: [] }; + const ret = { type: typeName || null, sequence: false, generic: null, nullable: false, union: true, idlType: [] }; const fst = type_with_extended_attributes() || error("Union type with no content"); ret.idlType.push(fst); while (true) { @@ -265,18 +335,18 @@ if (!consume(OTHER, ")")) error("Unterminated union type"); type_suffix(ret); return ret; - }; + } - function type() { - return single_type() || union_type(); - }; + function type(typeName) { + return single_type(typeName) || union_type(typeName); + } - function type_with_extended_attributes() { + function type_with_extended_attributes(typeName) { const extAttrs = extended_attrs(); - const ret = single_type() || union_type(); + const ret = single_type(typeName) || union_type(typeName); if (extAttrs.length && ret) ret.extAttrs = extAttrs; return ret; - }; + } function argument(store) { const ret = { optional: false, variadic: false }; @@ -287,7 +357,7 @@ ret.optional = true; all_ws(); } - ret.idlType = type_with_extended_attributes(); + ret.idlType = type_with_extended_attributes("argument-type"); if (!ret.idlType) { if (opt_token) tokens.unshift(opt_token); return; @@ -322,7 +392,7 @@ } } return ret; - }; + } function argument_list(store) { const ret = []; @@ -335,7 +405,7 @@ const nxt = argument(store ? ret : null) || error("Trailing comma in arguments list"); ret.push(nxt); } - }; + } function simple_extended_attr(store) { all_ws(); @@ -386,7 +456,7 @@ consume(OTHER, ")") || error("Unexpected token in extended attribute argument list"); } return ret; - }; + } // Note: we parse something simpler than the official syntax. It's all that ever // seems to be used @@ -406,7 +476,7 @@ all_ws(); consume(OTHER, "]") || error("No end of extended attribute"); return eas; - }; + } function default_() { all_ws(); @@ -420,11 +490,11 @@ return { type: "sequence", value: [] }; } else { const str = consume(STR) || error("No value for default"); - str.value = str.value.replace(/^"/, "").replace(/"$/, ""); + str.value = str.value.slice(1, -1); return str; } } - }; + } function const_(store) { all_ws(store, "pea"); @@ -436,7 +506,7 @@ typ = consume(ID) || error("No type for const"); typ = typ.value; } - ret.idlType = typ; + ret.idlType = { type: "const-type", idlType: typ }; all_ws(); if (consume(OTHER, "?")) { ret.nullable = true; @@ -453,7 +523,7 @@ all_ws(); consume(OTHER, ";") || error("Unterminated const"); return ret; - }; + } function inheritance() { all_ws(); @@ -462,7 +532,7 @@ const inh = consume(ID) || error("No type in inheritance"); return inh.value; } - }; + } function operation_rest(ret, store) { all_ws(); @@ -477,7 +547,7 @@ all_ws(); consume(OTHER, ";") || error("Unterminated operation"); return ret; - }; + } function callback(store) { all_ws(store, "pea"); @@ -486,12 +556,11 @@ all_ws(); const tok = consume(ID, "interface"); if (tok) { - ret = interface_rest(); - ret.type = "callback interface"; + ret = interface_rest(false, store, "callback interface"); return ret; } const name = consume(ID) || error("No name for callback"); - ret = { type: "callback", name: sanitize_name(name.value, "callback") }; + ret = current = { type: "callback", name: sanitize_name(name.value, "callback") }; all_ws(); consume(OTHER, "=") || error("No assignment in callback"); all_ws(); @@ -504,14 +573,14 @@ all_ws(); consume(OTHER, ";") || error("Unterminated callback"); return ret; - }; + } function attribute(store) { all_ws(store, "pea"); const grabbed = []; const ret = { type: "attribute", - "static": false, + static: false, stringifier: false, inherit: false, readonly: false @@ -519,7 +588,7 @@ const w = all_ws(); if (w) grabbed.push(w); if (consume(ID, "inherit")) { - if (ret["static"] || ret.stringifier) error("Cannot have a static or stringifier inherit"); + if (ret.static || ret.stringifier) error("Cannot have a static or stringifier inherit"); ret.inherit = true; grabbed.push(last_token); const w = all_ws(); @@ -536,14 +605,14 @@ tokens = grabbed.concat(tokens); } return rest; - }; + } function attribute_rest(ret) { if (!consume(ID, "attribute")) { return; } all_ws(); - ret.idlType = type_with_extended_attributes() || error("No type in attribute"); + ret.idlType = type_with_extended_attributes("attribute-type") || error("No type in attribute"); if (ret.idlType.sequence) error("Attributes cannot accept sequence types"); if (ret.idlType.generic === "record") error("Attributes cannot accept record types"); all_ws(); @@ -552,17 +621,17 @@ all_ws(); consume(OTHER, ";") || error("Unterminated attribute"); return ret; - }; + } function return_type() { - const typ = type(); + const typ = type("return-type"); if (!typ) { if (consume(ID, "void")) { return "void"; } else error("No return type"); } return typ; - }; + } function operation(store) { all_ws(store, "pea"); @@ -582,24 +651,9 @@ } ret.idlType = return_type(); all_ws(); - if (consume(ID, "iterator")) { - all_ws(); - ret.type = "iterator"; - if (consume(ID, "object")) { - ret.iteratorObject = "object"; - } else if (consume(OTHER, "=")) { - all_ws(); - var name = consume(ID) || error("No right hand side in iterator"); - ret.iteratorObject = name.value; - } - all_ws(); - consume(OTHER, ";") || error("Unterminated iterator"); - return ret; - } else { - operation_rest(ret, store); - return ret; - } - }; + operation_rest(ret, store); + return ret; + } function static_member(store) { all_ws(store, "pea"); @@ -631,7 +685,7 @@ arr.push(name.value); } else break; } - }; + } function iterable_type() { if (consume(ID, "iterable")) return "iterable"; @@ -639,13 +693,13 @@ else if (consume(ID, "maplike")) return "maplike"; else if (consume(ID, "setlike")) return "setlike"; else return; - }; + } function readonly_iterable_type() { if (consume(ID, "maplike")) return "maplike"; else if (consume(ID, "setlike")) return "setlike"; else return; - }; + } function iterable(store) { all_ws(store, "pea"); @@ -672,17 +726,14 @@ delete ret.readonly; all_ws(); if (consume(OTHER, "<")) { - ret.idlType = type_with_extended_attributes() || error(`Error parsing ${ittype} declaration`); + ret.idlType = [type_with_extended_attributes()] || error(`Error parsing ${ittype} declaration`); all_ws(); if (secondTypeAllowed) { - let type2 = null; if (consume(OTHER, ",")) { all_ws(); - type2 = type_with_extended_attributes(); + ret.idlType.push(type_with_extended_attributes()); all_ws(); } - if (type2) - ret.idlType = [ret.idlType, type2]; else if (secondTypeRequired) error(`Missing second type argument in ${ittype} declaration`); } @@ -693,16 +744,16 @@ error(`Error parsing ${ittype} declaration`); return ret; - }; + } - function interface_rest(isPartial, store) { + function interface_rest(isPartial, store, typeName = "interface") { all_ws(); const name = consume(ID) || error("No name for interface"); const mems = []; - const ret = { - type: "interface", + const ret = current = { + type: typeName, name: isPartial ? name.value : sanitize_name(name.value, "interface"), - partial: false, + partial: isPartial, members: mems }; if (!isPartial) ret.inheritance = inheritance() || null; @@ -733,7 +784,7 @@ mem.extAttrs = ea; ret.members.push(mem); } - }; + } function mixin_rest(isPartial, store) { all_ws(); @@ -741,10 +792,10 @@ all_ws(); const name = consume(ID) || error("No name for interface mixin"); const mems = []; - const ret = { + const ret = current = { type: "interface mixin", name: isPartial ? name.value : sanitize_name(name.value, "interface mixin"), - partial: false, + partial: isPartial, members: mems }; all_ws(); @@ -787,7 +838,7 @@ all_ws(); const name = consume(ID) || error("No name for namespace"); const mems = []; - const ret = { + const ret = current = { type: "namespace", name: isPartial ? name.value : sanitize_name(name.value, "namespace"), partial: isPartial, @@ -817,7 +868,7 @@ const grabbed = []; const ret = { type: "attribute", - "static": false, + static: false, stringifier: false, inherit: false, readonly: false @@ -856,9 +907,8 @@ interface_(true, store) || namespace(true, store) || error("Partial doesn't apply to anything"); - thing.partial = true; return thing; - }; + } function dictionary(isPartial, store) { all_ws(isPartial ? null : store, "pea"); @@ -866,10 +916,10 @@ all_ws(); const name = consume(ID) || error("No name for dictionary"); const mems = []; - const ret = { + const ret = current = { type: "dictionary", name: isPartial ? name.value : sanitize_name(name.value, "dictionary"), - partial: false, + partial: isPartial, members: mems }; if (!isPartial) ret.inheritance = inheritance() || null; @@ -885,7 +935,7 @@ const ea = extended_attrs(store ? mems : null); all_ws(store ? mems : null, "pea"); const required = consume(ID, "required"); - const typ = type_with_extended_attributes() || error("No type for dictionary member"); + const typ = type_with_extended_attributes("dictionary-type") || error("No type for dictionary member"); all_ws(); const name = consume(ID) || error("No name for dictionary member"); const dflt = default_(); @@ -904,7 +954,7 @@ all_ws(); consume(OTHER, ";") || error("Unterminated dictionary member"); } - }; + } function enum_(store) { all_ws(store, "pea"); @@ -912,7 +962,7 @@ all_ws(); const name = consume(ID) || error("No name for enum"); const vals = []; - const ret = { + const ret = current = { type: "enum", name: sanitize_name(name.value, "enum"), values: vals @@ -928,7 +978,7 @@ return ret; } const val = consume(STR) || error("Unexpected value in enum"); - val.value = val.value.replace(/"/g, ""); + val.value = val.value.slice(1, -1); ret.values.push(val); all_ws(store ? vals : null); if (consume(OTHER, ",")) { @@ -939,7 +989,7 @@ saw_comma = false; } } - }; + } function typedef(store) { all_ws(store, "pea"); @@ -948,14 +998,15 @@ type: "typedef" }; all_ws(); - ret.idlType = type_with_extended_attributes() || error("No type in typedef"); + ret.idlType = type_with_extended_attributes("typedef-type") || error("No type in typedef"); all_ws(); const name = consume(ID) || error("No name in typedef"); ret.name = sanitize_name(name.value, "typedef"); + current = ret; all_ws(); consume(OTHER, ";") || error("Unterminated typedef"); return ret; - }; + } function implements_(store) { all_ws(store, "pea"); @@ -978,7 +1029,7 @@ tokens.unshift(w); tokens.unshift(target); } - }; + } function includes(store) { all_ws(store, "pea"); @@ -1001,7 +1052,7 @@ tokens.unshift(w); tokens.unshift(target); } - }; + } function definition(store) { return callback(store) || @@ -1013,7 +1064,7 @@ implements_(store) || includes(store) || namespace(false, store); - }; + } function definitions(store) { if (!tokens.length) return []; @@ -1029,11 +1080,11 @@ defs.push(def); } return defs; - }; + } const res = definitions(opt.ws); if (tokens.length) error("Unrecognised tokens"); return res; - }; + } const obj = { parse(str, opt) { diff --git a/tests/wpt/web-platform-tests/resources/webidl2/lib/writer.js b/tests/wpt/web-platform-tests/resources/webidl2/lib/writer.js index 5e30e707e13..c00c0dd9322 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/lib/writer.js +++ b/tests/wpt/web-platform-tests/resources/webidl2/lib/writer.js @@ -1,78 +1,71 @@ -(function() { +"use strict"; - var write = function(ast, opt) { - var curPea = "", - curTPea = "", - opt = opt || {}, - noop = function(str) { - return str; }, - optNames = "type".split(" "), - context = []; - for (var i = 0, n = optNames.length; i < n; i++) { - var o = optNames[i]; +(() => { + function write(ast, opt = {}) { + let curPea = ""; + let curTPea = ""; + const noop = str => str; + const optNames = "type".split(" "); + const context = []; + for (const o of optNames) { if (!opt[o]) opt[o] = noop; } - var literal = function(it) { + function literal(it) { return it.value; }; - var wsPea = function(it) { + function wsPea(it) { curPea += it.value; return ""; }; - var wsTPea = function(it) { + function wsTPea(it) { curTPea += it.value; return ""; }; - var lineComment = function(it) { - return "//" + it.value + "\n"; + function lineComment(it) { + return `//${it.value}\n`; }; - var multilineComment = function(it) { - return "/*" + it.value + "*/"; + function multilineComment(it) { + return `/*${it.value}*/`; }; - var type = function(it) { + function type(it) { if (typeof it === "string") return opt.type(it); // XXX should maintain some context - if (it.union) return "(" + it.idlType.map(type).join(" or ") + ")"; - var ret = ""; - if (it.generic) ret += it.generic + "<"; - else if (it.sequence) ret += "sequence<"; - if (Array.isArray(it.idlType)) ret += it.idlType.map(type).join(", "); - else ret += type(it.idlType); - if (it.array || it.generic === 'Array') { - for (var i = 0, n = it.nullableArray.length; i < n; i++) { - var val = it.nullableArray[i]; - if (val) ret += "?"; - ret += "[]"; - } + let ret = extended_attributes(it.extAttrs, curPea); + if (it.union) ret += `(${it.idlType.map(type).join(" or ")})`; + else { + if (it.generic) ret += `${it.generic}<`; + if (Array.isArray(it.idlType)) ret += it.idlType.map(type).join(", "); + else ret += type(it.idlType); + if (it.generic) ret += ">"; } - if (it.generic || it.sequence) ret += ">"; if (it.nullable) ret += "?"; return ret; }; - var const_value = function(it) { - var tp = it.type; + function const_value(it) { + const tp = it.type; if (tp === "boolean") return it.value ? "true" : "false"; else if (tp === "null") return "null"; else if (tp === "Infinity") return (it.negative ? "-" : "") + "Infinity"; else if (tp === "NaN") return "NaN"; else if (tp === "number") return it.value; - else return '"' + it.value + '"'; + else if (tp === "sequence") return "[]"; + else return `"${it.value}"`; }; - var argument = function(arg, pea) { - var ret = extended_attributes(arg.extAttrs, pea); + function argument(arg, pea) { + let ret = extended_attributes(arg.extAttrs, pea); if (arg.optional) ret += "optional "; ret += type(arg.idlType); if (arg.variadic) ret += "..."; - ret += " " + arg.name; - if (arg["default"]) ret += " = " + const_value(arg["default"]); + ret += ` ${arg.name}`; + if (arg["default"]) ret += ` = ${const_value(arg["default"])}`; return ret; }; - var args = function(its) { - var res = "", - pea = ""; - for (var i = 0, n = its.length; i < n; i++) { - var arg = its[i]; + function args(its) { + let res = ""; + let pea = ""; + for (let i = 0, n = its.length; i < n; i++) { + const arg = its[i]; if (arg.type === "ws") res += arg.value; else if (arg.type === "ws-pea") pea += arg.value; else { @@ -83,182 +76,198 @@ } return res; }; - var make_ext_at = function(it) { - if (it["arguments"] === null) return it.name; + function make_ext_at(it) { context.unshift(it); - var ret = it.name + "(" + (it["arguments"].length ? args(it["arguments"]) : "") + ")"; + let ret = it.name; + if (it.rhs) { + if (it.rhs.type === "identifier-list") ret += `=(${it.rhs.value.join(',')})`; + else ret += `=${it.rhs.value}`; + } + if (it.arguments) ret += `(${it["arguments"].length ? args(it["arguments"]) : ""})`; context.shift(); // XXX need to add more contexts, but not more than needed for ReSpec return ret; }; - var extended_attributes = function(eats, pea) { + function extended_attributes(eats, pea) { if (!eats || !eats.length) return ""; - return "[" + eats.map(make_ext_at).join(", ") + "]" + pea; + return `[${eats.map(make_ext_at).join(", ")}]${pea}`; }; - var modifiers = "getter setter creator deleter legacycaller stringifier static".split(" "); - var operation = function(it) { - var ret = extended_attributes(it.extAttrs, curPea); + const modifiers = "getter setter creator deleter legacycaller stringifier static".split(" "); + function operation(it) { + let ret = extended_attributes(it.extAttrs, curPea); curPea = ""; if (it.stringifier && !it.idlType) return "stringifier;"; - for (var i = 0, n = modifiers.length; i < n; i++) { - var mod = modifiers[i]; + for (const mod of modifiers) { if (it[mod]) ret += mod + " "; } ret += type(it.idlType) + " "; if (it.name) ret += it.name; - ret += "(" + args(it["arguments"]) + ");"; + ret += `(${args(it["arguments"])});`; return ret; }; - var attribute = function(it) { - var ret = extended_attributes(it.extAttrs, curPea); + function attribute(it) { + let ret = extended_attributes(it.extAttrs, curPea); curPea = ""; if (it["static"]) ret += "static "; if (it.stringifier) ret += "stringifier "; if (it.readonly) ret += "readonly "; if (it.inherit) ret += "inherit "; - ret += "attribute " + type(it.idlType) + " " + it.name + ";"; + ret += `attribute ${type(it.idlType)} ${it.name};`; return ret; }; - var interface_ = function(it) { - var ret = extended_attributes(it.extAttrs, curPea); + function interface_(it) { + let ret = extended_attributes(it.extAttrs, curPea); curPea = ""; if (it.partial) ret += "partial "; - ret += "interface " + it.name + " "; - if (it.inheritance) ret += ": " + it.inheritance + " "; - ret += "{" + iterate(it.members) + "};"; + ret += `interface ${it.name} `; + if (it.inheritance) ret += `: ${it.inheritance} `; + ret += `{${iterate(it.members)}};`; return ret; }; - var dictionary = function(it) { - var ret = extended_attributes(it.extAttrs, curPea); + function interface_mixin(it) { + let ret = extended_attributes(it.extAttrs, curPea); curPea = ""; if (it.partial) ret += "partial "; - ret += "dictionary " + it.name + " "; - ret += "{" + iterate(it.members) + "};"; + ret += `interface mixin ${it.name} `; + ret += `{${iterate(it.members)}};`; + return ret; + } + + function namespace(it) { + let ret = extended_attributes(it.extAttrs, curPea); + curPea = ""; + if (it.partial) ret += "partial "; + ret += `namespace ${it.name} `; + ret += `{${iterate(it.members)}};`; + return ret; + } + + function dictionary(it) { + let ret = extended_attributes(it.extAttrs, curPea); + curPea = ""; + if (it.partial) ret += "partial "; + ret += `dictionary ${it.name} `; + if (it.inheritance) ret += `: ${it.inheritance} `; + ret += `{${iterate(it.members)}};`; return ret; }; - var field = function(it) { - var ret = extended_attributes(it.extAttrs, curPea); + function field(it) { + let ret = extended_attributes(it.extAttrs, curPea); curPea = ""; if (it.required) ret += "required "; - ret += type(it.idlType) + " " + it.name; - if (it["default"]) ret += " = " + const_value(it["default"]); + ret += `${type(it.idlType)} ${it.name}`; + if (it["default"]) ret += ` = ${const_value(it["default"])}`; ret += ";"; return ret; }; - var exception = function(it) { - var ret = extended_attributes(it.extAttrs, curPea); + function const_(it) { + const ret = extended_attributes(it.extAttrs, curPea); curPea = ""; - ret += "exception " + it.name + " "; - if (it.inheritance) ret += ": " + it.inheritance + " "; - ret += "{" + iterate(it.members) + "};"; - return ret; + return `${ret}const ${type(it.idlType)}${it.nullable ? "?" : ""} ${it.name} = ${const_value(it.value)};`; }; - var const_ = function(it) { - var ret = extended_attributes(it.extAttrs, curPea); + function typedef(it) { + let ret = extended_attributes(it.extAttrs, curPea); curPea = ""; - return ret + "const " + type(it.idlType) + " " + it.name + " = " + const_value(it.value) + ";"; + ret += `typedef ${extended_attributes(it.typeExtAttrs, curTPea)}`; + curTPea = ""; + return `${ret}${type(it.idlType)} ${it.name};`; }; - var typedef = function(it) { - var ret = extended_attributes(it.extAttrs, curPea); + function implements_(it) { + const ret = extended_attributes(it.extAttrs, curPea); curPea = ""; - ret += "typedef " + extended_attributes(it.typeExtAttrs, curTPea); - curTPea = ""; - return ret + type(it.idlType) + " " + it.name + ";"; + return `${ret}${it.target} implements ${it["implements"]};`; }; - var implements_ = function(it) { - var ret = extended_attributes(it.extAttrs, curPea); + function includes(it) { + const ret = extended_attributes(it.extAttrs, curPea); curPea = ""; - return ret + it.target + " implements " + it["implements"] + ";"; + return `${ret}${it.target} includes ${it.includes};`; }; - var callback = function(it) { - var ret = extended_attributes(it.extAttrs, curPea); + function callback(it) { + const ret = extended_attributes(it.extAttrs, curPea); curPea = ""; - return ret + "callback " + it.name + " = " + type(it.idlType) + - "(" + args(it["arguments"]) + ");"; + return `${ret}callback ${it.name} = ${type(it.idlType)}(${args(it["arguments"])});`; }; - var enum_ = function(it) { - var ret = extended_attributes(it.extAttrs, curPea); + function enum_(it) { + let ret = extended_attributes(it.extAttrs, curPea); curPea = ""; - ret += "enum " + it.name + " {"; - for (var i = 0, n = it.values.length; i < n; i++) { - var v = it.values[i]; - if (typeof v === "string") ret += '"' + v + '"'; + ret += `enum ${it.name} {`; + for (const v of it.values) { + if (v.type === "string") ret += `"${v.value}"`; else if (v.type === "ws") ret += v.value; else if (v.type === ",") ret += ","; } return ret + "};"; }; - var iterable = function(it) { - return "iterable<" + (it.idlType instanceof Array ? it.idlType.map(type).join(", ") : type(it.idlType)) + ">;"; + function iterable(it) { + return `iterable<${Array.isArray(it.idlType) ? it.idlType.map(type).join(", ") : type(it.idlType)}>;`; }; - var legacyiterable = function(it) { - return "legacyiterable<" + (it.idlType instanceof Array ? it.idlType.map(type).join(", ") : type(it.idlType)) + ">;"; + function legacyiterable(it) { + return `legacyiterable<${Array.isArray(it.idlType) ? it.idlType.map(type).join(", ") : type(it.idlType)}>;`; }; - var maplike = function(it) { - return (it.readonly ? "readonly " : "") + "maplike<" + - it.idlType.map(type).join(", ") + ">;"; + function maplike(it) { + return `${it.readonly ? "readonly " : ""}maplike<${it.idlType.map(type).join(", ")}>;`; }; - var setlike = function(it) { - return (it.readonly ? "readonly " : "") + "setlike<" + - type(it.idlType) + ">;"; + function setlike(it) { + return `${it.readonly ? "readonly " : ""}setlike<${type(it.idlType[0])}>;`; }; - var callbackInterface = function(it) { - return 'callback ' + interface_(it); + function callbackInterface(it) { + return `callback ${interface_(it)}`; }; - var table = { + const table = { ws: literal, "ws-pea": wsPea, "ws-tpea": wsTPea, "line-comment": lineComment, "multiline-comment": multilineComment, - "interface": interface_, - operation: operation, - attribute: attribute, - dictionary: dictionary, - field: field, - exception: exception, - "const": const_, - typedef: typedef, - "implements": implements_, - callback: callback, - "enum": enum_, - iterable: iterable, - legacyiterable: legacyiterable, - maplike: maplike, - setlike: setlike, + interface: interface_, + "interface mixin": interface_mixin, + namespace, + operation, + attribute, + dictionary, + field, + const: const_, + typedef, + implements: implements_, + includes, + callback, + enum: enum_, + iterable, + legacyiterable, + maplike, + setlike, "callback interface": callbackInterface }; - var dispatch = function(it) { + function dispatch(it) { + const dispatcher = table[it.type]; + if (!dispatcher) { + throw new Error(`Type "${it.type}" is unsupported`) + } return table[it.type](it); }; - var iterate = function(things) { + function iterate(things) { if (!things) return; - var ret = ""; - for (var i = 0, n = things.length; i < n; i++) ret += dispatch(things[i]); + let ret = ""; + for (const thing of things) ret += dispatch(thing); return ret; }; return iterate(ast); }; - var obj = { - write: function(ast, opt) { - if (!opt) opt = {}; - return write(ast, opt); - } + const obj = { + write }; if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { module.exports = obj; } else if (typeof define === 'function' && define.amd) { - define([], function() { - return obj; - }); + define([], () => obj); } else { (self || window).WebIDL2Writer = obj; } -}()); +})(); diff --git a/tests/wpt/web-platform-tests/resources/webidl2/package-lock.json b/tests/wpt/web-platform-tests/resources/webidl2/package-lock.json index 53528713e57..a6f529d6c7f 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/package-lock.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/package-lock.json @@ -1,25 +1,52 @@ { "name": "webidl2", - "version": "4.2.0", + "version": "10.2.1", "lockfileVersion": 1, + "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz", + "integrity": "sha512-eVXQSbu/RimU6OKcK2/gDJVTFcxXJI4sHbIqw2mhwMZeQ2as/8AhS9DGkEDoHMBBNJZ5B0US63lF56x+KDcxiA==", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0-beta.40" + } + }, + "@babel/highlight": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.40.tgz", + "integrity": "sha512-mOhhTrzieV6VO7odgzFGFapiwRK0ei8RZRhfzHhb6cpX3QM8XXuCLXWjN8qBB7JReDdUR80V3LFfFrGUYevhNg==", + "dev": true, + "requires": { + "chalk": "2.3.2", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, "ansi-regex": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz", - "integrity": "sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "ansi-styles": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz", - "integrity": "sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94=", - "dev": true + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } }, "arr-diff": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true + "dev": true, + "requires": { + "arr-flatten": "1.1.0" + } }, "arr-flatten": { "version": "1.1.0", @@ -40,34 +67,51 @@ "dev": true }, "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", - "dev": true + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } }, "braces": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } }, "browser-stdout": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", - "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, "chalk": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz", - "integrity": "sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ=", - "dev": true + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.3.0" + } }, "color-convert": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz", - "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=", - "dev": true + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } }, "color-name": { "version": "1.1.3", @@ -76,9 +120,9 @@ "dev": true }, "commander": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", "dev": true }, "concat-map": { @@ -88,15 +132,24 @@ "dev": true }, "debug": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.0.tgz", - "integrity": "sha1-vFlryr52F/Edn6FTYe3tVgi4SZs=", - "dev": true + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } }, "diff": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", - "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "diff-match-patch": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.0.tgz", + "integrity": "sha1-HMPIOkkNZ/ldkeOfatHy4Ia2MEg=", "dev": true }, "escape-string-regexp": { @@ -105,37 +158,52 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, "expand-brackets": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } }, "expand-range": { "version": "1.8.2", "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true + "dev": true, + "requires": { + "fill-range": "2.2.3" + } }, "expect": { - "version": "21.2.1", - "resolved": "https://registry.npmjs.org/expect/-/expect-21.2.1.tgz", - "integrity": "sha512-orfQQqFRTX0jH7znRIGi8ZMR8kTNpXklTTz8+HGTpmTKZo3Occ6JNB5FXMb8cRuiiC/GyDqsr30zUa66ACYlYw==", + "version": "22.4.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-22.4.0.tgz", + "integrity": "sha512-Fiy862jT3qc70hwIHwwCBNISmaqBrfWKKrtqyMJ6iwZr+6KXtcnHojZFtd63TPRvRl8EQTJ+YXYy2lK6/6u+Hw==", "dev": true, - "dependencies": { - "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", - "dev": true - } + "requires": { + "ansi-styles": "3.2.1", + "jest-diff": "22.4.0", + "jest-get-type": "22.1.0", + "jest-matcher-utils": "22.4.0", + "jest-message-util": "22.4.0", + "jest-regex-util": "22.1.0" } }, "extglob": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } }, "filename-regex": { "version": "2.0.1", @@ -147,7 +215,14 @@ "version": "2.2.3", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", - "dev": true + "dev": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } }, "for-in": { "version": "1.0.2", @@ -159,7 +234,10 @@ "version": "0.1.5", "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true + "dev": true, + "requires": { + "for-in": "1.0.2" + } }, "fs.realpath": { "version": "1.0.0", @@ -168,52 +246,65 @@ "dev": true }, "glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", - "dev": true + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } }, "glob-base": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } }, "glob-parent": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true - }, - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", - "dev": true + "dev": true, + "requires": { + "is-glob": "2.0.1" + } }, "growl": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", - "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", + "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", "dev": true }, - "has-ansi": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz", - "integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=", + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } }, "inherits": { "version": "2.0.3", @@ -222,9 +313,9 @@ "dev": true }, "is-buffer": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", - "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, "is-dotfile": { @@ -237,7 +328,10 @@ "version": "0.1.3", "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true + "dev": true, + "requires": { + "is-primitive": "2.0.0" + } }, "is-extendable": { "version": "0.1.1", @@ -255,13 +349,19 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } }, "is-number": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true + "dev": true, + "requires": { + "kind-of": "3.2.2" + } }, "is-posix-bracket": { "version": "0.1.1", @@ -285,199 +385,113 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true + "dev": true, + "requires": { + "isarray": "1.0.0" + } }, "jest-diff": { - "version": "21.2.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-21.2.1.tgz", - "integrity": "sha512-E5fu6r7PvvPr5qAWE1RaUwIh/k6Zx/3OOkZ4rk5dBJkEWRrUuSgbMt2EO8IUTPTd6DOqU3LW6uTIwX5FRvXoFA==", + "version": "22.4.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-22.4.0.tgz", + "integrity": "sha512-+/t20WmnkOkB8MOaGaPziI8zWKxquMvYw4Ub+wOzi7AUhmpFXz43buWSxVoZo4J5RnCozpGbX3/FssjJ5KV9Nw==", "dev": true, - "dependencies": { - "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", - "dev": true - }, - "chalk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", - "dev": true - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true - }, - "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", - "dev": true - } + "requires": { + "chalk": "2.3.2", + "diff": "3.5.0", + "jest-get-type": "22.1.0", + "pretty-format": "22.4.0" } }, "jest-get-type": { - "version": "21.2.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-21.2.0.tgz", - "integrity": "sha512-y2fFw3C+D0yjNSDp7ab1kcd6NUYfy3waPTlD8yWkAtiocJdBRQqNoRqVfMNxgj+IjT0V5cBIHJO0z9vuSSZ43Q==", + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-22.1.0.tgz", + "integrity": "sha512-nD97IVOlNP6fjIN5i7j5XRH+hFsHL7VlauBbzRvueaaUe70uohrkz7pL/N8lx/IAwZRTJ//wOdVgh85OgM7g3w==", "dev": true }, "jest-matcher-utils": { - "version": "21.2.1", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-21.2.1.tgz", - "integrity": "sha512-kn56My+sekD43dwQPrXBl9Zn9tAqwoy25xxe7/iY4u+mG8P3ALj5IK7MLHZ4Mi3xW7uWVCjGY8cm4PqgbsqMCg==", + "version": "22.4.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-22.4.0.tgz", + "integrity": "sha512-03m3issxUXpWMwDYTfmL8hRNewUB0yCRTeXPm+eq058rZxLHD9f5NtSSO98CWHqe4UyISIxd9Ao9iDVjHWd2qg==", "dev": true, - "dependencies": { - "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", - "dev": true - }, - "chalk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", - "dev": true - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true - }, - "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", - "dev": true - } + "requires": { + "chalk": "2.3.2", + "jest-get-type": "22.1.0", + "pretty-format": "22.4.0" } }, "jest-message-util": { - "version": "21.2.1", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-21.2.1.tgz", - "integrity": "sha512-EbC1X2n0t9IdeMECJn2BOg7buOGivCvVNjqKMXTzQOu7uIfLml+keUfCALDh8o4rbtndIeyGU8/BKfoTr/LVDQ==", + "version": "22.4.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-22.4.0.tgz", + "integrity": "sha512-eyCJB0T3hrlpFF2FqQoIB093OulP+1qvATQmD3IOgJgMGqPL6eYw8TbC5P/VCWPqKhGL51xvjIIhow5eZ2wHFw==", "dev": true, - "dependencies": { - "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", - "dev": true - }, - "chalk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", - "dev": true - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true - }, - "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", - "dev": true - } + "requires": { + "@babel/code-frame": "7.0.0-beta.40", + "chalk": "2.3.2", + "micromatch": "2.3.11", + "slash": "1.0.0", + "stack-utils": "1.0.1" } }, "jest-regex-util": { - "version": "21.2.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-21.2.0.tgz", - "integrity": "sha512-BKQ1F83EQy0d9Jen/mcVX7D+lUt2tthhK/2gDWRgLDJRNOdRgSp1iVqFxP8EN1ARuypvDflRfPzYT8fQnoBQFQ==", + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-22.1.0.tgz", + "integrity": "sha512-on0LqVS6Xeh69sw3d1RukVnur+lVOl3zkmb0Q54FHj9wHoq6dbtWqb3TSlnVUyx36hqjJhjgs/QLqs07Bzu72Q==", "dev": true }, - "json3": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", - "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, "jsondiffpatch": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/jsondiffpatch/-/jsondiffpatch-0.2.4.tgz", - "integrity": "sha1-1LbFOz/H2htLkcHCrsi5MrdRHVw=", - "dev": true + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/jsondiffpatch/-/jsondiffpatch-0.3.5.tgz", + "integrity": "sha512-v7eaGLDMCHXH+fsIaZhptEUJmS8EJpunq7IM4cc4vIT/kSRAkaZ6ZF4ebiNcyUelL0znbvj6o2B5Gh9v7Og0BQ==", + "dev": true, + "requires": { + "chalk": "2.3.2", + "diff-match-patch": "1.0.0" + } }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true - }, - "lodash._baseassign": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", - "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", - "dev": true - }, - "lodash._basecopy": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", - "dev": true - }, - "lodash._basecreate": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", - "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", - "dev": true - }, - "lodash._getnative": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", - "dev": true - }, - "lodash._isiterateecall": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", - "dev": true - }, - "lodash.create": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", - "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", - "dev": true - }, - "lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", - "dev": true - }, - "lodash.isarray": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", - "dev": true - }, - "lodash.keys": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", - "dev": true + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } }, "micromatch": { "version": "2.3.11", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + } }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } }, "minimist": { "version": "0.0.8", @@ -489,51 +503,91 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true + "dev": true, + "requires": { + "minimist": "0.0.8" + } }, "mocha": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.4.1.tgz", - "integrity": "sha1-o4ArSqOBk0yss43nDPdxYh2o+a8=", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.0.4.tgz", + "integrity": "sha512-nMOpAPFosU1B4Ix1jdhx5e3q7XO55ic5a8cgYvW27CequcEY+BabS0kUVL1Cw1V5PuVHZWeNRWFLmEPexo79VA==", "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.11.0", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.3", + "he": "1.1.1", + "mkdirp": "0.5.1", + "supports-color": "4.4.0" + }, "dependencies": { - "supports-color": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", - "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", "dev": true + }, + "supports-color": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } } } }, "ms": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", - "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, "normalize-path": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } }, "object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true + "dev": true, + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + } }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true + "dev": true, + "requires": { + "wrappy": "1.0.2" + } }, "parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true + "dev": true, + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + } }, "path-is-absolute": { "version": "1.0.1", @@ -548,23 +602,13 @@ "dev": true }, "pretty-format": { - "version": "21.2.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-21.2.1.tgz", - "integrity": "sha512-ZdWPGYAnYfcVP8yKA3zFjCn8s4/17TeYH28MXuC8vTp0o21eXjbFGcOAXZEaDaOFJjc3h2qa7HQNHNshhvoh2A==", + "version": "22.4.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-22.4.0.tgz", + "integrity": "sha512-pvCxP2iODIIk9adXlo4S3GRj0BrJiil68kByAa1PrgG97c1tClh9dLMgp3Z6cHFZrclaABt0UH8PIhwHuFLqYA==", "dev": true, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", - "dev": true - } + "requires": { + "ansi-regex": "3.0.0", + "ansi-styles": "3.2.1" } }, "randomatic": { @@ -572,18 +616,28 @@ "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, "dependencies": { "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, + "requires": { + "kind-of": "3.2.2" + }, "dependencies": { "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } } } }, @@ -591,7 +645,10 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } } } }, @@ -599,7 +656,10 @@ "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true + "dev": true, + "requires": { + "is-equal-shallow": "0.1.3" + } }, "remove-trailing-separator": { "version": "1.1.0", @@ -625,17 +685,20 @@ "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", "dev": true }, - "strip-ansi": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz", - "integrity": "sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA=", + "stack-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.1.tgz", + "integrity": "sha1-1PM6tU6OOHeLDKXP07OvsS22hiA=", "dev": true }, "supports-color": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz", - "integrity": "sha1-2S3iaU6z9nMjlz1649i1W0wiGQo=", - "dev": true + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } }, "wrappy": { "version": "1.0.2", diff --git a/tests/wpt/web-platform-tests/resources/webidl2/package.json b/tests/wpt/web-platform-tests/resources/webidl2/package.json index d7b8a421241..ab282d189bb 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/package.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/package.json @@ -1,22 +1,24 @@ { "name": "webidl2", "description": "A WebIDL Parser", - "version": "8.1.0", + "version": "10.2.1", "contributors": [ "Robin Berjon <robin@berjon.com> (https://berjon.com)", "Marcos Caceres <marcos@marcosc.com> (https://marcosc.com)", - "Kagami Sascha Rosylight <saschaplas@outlook.com>" + "Kagami Sascha Rosylight <saschaplas@outlook.com>", + "Timothy Gu <timothygu99@gmail.com>" ], "license": "W3C", "dependencies": {}, "devDependencies": { - "expect": "21.2.1", - "jsondiffpatch": "0.2.5", - "mocha": "4.0.1" + "expect": "22.4.0", + "jsondiffpatch": "0.3.5", + "mocha": "5.0.4" }, "scripts": { - "test": "mocha" + "test": "mocha", + "acquire": "node test/util/acquire.js" }, - "repository": "git://github.com/darobin/webidl2.js", + "repository": "git://github.com/w3c/webidl2.js", "main": "index" } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid.js b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid.js index 548f0ea4b3d..19bbf006e57 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid.js +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid.js @@ -4,37 +4,17 @@ "use strict"; -const wp = require("../lib/webidl2"); -const expect = require("expect"); -const pth = require("path"); +const { collect } = require("./util/collect"); const fs = require("fs"); +const expect = require("expect"); describe("Parses all of the invalid IDLs to check that they blow up correctly", () => { - const dir = pth.join(__dirname, "invalid/idl"); - const skip = {}; - const idls = fs.readdirSync(dir) - .filter(it => (/\.w?idl$/).test(it) && !skip[it]) - .map(it => pth.join(dir, it)); - const errors = idls.map(it => pth.join(__dirname, "invalid", "json", pth.basename(it).replace(/\.w?idl/, ".json"))); - - for (let i = 0, n = idls.length; i < n; i++) { - const idl = idls[i]; - const err = JSON.parse(fs.readFileSync(errors[i], "utf8")); - - it(`should produce the right error for ${idl}`, () => { - let error; - try { - var ast = wp.parse(fs.readFileSync(idl, "utf8")); - console.log(JSON.stringify(ast, null, 4)); - } - catch (e) { - error = e; - } - finally { - expect(error).toBeTruthy(); - expect(error.message).toEqual(err.message); - expect(error.line).toEqual(err.line); - } + for (const test of collect("invalid", { expectError: true })) { + it(`should produce the right error for ${test.path}`, () => { + const err = test.readJSON(); + expect(test.error).toBeTruthy(); + expect(test.error.message).toEqual(err.message); + expect(test.error.line).toEqual(err.line); }); } }); diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/idl/iterator.widl b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/iterator.widl index 3bf1b36dec6..3bf1b36dec6 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/idl/iterator.widl +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/iterator.widl diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/no-semicolon-callback.widl b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/no-semicolon-callback.widl new file mode 100644 index 00000000000..cb2055718e5 --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/no-semicolon-callback.widl @@ -0,0 +1,7 @@ +callback interface NoSemicolon { + attribute boolean noSemiColon; +} + +enum YouNeedOne { + "really" +} diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/no-semicolon.widl b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/no-semicolon.widl new file mode 100644 index 00000000000..10bc716249b --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/no-semicolon.widl @@ -0,0 +1,7 @@ +partial interface NoSemicolon { + attribute boolean noSemiColon; +} + +enum YouNeedOne { + "really" +} diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/stray-slash.widl b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/stray-slash.widl new file mode 100644 index 00000000000..b673aa94b01 --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/stray-slash.widl @@ -0,0 +1,2 @@ +// This is a comment. +/ This is not. diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/stringconstants.idl b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/stringconstants.widl index 44fd3ff136e..44fd3ff136e 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/stringconstants.idl +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/idl/stringconstants.widl diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/array.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/array.json index 30b377fc71c..898b2d836bf 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/array.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/array.json @@ -1,4 +1,4 @@ { - "message": "No name in attribute", + "message": "Got an error during or right after parsing `interface LotteryResults`: No name in attribute", "line": 5 -}
\ No newline at end of file +} diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/caller.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/caller.json index 79b8ecac04f..567fa336812 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/caller.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/caller.json @@ -1,4 +1,4 @@ { - "message": "Invalid operation", + "message": "Got an error during or right after parsing `interface NumberQuadrupler`: Invalid operation", "line": 6 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/dict-required-default.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/dict-required-default.json index c5afeca85c0..82b6b2ae42a 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/dict-required-default.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/dict-required-default.json @@ -1,4 +1,4 @@ { - "message": "Required member must not have a default" + "message": "Got an error during or right after parsing `dictionary Dict`: Required member must not have a default" , "line": 4 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/duplicate.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/duplicate.json index cef335875c3..e88a7156fe8 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/duplicate.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/duplicate.json @@ -1,4 +1,4 @@ { - "message": "The name \"Test\" of type \"typedef\" is already seen", + "message": "Got an error during or right after parsing `typedef Test`: The name \"Test\" of type \"typedef\" is already seen", "line": 3 -}
\ No newline at end of file +} diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/enum.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/enum.json index 166115801c3..073ff6c290c 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/enum.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/enum.json @@ -1,4 +1,4 @@ { - "message": "Unexpected value in enum" + "message": "Got an error during or right after parsing `enum foo`: Unexpected value in enum" , "line": 1 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/exception.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/exception.json index f52cda13837..ad9fac6ca2f 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/exception.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/exception.json @@ -1,4 +1,4 @@ { - "message": "Unrecognised tokens", + "message": "Got an error before parsing any named definition: Unrecognised tokens", "line": 4 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/iterator.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/iterator.json new file mode 100644 index 00000000000..e46d653ae3c --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/iterator.json @@ -0,0 +1,4 @@ +{ + "message": "Got an error during or right after parsing `interface SessionManager`: Invalid operation", + "line": 5 +} diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/maplike-1type.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/maplike-1type.json index 859a820a491..75e7a35ee25 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/maplike-1type.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/maplike-1type.json @@ -1,4 +1,4 @@ { - "message": "Missing second type argument in maplike declaration", + "message": "Got an error during or right after parsing `interface MapLikeOneType`: Missing second type argument in maplike declaration", "line": 2 -}
\ No newline at end of file +} diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/module.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/module.json index 3b0984d973f..9c071cdd07a 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/module.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/module.json @@ -1,4 +1,4 @@ { - "message": "Unrecognised tokens" + "message": "Got an error before parsing any named definition: Unrecognised tokens" , "line": 2 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/no-semicolon-callback.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/no-semicolon-callback.json new file mode 100644 index 00000000000..1db9d14c8e2 --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/no-semicolon-callback.json @@ -0,0 +1,4 @@ +{ + "message": "Got an error during or right after parsing `callback interface NoSemicolon`: Missing semicolon after interface", + "line": 5 +} diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/no-semicolon.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/no-semicolon.json new file mode 100644 index 00000000000..087532a012f --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/no-semicolon.json @@ -0,0 +1,4 @@ +{ + "message": "Got an error during or right after parsing `partial interface NoSemicolon`: Missing semicolon after interface", + "line": 5 +} diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/nonnullableany.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/nonnullableany.json index cf5229e8e44..8a1f90046ae 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/nonnullableany.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/nonnullableany.json @@ -1,4 +1,4 @@ { - "message": "Type any cannot be made nullable" + "message": "Got an error during or right after parsing `interface NonNullable`: Type any cannot be made nullable" , "line": 2 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/nonnullableobjects.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/nonnullableobjects.json index 23cbb3e5d18..52bd8dac16f 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/nonnullableobjects.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/nonnullableobjects.json @@ -1,4 +1,4 @@ { - "message": "Can't nullable more than once" + "message": "Got an error during or right after parsing `interface NonNullable`: Can't nullable more than once" , "line": 4 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/promise-with-extended-attribute.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/promise-with-extended-attribute.json index e9623ce7cc8..71212d46e3c 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/promise-with-extended-attribute.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/promise-with-extended-attribute.json @@ -1,4 +1,4 @@ { - "message": "Promise type cannot have extended attribute", + "message": "Got an error during or right after parsing `interface Foo`: Promise type cannot have extended attribute", "line": 2 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/raises.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/raises.json index 8b67afe4fc9..3165b874f0c 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/raises.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/raises.json @@ -1,4 +1,4 @@ { - "message": "Unterminated attribute" + "message": "Got an error during or right after parsing `interface Person`: Unterminated attribute" , "line": 5 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/readonly-iterable.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/readonly-iterable.json index c6f52a24615..1a09264a6d0 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/readonly-iterable.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/readonly-iterable.json @@ -1,4 +1,4 @@ { - "message": "Invalid operation", + "message": "Got an error during or right after parsing `interface ReadonlyIterable`: Invalid operation", "line": 2 -}
\ No newline at end of file +} diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/record-key-with-extended-attribute.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/record-key-with-extended-attribute.json index 3945825c318..4002e7fe015 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/record-key-with-extended-attribute.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/record-key-with-extended-attribute.json @@ -1,4 +1,4 @@ { - "message": "Record key cannot have extended attribute", + "message": "Got an error during or right after parsing `interface Foo`: Record key cannot have extended attribute", "line": 2 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/record-key.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/record-key.json index 3b929b926a3..179d645d6a7 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/record-key.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/record-key.json @@ -1,4 +1,4 @@ { - "message": "Record key must be DOMString, USVString, or ByteString", + "message": "Got an error during or right after parsing `interface Foo`: Record key must be DOMString, USVString, or ByteString", "line": 2 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/scopedname.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/scopedname.json index 8e2cd803287..4620d2df5fa 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/scopedname.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/scopedname.json @@ -1,4 +1,4 @@ { - "message": "No name in typedef" + "message": "Got an error before parsing any named definition: No name in typedef" , "line": 2 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/sequenceAsAttribute.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/sequenceAsAttribute.json index b714f5d9243..5b4314a6de1 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/sequenceAsAttribute.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/sequenceAsAttribute.json @@ -1,4 +1,4 @@ { - "message": "Attributes cannot accept sequence types" + "message": "Got an error during or right after parsing `interface sequenceAsAttribute`: Attributes cannot accept sequence types" , "line": 2 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/setlike-2types.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/setlike-2types.json index c9e49b6756d..2900e1bac30 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/setlike-2types.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/setlike-2types.json @@ -1,4 +1,4 @@ { - "message": "Unterminated setlike declaration", + "message": "Got an error during or right after parsing `interface SetLikeTwoTypes`: Unterminated setlike declaration", "line": 2 -}
\ No newline at end of file +} diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/setter-creator.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/setter-creator.json index 07b9f1f4bc4..25decb374e1 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/setter-creator.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/setter-creator.json @@ -1,4 +1,4 @@ { - "message": "Invalid operation", + "message": "Got an error during or right after parsing `interface OrderedMap`: Invalid operation", "line": 3 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/special-omittable.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/special-omittable.json index 7acb08834b0..c20b28e03c1 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/special-omittable.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/special-omittable.json @@ -1,4 +1,4 @@ { - "message": "Invalid operation" + "message": "Got an error during or right after parsing `interface Dictionary`: Invalid operation" , "line": 6 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/stray-slash.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/stray-slash.json new file mode 100644 index 00000000000..9c071cdd07a --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/stray-slash.json @@ -0,0 +1,4 @@ +{ + "message": "Got an error before parsing any named definition: Unrecognised tokens" +, "line": 2 +} diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/stringconstants.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/stringconstants.json index d5bf1a8832c..1eeb31cd3ef 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/stringconstants.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/stringconstants.json @@ -1,4 +1,4 @@ { - "message": "No value for const" + "message": "Got an error during or right after parsing `interface Util`: No value for const" , "line": 2 } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/typedef-nested.json b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/typedef-nested.json index d7fb9182f86..8c608149685 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/typedef-nested.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/invalid/json/typedef-nested.json @@ -1,4 +1,4 @@ { - "message": "Invalid operation" + "message": "Got an error during or right after parsing `interface Widget`: Invalid operation" , "line": 14 -}
\ No newline at end of file +} diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax.js b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax.js index 0838f350cd9..05d647eda10 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax.js +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax.js @@ -1,34 +1,14 @@ "use strict"; -const wp = require("../lib/webidl2"); +const { collect } = require("./util/collect"); const expect = require("expect"); -const pth = require("path"); -const fs = require("fs"); -const jdp = require("jsondiffpatch"); const debug = true; describe("Parses all of the IDLs to produce the correct ASTs", () => { - const dir = pth.join(__dirname, "syntax/idl"); - const skip = {}; // use if we have a broken test - const idls = fs.readdirSync(dir) - .filter(it => (/\.widl$/).test(it) && !skip[it]) - .map(it => pth.join(dir, it)); - const jsons = idls.map(it => pth.join(__dirname, "syntax/json", pth.basename(it).replace(".widl", ".json"))); - - for (let i = 0, n = idls.length; i < n; i++) { - const idl = idls[i]; - const json = jsons[i]; - - it(`should produce the same AST for ${idl}`, () => { + for (const test of collect("syntax")) { + it(`should produce the same AST for ${test.path}`, () => { try { - const optFile = pth.join(__dirname, "syntax/opt", pth.basename(json)); - let opt = undefined; - if (fs.existsSync(optFile)) - opt = JSON.parse(fs.readFileSync(optFile, "utf8")); - const diff = jdp.diff(JSON.parse(fs.readFileSync(json, "utf8")), - wp.parse(fs.readFileSync(idl, "utf8").replace(/\r\n/g, "\n"), opt)); - if (diff && debug) console.log(JSON.stringify(diff, null, 4)); - expect(diff).toBe(undefined); + expect(test.diff()).toBeFalsy(); } catch (e) { console.log(e.toString()); diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/idl/extended-attributes.widl b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/idl/extended-attributes.widl index a49463b3d76..57d4f97de7c 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/idl/extended-attributes.widl +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/idl/extended-attributes.widl @@ -20,4 +20,10 @@ interface Circle { attribute double cx; attribute double cy; readonly attribute double circumference; -};
\ No newline at end of file +}; + +// Extracted from https://heycam.github.io/webidl/#idl-annotated-types on 2017-12-15 +[Exposed=Window] +interface I { + attribute [XAttr] (long or Node) attrib; +}; diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/idl/typedef-union.idl b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/idl/typedef-union.widl index 3048703e0c5..3048703e0c5 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/idl/typedef-union.idl +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/idl/typedef-union.widl diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/allowany.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/allowany.json index ee898d68296..cd5c6e00ac3 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/allowany.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/allowany.json @@ -12,6 +12,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -30,6 +31,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -43,6 +45,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -62,6 +65,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -82,6 +86,7 @@ } ], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/attributes.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/attributes.json index 86fe9d52dec..c90c70d7edc 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/attributes.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/attributes.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -24,4 +25,4 @@ "inheritance": null, "extAttrs": [] } -]
\ No newline at end of file +] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/callback.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/callback.json index 5301c40d754..f31067dd25c 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/callback.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/callback.json @@ -3,6 +3,7 @@ "type": "callback", "name": "AsyncOperationCallback", "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -15,6 +16,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -39,6 +41,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -52,6 +55,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -71,6 +75,7 @@ "type": "callback", "name": "SortCallback", "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -83,6 +88,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -96,6 +102,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/constants.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/constants.json index 75222866443..4b98751622c 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/constants.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/constants.json @@ -7,7 +7,10 @@ { "type": "const", "nullable": false, - "idlType": "boolean", + "idlType": { + "type": "const-type", + "idlType": "boolean" + }, "name": "DEBUG", "value": { "type": "boolean", @@ -18,7 +21,10 @@ { "type": "const", "nullable": false, - "idlType": "short", + "idlType": { + "type": "const-type", + "idlType": "short" + }, "name": "negative", "value": { "type": "number", @@ -29,7 +35,10 @@ { "type": "const", "nullable": false, - "idlType": "octet", + "idlType": { + "type": "const-type", + "idlType": "octet" + }, "name": "LF", "value": { "type": "number", @@ -40,7 +49,10 @@ { "type": "const", "nullable": false, - "idlType": "unsigned long", + "idlType": { + "type": "const-type", + "idlType": "unsigned long" + }, "name": "BIT_MASK", "value": { "type": "number", @@ -51,7 +63,10 @@ { "type": "const", "nullable": false, - "idlType": "float", + "idlType": { + "type": "const-type", + "idlType": "float" + }, "name": "AVOGADRO", "value": { "type": "number", @@ -62,7 +77,10 @@ { "type": "const", "nullable": false, - "idlType": "unrestricted float", + "idlType": { + "type": "const-type", + "idlType": "unrestricted float" + }, "name": "sobig", "value": { "type": "Infinity", @@ -73,7 +91,10 @@ { "type": "const", "nullable": false, - "idlType": "unrestricted double", + "idlType": { + "type": "const-type", + "idlType": "unrestricted double" + }, "name": "minusonedividedbyzero", "value": { "type": "Infinity", @@ -84,7 +105,10 @@ { "type": "const", "nullable": false, - "idlType": "short", + "idlType": { + "type": "const-type", + "idlType": "short" + }, "name": "notanumber", "value": { "type": "NaN" @@ -95,4 +119,4 @@ "inheritance": null, "extAttrs": [] } -]
\ No newline at end of file +] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/constructor.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/constructor.json index ee55ef03e14..292236f291b 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/constructor.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/constructor.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -27,6 +28,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -43,6 +45,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -59,6 +62,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -85,6 +89,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/dictionary-inherits.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/dictionary-inherits.json index ef30b1ab76d..9b928f4f0a6 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/dictionary-inherits.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/dictionary-inherits.json @@ -9,6 +9,7 @@ "name": "fillPattern", "required": false, "idlType": { + "type": "dictionary-type", "sequence": false, "generic": null, "nullable": true, @@ -26,6 +27,7 @@ "name": "strokePattern", "required": false, "idlType": { + "type": "dictionary-type", "sequence": false, "generic": null, "nullable": true, @@ -42,6 +44,7 @@ "name": "position", "required": false, "idlType": { + "type": "dictionary-type", "sequence": false, "generic": null, "nullable": false, @@ -64,6 +67,7 @@ "name": "hydrometry", "required": false, "idlType": { + "type": "dictionary-type", "sequence": false, "generic": null, "nullable": false, @@ -76,4 +80,4 @@ "inheritance": "PaintOptions", "extAttrs": [] } -]
\ No newline at end of file +] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/dictionary.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/dictionary.json index 28494ce437c..f74fedc3d35 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/dictionary.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/dictionary.json @@ -9,6 +9,7 @@ "name": "fillPattern", "required": false, "idlType": { + "type": "dictionary-type", "sequence": false, "generic": null, "nullable": true, @@ -26,6 +27,7 @@ "name": "strokePattern", "required": false, "idlType": { + "type": "dictionary-type", "sequence": false, "generic": null, "nullable": true, @@ -42,6 +44,7 @@ "name": "position", "required": false, "idlType": { + "type": "dictionary-type", "sequence": false, "generic": null, "nullable": false, @@ -55,11 +58,13 @@ "name": "seq", "required": false, "idlType": { + "type": "dictionary-type", "sequence": true, "generic": "sequence", "nullable": false, "union": false, "idlType": { + "type": "dictionary-type", "sequence": false, "generic": null, "nullable": false, @@ -78,6 +83,7 @@ "name": "reqSeq", "required": true, "idlType": { + "type": "dictionary-type", "sequence": false, "generic": null, "nullable": false, @@ -100,6 +106,7 @@ "name": "h", "required": false, "idlType": { + "type": "dictionary-type", "sequence": false, "generic": null, "nullable": false, @@ -113,6 +120,7 @@ "name": "d", "required": false, "idlType": { + "type": "dictionary-type", "sequence": false, "generic": null, "nullable": false, @@ -124,4 +132,4 @@ ], "extAttrs": [] } -]
\ No newline at end of file +] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/documentation-dos.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/documentation-dos.json index 340e039b449..baa0b5a09b5 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/documentation-dos.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/documentation-dos.json @@ -7,4 +7,4 @@ "inheritance": null, "extAttrs": [] } -]
\ No newline at end of file +] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/documentation.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/documentation.json index 340e039b449..baa0b5a09b5 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/documentation.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/documentation.json @@ -7,4 +7,4 @@ "inheritance": null, "extAttrs": [] } -]
\ No newline at end of file +] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/enum.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/enum.json index 88a608ba632..29d1c865b68 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/enum.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/enum.json @@ -3,9 +3,18 @@ "type": "enum", "name": "MealType", "values": [ - { "type": "string", "value": "rice" }, - { "type": "string", "value": "noodles" }, - { "type": "string", "value": "other" } + { + "type": "string", + "value": "rice" + }, + { + "type": "string", + "value": "noodles" + }, + { + "type": "string", + "value": "other" + } ], "extAttrs": [] }, @@ -21,6 +30,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -37,6 +47,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -54,6 +65,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -67,6 +79,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -80,6 +93,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -99,9 +113,18 @@ "type": "enum", "name": "AltMealType", "values": [ - { "type": "string", "value": "rice" }, - { "type": "string", "value": "noodles" }, - { "type": "string", "value": "other" } + { + "type": "string", + "value": "rice" + }, + { + "type": "string", + "value": "noodles" + }, + { + "type": "string", + "value": "other" + } ], "extAttrs": [] } diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/equivalent-decl.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/equivalent-decl.json index 7ef08bc595f..de8d4dbc70b 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/equivalent-decl.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/equivalent-decl.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -28,6 +29,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -41,6 +43,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -60,6 +63,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -73,6 +77,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -86,6 +91,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -113,6 +119,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -130,6 +137,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -143,6 +151,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -162,6 +171,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -175,6 +185,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -188,6 +199,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -207,6 +219,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -220,6 +233,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -239,6 +253,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -252,6 +267,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -265,6 +281,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/extended-attributes.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/extended-attributes.json index 6526e2a3599..e0dc2360f3a 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/extended-attributes.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/extended-attributes.json @@ -30,139 +30,205 @@ ] }, { - "type": "interface", - "name": "IdInterface", - "partial": false, - "members": [], - "inheritance": null, - "extAttrs": [ - { - "name": "IntAttr", - "arguments": null, - "type": "extended-attribute", - "rhs": { - "type": "integer", - "value": "0" - } - }, - { - "name": "FloatAttr", - "arguments": null, - "type": "extended-attribute", - "rhs": { - "type": "float", - "value": "3.14" - } - }, - { - "name": "StringAttr", - "arguments": null, - "type": "extended-attribute", - "rhs": { - "type": "string", - "value": "\"abc\"" - } - } - ] + "type": "interface", + "name": "IdInterface", + "partial": false, + "members": [], + "inheritance": null, + "extAttrs": [ + { + "name": "IntAttr", + "arguments": null, + "type": "extended-attribute", + "rhs": { + "type": "integer", + "value": "0" + } + }, + { + "name": "FloatAttr", + "arguments": null, + "type": "extended-attribute", + "rhs": { + "type": "float", + "value": "3.14" + } + }, + { + "name": "StringAttr", + "arguments": null, + "type": "extended-attribute", + "rhs": { + "type": "string", + "value": "\"abc\"" + } + } + ] }, { - "type": "interface", - "name": "Circle", - "partial": false, - "members": [ - { - "type": "attribute", - "static": false, - "stringifier": false, - "inherit": false, - "readonly": false, - "idlType": { - "sequence": false, - "generic": null, - "nullable": false, - "union": false, - "idlType": "double" - }, - "name": "r", - "extAttrs": [] - }, - { - "type": "attribute", - "static": false, - "stringifier": false, - "inherit": false, - "readonly": false, - "idlType": { - "sequence": false, - "generic": null, - "nullable": false, - "union": false, - "idlType": "double" - }, - "name": "cx", - "extAttrs": [] - }, - { - "type": "attribute", - "static": false, - "stringifier": false, - "inherit": false, - "readonly": false, - "idlType": { - "sequence": false, - "generic": null, - "nullable": false, - "union": false, - "idlType": "double" - }, - "name": "cy", - "extAttrs": [] - }, - { - "type": "attribute", - "static": false, - "stringifier": false, - "inherit": false, - "readonly": true, - "idlType": { - "sequence": false, - "generic": null, - "nullable": false, - "union": false, - "idlType": "double" - }, - "name": "circumference", - "extAttrs": [] - } - ], - "inheritance": null, - "extAttrs": [ - { - "name": "Constructor", - "arguments": null, - "type": "extended-attribute", - "rhs": null - }, - { - "name": "Constructor", - "arguments": [ + "type": "interface", + "name": "Circle", + "partial": false, + "members": [ + { + "type": "attribute", + "static": false, + "stringifier": false, + "inherit": false, + "readonly": false, + "idlType": { + "type": "attribute-type", + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "double" + }, + "name": "r", + "extAttrs": [] + }, + { + "type": "attribute", + "static": false, + "stringifier": false, + "inherit": false, + "readonly": false, + "idlType": { + "type": "attribute-type", + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "double" + }, + "name": "cx", + "extAttrs": [] + }, { - "optional": false, - "variadic": false, - "extAttrs": [], - "idlType": { - "sequence": false, - "generic": null, - "nullable": false, - "union": false, - "idlType": "double" - }, - "name": "radius" + "type": "attribute", + "static": false, + "stringifier": false, + "inherit": false, + "readonly": false, + "idlType": { + "type": "attribute-type", + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "double" + }, + "name": "cy", + "extAttrs": [] + }, + { + "type": "attribute", + "static": false, + "stringifier": false, + "inherit": false, + "readonly": true, + "idlType": { + "type": "attribute-type", + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "double" + }, + "name": "circumference", + "extAttrs": [] + } + ], + "inheritance": null, + "extAttrs": [ + { + "name": "Constructor", + "arguments": null, + "type": "extended-attribute", + "rhs": null + }, + { + "name": "Constructor", + "arguments": [ + { + "optional": false, + "variadic": false, + "extAttrs": [], + "idlType": { + "type": "argument-type", + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "double" + }, + "name": "radius" + } + ], + "type": "extended-attribute", + "rhs": null + } + ] + }, + { + "type": "interface", + "name": "I", + "partial": false, + "members": [ + { + "type": "attribute", + "static": false, + "stringifier": false, + "inherit": false, + "readonly": false, + "idlType": { + "type": "attribute-type", + "sequence": false, + "generic": null, + "nullable": false, + "union": true, + "idlType": [ + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "long" + }, + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "Node" + } + ], + "extAttrs": [ + { + "name": "XAttr", + "arguments": null, + "type": "extended-attribute", + "rhs": null + } + ] + }, + "name": "attrib", + "extAttrs": [] + } + ], + "inheritance": null, + "extAttrs": [ + { + "name": "Exposed", + "arguments": null, + "type": "extended-attribute", + "rhs": { + "type": "identifier", + "value": "Window" + } } - ], - "type": "extended-attribute", - "rhs": null - } - ] + ] } ] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/generic.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/generic.json index 214ddd8e994..62593859fb1 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/generic.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/generic.json @@ -12,21 +12,25 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": "Promise", "nullable": false, "union": false, "idlType": { + "type": "return-type", "sequence": false, "generic": "ResponsePromise", "nullable": false, "union": false, "idlType": { + "type": "return-type", "sequence": true, "generic": "sequence", "nullable": false, "union": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": true, @@ -47,11 +51,13 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": "Promise", "nullable": false, "union": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -79,11 +85,13 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": "Promise", "nullable": false, "union": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": true, @@ -103,11 +111,13 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": "Promise", "nullable": false, "union": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -136,11 +146,13 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": "ResponsePromise", "nullable": false, "union": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/getter-setter.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/getter-setter.json index 6268a532d55..1213307f203 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/getter-setter.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/getter-setter.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -28,6 +29,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -41,6 +43,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -60,6 +63,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -73,6 +77,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -86,6 +91,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/identifier-qualified-names.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/identifier-qualified-names.json index 11568f8cfd8..f4e295acd3e 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/identifier-qualified-names.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/identifier-qualified-names.json @@ -2,6 +2,7 @@ { "type": "typedef", "idlType": { + "type": "typedef-type", "sequence": false, "generic": null, "nullable": false, @@ -24,6 +25,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -37,6 +39,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -56,6 +59,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -69,6 +73,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -96,6 +101,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -112,6 +118,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": true, @@ -138,6 +145,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -151,6 +159,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/implements.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/implements.json index fba05427808..69879d94f55 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/implements.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/implements.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -37,6 +38,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -50,6 +52,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -63,6 +66,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -76,6 +80,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/indexed-properties.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/indexed-properties.json index 2676c0efab3..697b595546c 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/indexed-properties.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/indexed-properties.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -28,6 +29,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -41,6 +43,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -60,6 +63,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -73,6 +77,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -86,6 +91,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -105,6 +111,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -118,6 +125,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -137,6 +145,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -150,6 +159,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -169,6 +179,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -182,6 +193,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -195,6 +207,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -214,6 +227,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -227,6 +241,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/inherits-getter.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/inherits-getter.json index ba6bafdf391..818d8b6c16f 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/inherits-getter.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/inherits-getter.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -36,6 +37,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -52,6 +54,7 @@ "inherit": true, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -65,4 +68,4 @@ "inheritance": "Animal", "extAttrs": [] } -]
\ No newline at end of file +] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/interface-inherits.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/interface-inherits.json index e78c1cce865..74a4c39bb0f 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/interface-inherits.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/interface-inherits.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -36,6 +37,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -61,6 +63,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -74,4 +77,4 @@ "inheritance": "Animal", "extAttrs": [] } -]
\ No newline at end of file +] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/iterable.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/iterable.json index 1e92307dad5..7126a4ea2b0 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/iterable.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/iterable.json @@ -6,13 +6,16 @@ "members": [ { "type": "iterable", - "idlType": { - "sequence": false, - "generic": null, - "nullable": false, - "union": false, - "idlType": "long" - }, + "idlType": [ + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "long" + } + ], "extAttrs": [] } ], @@ -28,6 +31,7 @@ "type": "iterable", "idlType": [ { + "type": null, "sequence": false, "generic": null, "nullable": false, @@ -35,6 +39,7 @@ "idlType": "short" }, { + "type": null, "sequence": false, "generic": null, "nullable": true, @@ -55,21 +60,24 @@ "members": [ { "type": "iterable", - "idlType": { - "sequence": false, - "generic": null, - "nullable": false, - "union": false, - "idlType": "long", - "extAttrs": [ - { - "name": "XAttr", - "arguments": null, - "type": "extended-attribute", - "rhs": null - } - ] - }, + "idlType": [ + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "long", + "extAttrs": [ + { + "name": "XAttr", + "arguments": null, + "type": "extended-attribute", + "rhs": null + } + ] + } + ], "extAttrs": [] } ], @@ -77,4 +85,3 @@ "extAttrs": [] } ] - diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/legacyiterable.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/legacyiterable.json index 059ccc11312..5a1e526b50a 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/legacyiterable.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/legacyiterable.json @@ -6,13 +6,16 @@ "members": [ { "type": "legacyiterable", - "idlType": { - "sequence": false, - "generic": null, - "nullable": false, - "union": false, - "idlType": "long" - }, + "idlType": [ + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "long" + } + ], "extAttrs": [] } ], @@ -20,4 +23,3 @@ "extAttrs": [] } ] - diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/maplike.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/maplike.json index 97e76d5841a..b86e10487c1 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/maplike.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/maplike.json @@ -8,6 +8,7 @@ "type": "maplike", "idlType": [ { + "type": null, "sequence": false, "generic": null, "nullable": false, @@ -15,6 +16,7 @@ "idlType": "long" }, { + "type": null, "sequence": false, "generic": null, "nullable": false, @@ -38,6 +40,7 @@ "type": "maplike", "idlType": [ { + "type": null, "sequence": false, "generic": null, "nullable": false, @@ -45,6 +48,7 @@ "idlType": "long" }, { + "type": null, "sequence": false, "generic": null, "nullable": false, @@ -68,6 +72,7 @@ "type": "maplike", "idlType": [ { + "type": null, "sequence": false, "generic": null, "nullable": false, @@ -83,6 +88,7 @@ ] }, { + "type": null, "sequence": false, "generic": null, "nullable": false, @@ -106,4 +112,3 @@ "extAttrs": [] } ] - diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/mixin.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/mixin.json index a2afae318dc..f0458e2b084 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/mixin.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/mixin.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -47,6 +48,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/namedconstructor.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/namedconstructor.json index cee163069d1..f895461d15e 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/namedconstructor.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/namedconstructor.json @@ -23,6 +23,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -40,4 +41,4 @@ } ] } -]
\ No newline at end of file +] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/namespace.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/namespace.json index 8ee7796553e..0611b710bf1 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/namespace.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/namespace.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -28,6 +29,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -41,6 +43,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -54,6 +57,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -73,6 +77,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -86,6 +91,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -99,6 +105,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/nointerfaceobject.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/nointerfaceobject.json index 85987e82de3..03bb99442d5 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/nointerfaceobject.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/nointerfaceobject.json @@ -12,6 +12,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -25,6 +26,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/nullable.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/nullable.json index 2c83c3dad58..ae4d2aa5375 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/nullable.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/nullable.json @@ -7,7 +7,10 @@ { "type": "const", "nullable": true, - "idlType": "boolean", + "idlType": { + "type": "const-type", + "idlType": "boolean" + }, "name": "ARE_WE_THERE_YET", "value": { "type": "boolean", @@ -31,6 +34,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": true, @@ -44,4 +48,4 @@ "inheritance": null, "extAttrs": [] } -]
\ No newline at end of file +] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/nullableobjects.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/nullableobjects.json index 2c875607262..29d1314f168 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/nullableobjects.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/nullableobjects.json @@ -28,6 +28,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -41,6 +42,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": true, @@ -60,6 +62,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -73,6 +76,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": true, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/operation-optional-arg.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/operation-optional-arg.json index 7588d63475f..44c3a16dc2e 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/operation-optional-arg.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/operation-optional-arg.json @@ -12,6 +12,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -25,6 +26,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -38,6 +40,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -51,6 +54,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -64,6 +68,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/overloading.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/overloading.json index 8d7e8e286cb..87169e9202b 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/overloading.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/overloading.json @@ -28,6 +28,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -41,6 +42,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -60,6 +62,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -73,6 +76,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -101,6 +105,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -114,6 +119,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -133,6 +139,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -153,6 +160,7 @@ } ], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -166,6 +174,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -179,6 +188,7 @@ "variadic": true, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -198,6 +208,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -216,6 +227,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -229,6 +241,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -242,6 +255,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -255,6 +269,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -268,6 +283,7 @@ "variadic": true, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/overridebuiltins.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/overridebuiltins.json index 4ded17c3103..d63f8f74411 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/overridebuiltins.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/overridebuiltins.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -28,6 +29,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -41,6 +43,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/partial-interface.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/partial-interface.json index e95af2baa15..c16c64d334d 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/partial-interface.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/partial-interface.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -36,6 +37,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -48,4 +50,4 @@ ], "extAttrs": [] } -]
\ No newline at end of file +] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/primitives.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/primitives.json index 7568542f957..cf965399a4f 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/primitives.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/primitives.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -27,6 +28,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -43,6 +45,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -59,6 +62,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -75,6 +79,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -91,6 +96,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -107,6 +113,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -123,6 +130,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -139,6 +147,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -155,6 +164,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -171,6 +181,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -187,6 +198,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -203,6 +215,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -219,6 +232,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -235,6 +249,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -251,6 +266,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -267,6 +283,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -280,4 +297,4 @@ "inheritance": null, "extAttrs": [] } -]
\ No newline at end of file +] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/prototyperoot.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/prototyperoot.json index c75f00ed3e8..eda7f14dae4 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/prototyperoot.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/prototyperoot.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/putforwards.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/putforwards.json index 1b0a7b6b974..4b809d2d34d 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/putforwards.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/putforwards.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -37,6 +38,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -50,4 +52,4 @@ "inheritance": null, "extAttrs": [] } -]
\ No newline at end of file +] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/record.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/record.json index 339ae08a39f..dd00b5df045 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/record.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/record.json @@ -12,6 +12,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -25,17 +26,20 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": true, "generic": "sequence", "nullable": false, "union": false, "idlType": { + "type": "argument-type", "sequence": false, "generic": "record", "nullable": false, "union": false, "idlType": [ { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -43,6 +47,7 @@ "idlType": "ByteString" }, { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -65,12 +70,14 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": "record", "nullable": false, "union": false, "idlType": [ { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -78,12 +85,14 @@ "idlType": "DOMString" }, { + "type": "return-type", "sequence": false, "generic": null, "nullable": true, "union": true, "idlType": [ { + "type": null, "sequence": false, "generic": null, "nullable": false, @@ -91,6 +100,7 @@ "idlType": "float" }, { + "type": null, "sequence": false, "generic": null, "nullable": false, @@ -113,6 +123,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -134,12 +145,14 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": "record", "nullable": false, "union": false, "idlType": [ { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -147,6 +160,7 @@ "idlType": "USVString" }, { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -176,12 +190,14 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": "record", "nullable": false, "union": false, "idlType": [ { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -189,6 +205,7 @@ "idlType": "DOMString" }, { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/reg-operations.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/reg-operations.json index c1c13c74f1b..d696e907e0c 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/reg-operations.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/reg-operations.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -27,6 +28,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -53,6 +55,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -71,6 +74,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -84,6 +88,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -103,6 +108,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -116,6 +122,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -129,6 +136,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/replaceable.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/replaceable.json index f53009b4baa..a10b0bfd03b 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/replaceable.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/replaceable.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -35,6 +36,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/sequence.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/sequence.json index 79821181a19..c2d1765bfa5 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/sequence.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/sequence.json @@ -12,6 +12,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -25,11 +26,13 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": true, "generic": "sequence", "nullable": false, "union": false, "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -50,11 +53,13 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": true, "generic": "sequence", "nullable": false, "union": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -75,7 +80,6 @@ "name": "Foo", "partial": false, "members": [ - { "type": "operation", "getter": false, @@ -84,6 +88,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -98,7 +103,6 @@ "inheritance": null, "extAttrs": [] }, - { "type": "interface", "name": "I", @@ -112,6 +116,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -125,11 +130,13 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": true, "generic": "sequence", "nullable": false, "union": false, "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/setlike.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/setlike.json index 3c1591b2372..12299a7ee04 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/setlike.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/setlike.json @@ -6,13 +6,16 @@ "members": [ { "type": "setlike", - "idlType": { - "sequence": false, - "generic": null, - "nullable": false, - "union": false, - "idlType": "long" - }, + "idlType": [ + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "long" + } + ], "readonly": false, "extAttrs": [] } @@ -27,13 +30,16 @@ "members": [ { "type": "setlike", - "idlType": { - "sequence": false, - "generic": null, - "nullable": false, - "union": false, - "idlType": "long" - }, + "idlType": [ + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "long" + } + ], "readonly": true, "extAttrs": [] } @@ -48,21 +54,24 @@ "members": [ { "type": "setlike", - "idlType": { - "sequence": false, - "generic": null, - "nullable": false, - "union": false, - "idlType": "long", - "extAttrs": [ - { - "name": "XAttr", - "arguments": null, - "type": "extended-attribute", - "rhs": null - } - ] - }, + "idlType": [ + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "long", + "extAttrs": [ + { + "name": "XAttr", + "arguments": null, + "type": "extended-attribute", + "rhs": null + } + ] + } + ], "readonly": false, "extAttrs": [] } @@ -71,4 +80,3 @@ "extAttrs": [] } ] - diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/static.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/static.json index 034ffda2d54..0951b2acf5f 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/static.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/static.json @@ -19,6 +19,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -35,6 +36,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -51,6 +53,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -67,6 +70,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -84,6 +88,7 @@ "static": true, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -97,6 +102,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -110,6 +116,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -123,6 +130,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/stringifier-attribute.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/stringifier-attribute.json index acb26c2dda8..36e2b6d50ac 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/stringifier-attribute.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/stringifier-attribute.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -27,6 +28,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/stringifier-custom.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/stringifier-custom.json index 3c84305d863..3dc3ac1758c 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/stringifier-custom.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/stringifier-custom.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -27,6 +28,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": true, @@ -43,6 +45,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -60,6 +63,7 @@ "static": false, "stringifier": true, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/stringifier.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/stringifier.json index 6b2d133d96f..1a702765b0a 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/stringifier.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/stringifier.json @@ -12,6 +12,7 @@ "static": false, "stringifier": true, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/treatasnull.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/treatasnull.json index 03dec604fb4..611d9741043 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/treatasnull.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/treatasnull.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -27,6 +28,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -44,6 +46,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -67,6 +70,7 @@ } ], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/treatasundefined.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/treatasundefined.json index 8699b73c8f2..258acdabd85 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/treatasundefined.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/treatasundefined.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -27,6 +28,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -44,6 +46,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -67,6 +70,7 @@ } ], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/typedef-union.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/typedef-union.json index 9c87672c8ae..06735a80791 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/typedef-union.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/typedef-union.json @@ -1,49 +1,48 @@ [ - { - "type" : "typedef", - "idlType" : { - "nullable" : false, - "generic" : null, - "union" : true, - "idlType" : [ - { - "union" : false, - "generic" : null, - "nullable" : false, - "array" : false, - "sequence" : false, - "idlType" : "ImageData" - }, - { - "generic" : null, - "union" : false, - "nullable" : false, - "array" : false, - "idlType" : "HTMLImageElement", - "sequence" : false - }, - { - "array" : false, - "sequence" : false, - "idlType" : "HTMLCanvasElement", - "generic" : null, - "union" : false, - "nullable" : false - }, - { - "union" : false, - "generic" : null, - "nullable" : false, - "array" : false, - "sequence" : false, - "idlType" : "HTMLVideoElement" - } - ], - "sequence" : false, - "array" : false - }, - "name" : "TexImageSource", - "extAttrs" : [], - "typeExtAttrs" : [] - } + { + "type": "typedef", + "idlType": { + "type": "typedef-type", + "sequence": false, + "generic": null, + "nullable": false, + "union": true, + "idlType": [ + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "ImageData" + }, + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "HTMLImageElement" + }, + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "HTMLCanvasElement" + }, + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "HTMLVideoElement" + } + ] + }, + "name": "TexImageSource", + "extAttrs": [] + } ] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/typedef.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/typedef.json index 612cfe727d9..5e9715da8fb 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/typedef.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/typedef.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -27,6 +28,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -43,11 +45,13 @@ { "type": "typedef", "idlType": { + "type": "typedef-type", "sequence": true, "generic": "sequence", "nullable": false, "union": false, "idlType": { + "type": "typedef-type", "sequence": false, "generic": null, "nullable": false, @@ -70,6 +74,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -86,6 +91,7 @@ "inherit": false, "readonly": false, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -111,6 +117,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -128,6 +135,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -141,6 +149,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -160,6 +169,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -173,6 +183,7 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -191,6 +202,7 @@ { "type": "typedef", "idlType": { + "type": "typedef-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/typesuffixes.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/typesuffixes.json index 0b30830a158..be0b1f22682 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/typesuffixes.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/typesuffixes.json @@ -12,6 +12,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -25,11 +26,13 @@ "variadic": false, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": true, "generic": "sequence", "nullable": true, "union": false, "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": true, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/uniontype.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/uniontype.json index c4725d417b5..87735c7fb63 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/uniontype.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/uniontype.json @@ -1,118 +1,129 @@ [ - { - "partial": false, - "members": [ - { - "idlType": { - "idlType": [ - { - "union": false, - "sequence": false, - "generic": null, - "idlType": "float", - "nullable": false - }, - { - "idlType": [ + { + "type": "interface", + "name": "Union", + "partial": false, + "members": [ + { + "type": "attribute", + "static": false, + "stringifier": false, + "inherit": false, + "readonly": false, + "idlType": { + "type": "attribute-type", + "sequence": false, + "generic": null, + "nullable": false, + "union": true, + "idlType": [ { - "nullable": false, - "idlType": "Date", - "sequence": false, - "generic": null, - "union": false + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "float" }, { - "nullable": false, - "idlType": "Event", - "generic": null, - "sequence": false, - "union": false - } - ], - "nullable": false, - "sequence": false, - "generic": null, - "union": true - }, - { - "generic": null, - "sequence": false, - "idlType": [ - { - "union": false, - "sequence": false, - "generic": null, - "nullable": false, - "idlType": "Node" + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": true, + "idlType": [ + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "Date" + }, + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "Event" + } + ] }, { - "nullable": false, - "idlType": "DOMString", - "sequence": false, - "generic": null, - "union": false + "type": null, + "sequence": false, + "generic": null, + "nullable": true, + "union": true, + "idlType": [ + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "Node" + }, + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "DOMString" + } + ] } - ], - "nullable": true, - "union": true - } - ], - "nullable": false, - "generic": null, - "sequence": false, - "union": true + ] + }, + "name": "test", + "extAttrs": [] }, - "name": "test", - "inherit": false, - "type": "attribute", - "extAttrs": [], - "readonly": false, - "stringifier": false, - "static": false - }, - { - "readonly": false, - "extAttrs": [], - "stringifier": false, - "static": false, - "name": "test2", - "idlType": { - "nullable": false, - "idlType": [ - { - "extAttrs": [ + { + "type": "attribute", + "static": false, + "stringifier": false, + "inherit": false, + "readonly": false, + "idlType": { + "type": "attribute-type", + "sequence": false, + "generic": null, + "nullable": false, + "union": true, + "idlType": [ { - "name": "EnforceRange", - "arguments": null, - "type": "extended-attribute", - "rhs": null + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "long", + "extAttrs": [ + { + "name": "EnforceRange", + "arguments": null, + "type": "extended-attribute", + "rhs": null + } + ] + }, + { + "type": null, + "sequence": false, + "generic": null, + "nullable": false, + "union": false, + "idlType": "Date" } - ], - "nullable": false, - "idlType": "long", - "generic": null, - "sequence": false, - "union": false - }, - { - "union": false, - "sequence": false, - "generic": null, - "idlType": "Date", - "nullable": false - } - ], - "generic": null, - "sequence": false, - "union": true - }, - "inherit": false, - "type": "attribute" - } - ], - "inheritance": null, - "name": "Union", - "extAttrs": [], - "type": "interface" - } + ] + }, + "name": "test2", + "extAttrs": [] + } + ], + "inheritance": null, + "extAttrs": [] + } ] diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/variadic-operations.json b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/variadic-operations.json index a9560da9ddd..53b02dfb4cc 100644 --- a/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/variadic-operations.json +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/syntax/json/variadic-operations.json @@ -11,6 +11,7 @@ "inherit": false, "readonly": true, "idlType": { + "type": "attribute-type", "sequence": false, "generic": null, "nullable": false, @@ -28,6 +29,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -41,6 +43,7 @@ "variadic": true, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, @@ -60,6 +63,7 @@ "static": false, "stringifier": false, "idlType": { + "type": "return-type", "sequence": false, "generic": null, "nullable": false, @@ -73,6 +77,7 @@ "variadic": true, "extAttrs": [], "idlType": { + "type": "argument-type", "sequence": false, "generic": null, "nullable": false, diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/util/acquire.js b/tests/wpt/web-platform-tests/resources/webidl2/test/util/acquire.js new file mode 100644 index 00000000000..6f37dd6083c --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/util/acquire.js @@ -0,0 +1,8 @@ +"use strict"; + +const { collect } = require("./collect"); +const fs = require("fs"); + +for (const test of collect("syntax")) { + fs.writeFileSync(test.jsonPath, `${JSON.stringify(test.ast, null, 4)}\n`) +} diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/util/collect.js b/tests/wpt/web-platform-tests/resources/webidl2/test/util/collect.js new file mode 100644 index 00000000000..7e3d9d3bf31 --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/util/collect.js @@ -0,0 +1,59 @@ +"use strict"; + +const wp = require("../../lib/webidl2"); +const pth = require("path"); +const fs = require("fs"); +const jdp = require("jsondiffpatch"); + +/** + * Collects test items from the specified directory + * @param {string} base + */ +function* collect(base, { expectError } = {}) { + base = pth.join(__dirname, "..", base); + const dir = pth.join(base, "idl"); + const idls = fs.readdirSync(dir) + .filter(it => (/\.widl$/).test(it)) + .map(it => pth.join(dir, it)); + + for (const path of idls) { + const optFile = pth.join(base, "opt", pth.basename(path)).replace(".widl", ".json"); + let opt; + if (fs.existsSync(optFile)) + opt = JSON.parse(fs.readFileSync(optFile, "utf8")); + + try { + const ast = wp.parse(fs.readFileSync(path, "utf8").replace(/\r\n/g, "\n"), opt); + yield new TestItem({ ast, path, opt }); + } + catch (error) { + if (expectError) { + yield new TestItem({ path, error }); + } + else { + throw error; + } + } + } +}; + + +class TestItem { + constructor({ ast, path, error, opt }) { + this.ast = ast; + this.path = path; + this.error = error; + this.opt = opt; + this.jsonPath = pth.join(pth.dirname(path), "../json", pth.basename(path).replace(".widl", ".json")); + } + + readJSON() { + return JSON.parse(fs.readFileSync(this.jsonPath, "utf8")); + } + + diff(target = this.readJSON()) { + return jdp.diff(target, this.ast); + } +} + +module.exports.collect = collect; diff --git a/tests/wpt/web-platform-tests/resources/webidl2/test/writer.js b/tests/wpt/web-platform-tests/resources/webidl2/test/writer.js new file mode 100644 index 00000000000..e84076b4f28 --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/webidl2/test/writer.js @@ -0,0 +1,23 @@ +"use strict"; + +const { collect } = require("./util/collect"); +const wp = require("../lib/webidl2"); +const writer = require("../lib/writer"); +const expect = require("expect"); +const debug = true; + +describe("Rewrite and parses all of the IDLs to produce the same ASTs", () => { + for (const test of collect("syntax")) { + it(`should produce the same AST for ${test.path}`, () => { + try { + const diff = test.diff(wp.parse(writer.write(test.ast), test.opt)); + if (diff && debug) console.log(JSON.stringify(diff, null, 4)); + expect(diff).toBe(undefined); + } + catch (e) { + console.log(e.toString()); + throw e; + } + }); + } +}); diff --git a/tests/wpt/web-platform-tests/tools/serve/serve.py b/tests/wpt/web-platform-tests/tools/serve/serve.py index 83ef4a327bc..a7bb3cb4a42 100644 --- a/tests/wpt/web-platform-tests/tools/serve/serve.py +++ b/tests/wpt/web-platform-tests/tools/serve/serve.py @@ -5,8 +5,8 @@ from __future__ import print_function import abc import argparse import json +import logging import os -import re import socket import sys import threading @@ -18,8 +18,8 @@ from collections import defaultdict, OrderedDict from multiprocessing import Process, Event from localpaths import repo_root +from six.moves import reload_module -import sslutils from manifest.sourcefile import read_script_metadata, js_meta_re, parse_variants from wptserve import server as wptserve, handlers from wptserve import stash @@ -29,6 +29,7 @@ from wptserve.handlers import filesystem_path, wrap_pipeline from wptserve.utils import get_port, HTTPException from mod_pywebsocket import standalone as pywebsocket + def replace_end(s, old, new): """ Given a string `s` that ends with `old`, replace that occurrence of `old` @@ -565,6 +566,9 @@ class WebSocketDaemon(object): def start_ws_server(host, port, paths, routes, bind_address, config, ssl_config, **kwargs): + # Ensure that when we start this in a new process we don't inherit the + # global lock in the logging module + reload_module(logging) return WebSocketDaemon(host, str(port), repo_root, @@ -576,6 +580,9 @@ def start_ws_server(host, port, paths, routes, bind_address, config, ssl_config, def start_wss_server(host, port, paths, routes, bind_address, config, ssl_config, **kwargs): + # Ensure that when we start this in a new process we don't inherit the + # global lock in the logging module + reload_module(logging) return WebSocketDaemon(host, str(port), repo_root, diff --git a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/environment.py b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/environment.py index 3913f825fbd..9ce3cda8beb 100644 --- a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/environment.py +++ b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/environment.py @@ -222,7 +222,7 @@ class TestEnvironment(object): def ensure_started(self): # Pause for a while to ensure that the server has a chance to start - for _ in xrange(20): + for _ in xrange(60): failed = self.test_servers() if not failed: return diff --git a/tests/wpt/web-platform-tests/webaudio/resources/audionodeoptions.js b/tests/wpt/web-platform-tests/webaudio/resources/audionodeoptions.js new file mode 100644 index 00000000000..293e8e0d9c8 --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/resources/audionodeoptions.js @@ -0,0 +1,251 @@ +// Test that constructor for the node with name |nodeName| handles the +// various possible values for channelCount, channelCountMode, and +// channelInterpretation. + +// The |should| parameter is the test function from new |Audit|. +function testAudioNodeOptions(should, context, nodeName, expectedNodeOptions) { + if (expectedNodeOptions === undefined) + expectedNodeOptions = {}; + let node; + + // Test that we can set channelCount and that errors are thrown for + // invalid values + let testChannelCount = 17; + if (expectedNodeOptions.channelCount) { + testChannelCount = expectedNodeOptions.channelCount.value; + } + should( + () => { + node = new window[nodeName]( + context, Object.assign({}, expectedNodeOptions.additionalOptions, { + channelCount: testChannelCount + })); + }, + 'new ' + nodeName + '(c, {channelCount: ' + testChannelCount + '}}') + .notThrow(); + should(node.channelCount, 'node.channelCount').beEqualTo(testChannelCount); + + if (expectedNodeOptions.channelCount && + expectedNodeOptions.channelCount.isFixed) { + // The channel count is fixed. Verify that we throw an error if + // we try to change it. Arbitrarily set the count to be one more + // than the expected value. + testChannelCount = expectedNodeOptions.channelCount.value + 1; + should( + () => { + node = new window[nodeName]( + context, + Object.assign( + {}, expectedNodeOptions.additionalOptions, + {channelCount: testChannelCount})); + }, + 'new ' + nodeName + '(c, {channelCount: ' + testChannelCount + '}}') + .throw(expectedNodeOptions.channelCount.errorType || 'TypeError'); + } else { + // The channel count is not fixed. Try to set the count to invalid + // values and make sure an error is thrown. + let errorType = 'NotSupportedError'; + + [0, 99].forEach(testValue => { + should(() => { + node = new window[nodeName]( + context, Object.assign({}, expectedNodeOptions.additionalOptions, { + channelCount: testValue + })); + }, `new ${nodeName}(c, {channelCount: ${testValue}})`).throw(errorType); + }); + } + + // Test channelCountMode + let testChannelCountMode = 'max'; + if (expectedNodeOptions.channelCountMode) { + testChannelCountMode = expectedNodeOptions.channelCountMode.value; + } + should( + () => { + node = new window[nodeName]( + context, Object.assign({}, expectedNodeOptions.additionalOptions, { + channelCountMode: testChannelCountMode + })); + }, + 'new ' + nodeName + '(c, {channelCountMode: "' + testChannelCountMode + + '"}') + .notThrow(); + should(node.channelCountMode, 'node.channelCountMode') + .beEqualTo(testChannelCountMode); + + if (expectedNodeOptions.channelCountMode && + expectedNodeOptions.channelCountMode.isFixed) { + // Channel count mode is fixed. Test setting to something else throws. + ['max', 'clamped-max', 'explicit'].forEach(testValue => { + if (testValue !== expectedNodeOptions.channelCountMode.value) { + should( + () => { + node = new window[nodeName]( + context, + Object.assign( + {}, expectedNodeOptions.additionalOptions, + {channelCountMode: testValue})); + }, + `new ${nodeName}(c, {channelCountMode: "${testValue}"})`) + .throw(expectedNodeOptions.channelCountMode.errorType); + } + }); + } else { + // Mode is not fixed. Verify that we can set the mode to all valid + // values, and that we throw for invalid values. + + let testValues = ['max', 'clamped-max', 'explicit']; + + testValues.forEach(testValue => { + should(() => { + node = new window[nodeName]( + context, Object.assign({}, expectedNodeOptions.additionalOptions, { + channelCountMode: testValue + })); + }, `new ${nodeName}(c, {channelCountMode: "${testValue}"})`).notThrow(); + should( + node.channelCountMode, 'node.channelCountMode after valid setter') + .beEqualTo(testValue); + + }); + + should( + () => { + node = new window[nodeName]( + context, + Object.assign( + {}, expectedNodeOptions.additionalOptions, + {channelCountMode: 'foobar'})); + }, + 'new ' + nodeName + '(c, {channelCountMode: "foobar"}') + .throw('TypeError'); + should(node.channelCountMode, 'node.channelCountMode after invalid setter') + .beEqualTo(testValues[testValues.length - 1]); + } + + // Test channelInterpretation + if (expectedNodeOptions.channelInterpretation && + expectedNodeOptions.channelInterpretation.isFixed) { + // The channel interpretation is fixed. Verify that we throw an + // error if we try to change it. + ['speakers', 'discrete'].forEach(testValue => { + if (testValue !== expectedNodeOptions.channelInterpretation.value) { + should( + () => { + node = new window[nodeName]( + context, + Object.assign( + {}, expectedNodeOptions.additionOptions, + {channelInterpretation: testValue})); + }, + `new ${nodeName}(c, {channelInterpretation: "${testValue}"})`) + .throw(expectedNodeOptions.channelInterpretation.errorType); + } + }); + } else { + // Channel interpretation is not fixed. Verify that we can set it + // to all possible values. + should( + () => { + node = new window[nodeName]( + context, + Object.assign( + {}, expectedNodeOptions.additionalOptions, + {channelInterpretation: 'speakers'})); + }, + 'new ' + nodeName + '(c, {channelInterpretation: "speakers"})') + .notThrow(); + should(node.channelInterpretation, 'node.channelInterpretation') + .beEqualTo('speakers'); + + should( + () => { + node = new window[nodeName]( + context, + Object.assign( + {}, expectedNodeOptions.additionalOptions, + {channelInterpretation: 'discrete'})); + }, + 'new ' + nodeName + '(c, {channelInterpretation: "discrete"})') + .notThrow(); + should(node.channelInterpretation, 'node.channelInterpretation') + .beEqualTo('discrete'); + + should( + () => { + node = new window[nodeName]( + context, + Object.assign( + {}, expectedNodeOptions.additionalOptions, + {channelInterpretation: 'foobar'})); + }, + 'new ' + nodeName + '(c, {channelInterpretation: "foobar"})') + .throw('TypeError'); + should( + node.channelInterpretation, + 'node.channelInterpretation after invalid setter') + .beEqualTo('discrete'); + } +} + +function initializeContext(should) { + let c; + should(() => { + c = new OfflineAudioContext(1, 1, 48000); + }, 'context = new OfflineAudioContext(...)').notThrow(); + + return c; +} + +function testInvalidConstructor(should, name, context) { + should(() => { + new window[name](); + }, 'new ' + name + '()').throw('TypeError'); + should(() => { + new window[name](1); + }, 'new ' + name + '(1)').throw('TypeError'); + should(() => { + new window[name](context, 42); + }, 'new ' + name + '(context, 42)').throw('TypeError'); +} + +function testDefaultConstructor(should, name, context, options) { + let node; + + let message = options.prefix + ' = new ' + name + '(context'; + if (options.constructorOptions) + message += ', ' + JSON.stringify(options.constructorOptions); + message += ')' + + should(() => { + node = new window[name](context, options.constructorOptions); + }, message).notThrow(); + + should(node instanceof window[name], options.prefix + ' instanceof ' + name) + .beEqualTo(true); + should(node.numberOfInputs, options.prefix + '.numberOfInputs') + .beEqualTo(options.numberOfInputs); + should(node.numberOfOutputs, options.prefix + '.numberOfOutputs') + .beEqualTo(options.numberOfOutputs); + should(node.channelCount, options.prefix + '.channelCount') + .beEqualTo(options.channelCount); + should(node.channelCountMode, options.prefix + '.channelCountMode') + .beEqualTo(options.channelCountMode); + should(node.channelInterpretation, options.prefix + '.channelInterpretation') + .beEqualTo(options.channelInterpretation); + + return node; +} + +function testDefaultAttributes(should, node, prefix, items) { + items.forEach((item) => { + let attr = node[item.name]; + if (attr instanceof AudioParam) { + should(attr.value, prefix + '.' + item.name + '.value') + .beEqualTo(item.value); + } else { + should(attr, prefix + '.' + item.name).beEqualTo(item.value); + } + }); +} diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html new file mode 100644 index 00000000000..2112edeeffc --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html @@ -0,0 +1,183 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: AnalyserNode + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'AnalyserNode', context); + task.done(); + }); + + audit.define('default constructor', (task, should) => { + let prefix = 'node0'; + let node = testDefaultConstructor(should, 'AnalyserNode', context, { + prefix: prefix, + numberOfInputs: 1, + numberOfOutputs: 1, + channelCount: 1, + channelCountMode: 'max', + channelInterpretation: 'speakers' + }); + + testDefaultAttributes(should, node, prefix, [ + {name: 'fftSize', value: 2048}, + {name: 'frequencyBinCount', value: 1024}, + {name: 'minDecibels', value: -100}, {name: 'maxDecibels', value: -30}, + {name: 'smoothingTimeConstant', value: 0.8} + ]); + + task.done(); + }); + + audit.define('test AudioNodeOptions', (task, should) => { + testAudioNodeOptions(should, context, 'AnalyserNode'); + task.done(); + }); + + audit.define('constructor with options', (task, should) => { + let options = { + fftSize: 32, + maxDecibels: 1, + minDecibels: -13, + // Choose a value that can be represented the same as a float and as a + // double. + smoothingTimeConstant: 0.125 + }; + + let node; + should( + () => { + node = new AnalyserNode(context, options); + }, + 'node1 = new AnalyserNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + + should(node instanceof AnalyserNode, 'node1 instanceof AnalyserNode') + .beEqualTo(true); + should(node.fftSize, 'node1.fftSize').beEqualTo(options.fftSize); + should(node.maxDecibels, 'node1.maxDecibels') + .beEqualTo(options.maxDecibels); + should(node.minDecibels, 'node1.minDecibels') + .beEqualTo(options.minDecibels); + should(node.smoothingTimeConstant, 'node1.smoothingTimeConstant') + .beEqualTo(options.smoothingTimeConstant); + + task.done(); + }); + + audit.define('construct invalid options', (task, should) => { + let node; + + should( + () => { + node = new AnalyserNode(context, {fftSize: 33}); + }, + 'node = new AnalyserNode(c, { fftSize: 33 })') + .throw('IndexSizeError'); + should( + () => { + node = new AnalyserNode(context, {maxDecibels: -500}); + }, + 'node = new AnalyserNode(c, { maxDecibels: -500 })') + .throw('IndexSizeError'); + should( + () => { + node = new AnalyserNode(context, {minDecibels: -10}); + }, + 'node = new AnalyserNode(c, { minDecibels: -10 })') + .throw('IndexSizeError'); + should( + () => { + node = new AnalyserNode(context, {smoothingTimeConstant: 2}); + }, + 'node = new AnalyserNode(c, { smoothingTimeConstant: 2 })') + .throw('IndexSizeError'); + should(function() { + node = new AnalyserNode(context, {frequencyBinCount: 33}); + }, 'node = new AnalyserNode(c, { frequencyBinCount: 33 })').notThrow(); + should(node.frequencyBinCount, 'node.frequencyBinCount') + .beEqualTo(1024); + + task.done(); + }); + + audit.define('setting min/max', (task, should) => { + let node; + + // Recall the default values of minDecibels and maxDecibels are -100, + // and -30, respectively. Setting both values in the constructor should + // not signal an error in any of the following cases. + let options = {minDecibels: -10, maxDecibels: 20}; + should( + () => { + node = new AnalyserNode(context, options); + }, + 'node = new AnalyserNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + + options = {maxDecibels: 20, minDecibels: -10}; + should( + () => { + node = new AnalyserNode(context, options); + }, + 'node = new AnalyserNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + + options = {minDecibels: -200, maxDecibels: -150}; + should( + () => { + node = new AnalyserNode(context, options); + }, + 'node = new AnalyserNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + + options = {maxDecibels: -150, minDecibels: -200}; + should( + () => { + node = new AnalyserNode(context, options); + }, + 'node = new AnalyserNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + + // But these should signal because minDecibel > maxDecibel + options = {maxDecibels: -150, minDecibels: -10}; + should( + () => { + node = new AnalyserNode(context, options); + }, + 'node = new AnalyserNode(c, ' + JSON.stringify(options) + ')') + .throw('IndexSizeError'); + + options = {minDecibels: -10, maxDecibels: -150}; + should( + () => { + node = new AnalyserNode(context, options); + }, + 'node = new AnalyserNode(c, ' + JSON.stringify(options) + ')') + .throw('IndexSizeError'); + + task.done(); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/ctor-audiobuffersource.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/ctor-audiobuffersource.html new file mode 100644 index 00000000000..c1c3203451e --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/ctor-audiobuffersource.html @@ -0,0 +1,116 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: AudioBufferSource + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'AudioBufferSourceNode', context); + task.done(); + }); + + audit.define('default constructor', (task, should) => { + let prefix = 'node0'; + let node = + testDefaultConstructor(should, 'AudioBufferSourceNode', context, { + prefix: prefix, + numberOfInputs: 0, + numberOfOutputs: 1, + channelCount: 2, + channelCountMode: 'max', + channelInterpretation: 'speakers' + }); + + testDefaultAttributes(should, node, prefix, [ + {name: 'buffer', value: null}, + {name: 'detune', value: 0}, + {name: 'loop', value: false}, + {name: 'loopEnd', value: 0.0}, + {name: 'loopStart', value: 0.0}, + {name: 'playbackRate', value: 1.0}, + ]); + + task.done(); + }); + + audit.define('nullable buffer', (task, should) => { + let node; + let options = {buffer: null}; + + should( + () => { + node = new AudioBufferSourceNode(context, options); + }, + 'node1 = new AudioBufferSourceNode(c, ' + JSON.stringify(options)) + .notThrow(); + + should(node.buffer, 'node1.buffer').beEqualTo(null); + + task.done(); + }); + + audit.define('constructor options', (task, should) => { + let node; + let buffer = context.createBuffer(2, 1000, context.sampleRate); + + let options = { + buffer: buffer, + detune: .5, + loop: true, + loopEnd: (buffer.length / 2) / context.sampleRate, + loopStart: 5 / context.sampleRate, + playbackRate: .75 + }; + + let message = 'node = new AudioBufferSourceNode(c, ' + + JSON.stringify(options) + ')'; + + should(() => { + node = new AudioBufferSourceNode(context, options); + }, message).notThrow(); + + // Use the factory method to create an equivalent node and compare the + // results from the constructor against this node. + let factoryNode = context.createBufferSource(); + factoryNode.buffer = options.buffer; + factoryNode.detune.value = options.detune; + factoryNode.loop = options.loop; + factoryNode.loopEnd = options.loopEnd; + factoryNode.loopStart = options.loopStart; + factoryNode.playbackRate.value = options.playbackRate; + + should(node.buffer === buffer, 'node2.buffer === buffer') + .beEqualTo(true); + should(node.detune.value, 'node2.detune.value') + .beEqualTo(factoryNode.detune.value); + should(node.loop, 'node2.loop').beEqualTo(factoryNode.loop); + should(node.loopEnd, 'node2.loopEnd').beEqualTo(factoryNode.loopEnd); + should(node.loopStart, 'node2.loopStart') + .beEqualTo(factoryNode.loopStart); + should(node.playbackRate.value, 'node2.playbackRate.value') + .beEqualTo(factoryNode.playbackRate.value); + + task.done(); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/ctor-biquadfilter.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/ctor-biquadfilter.html new file mode 100644 index 00000000000..e63479f9859 --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/ctor-biquadfilter.html @@ -0,0 +1,86 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: BiquadFilter + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'BiquadFilterNode', context); + task.done(); + }); + + audit.define('default constructor', (task, should) => { + let prefix = 'node0'; + let node = testDefaultConstructor(should, 'BiquadFilterNode', context, { + prefix: prefix, + numberOfInputs: 1, + numberOfOutputs: 1, + channelCount: 2, + channelCountMode: 'max', + channelInterpretation: 'speakers' + }); + + testDefaultAttributes(should, node, prefix, [ + {name: 'type', value: 'lowpass'}, {name: 'Q', value: 1}, + {name: 'detune', value: 0}, {name: 'frequency', value: 350}, + {name: 'gain', value: 0.0} + ]); + + task.done(); + }); + + audit.define('test AudioNodeOptions', (task, should) => { + testAudioNodeOptions(should, context, 'BiquadFilterNode'); + task.done(); + }); + + audit.define('construct with options', (task, should) => { + let node; + let options = { + type: 'highpass', + frequency: 512, + detune: 1, + Q: 5, + gain: 3, + }; + + should( + () => { + node = new BiquadFilterNode(context, options); + }, + 'node = new BiquadFilterNode(..., ' + JSON.stringify(options) + ')') + .notThrow(); + + // Test that attributes are set according to the option values. + should(node.type, 'node.type').beEqualTo(options.type); + should(node.frequency.value, 'node.frequency.value') + .beEqualTo(options.frequency); + should(node.detune.value, 'node.detuen.value') + .beEqualTo(options.detune); + should(node.Q.value, 'node.Q.value').beEqualTo(options.Q); + should(node.gain.value, 'node.gain.value').beEqualTo(options.gain); + + task.done(); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-channelmergernode-interface/ctor-channelmerger.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-channelmergernode-interface/ctor-channelmerger.html new file mode 100644 index 00000000000..115bd994349 --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-channelmergernode-interface/ctor-channelmerger.html @@ -0,0 +1,109 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: ChannelMerger + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'ChannelMergerNode', context); + task.done(); + }); + + audit.define('default constructor', (task, should) => { + let prefix = 'node0'; + let node = + testDefaultConstructor(should, 'ChannelMergerNode', context, { + prefix: prefix, + numberOfInputs: 6, + numberOfOutputs: 1, + channelCount: 1, + channelCountMode: 'explicit', + channelInterpretation: 'speakers' + }); + + task.done(); + }); + + audit.define('test AudioNodeOptions', (task, should) => { + testAudioNodeOptions(should, context, 'ChannelMergerNode', { + channelCount: + {value: 1, isFixed: true, errorType: 'InvalidStateError'}, + channelCountMode: { + value: 'explicit', + isFixed: true, + errorType: 'InvalidStateError' + } + }); + task.done(); + }); + + audit.define('constructor options', (task, should) => { + let node; + let options = { + numberOfInputs: 3, + numberOfOutputs: 9, + channelInterpretation: 'discrete' + }; + + should( + () => { + node = new ChannelMergerNode(context, options); + }, + 'node1 = new ChannelMergerNode(context, ' + + JSON.stringify(options) + ')') + .notThrow(); + + should(node.numberOfInputs, 'node1.numberOfInputs') + .beEqualTo(options.numberOfInputs); + should(node.numberOfOutputs, 'node1.numberOfOutputs').beEqualTo(1); + should(node.channelInterpretation, 'node1.channelInterpretation') + .beEqualTo(options.channelInterpretation); + + options = {numberOfInputs: 99}; + should( + () => { + node = new ChannelMergerNode(context, options); + }, + 'new ChannelMergerNode(c, ' + JSON.stringify(options) + ')') + .throw('IndexSizeError'); + + options = {channelCount: 3}; + should( + () => { + node = new ChannelMergerNode(context, options); + }, + 'new ChannelMergerNode(c, ' + JSON.stringify(options) + ')') + .throw('InvalidStateError'); + + options = {channelCountMode: 'max'}; + should( + () => { + node = new ChannelMergerNode(context, options); + }, + 'new ChannelMergerNode(c, ' + JSON.stringify(options) + ')') + .throw('InvalidStateError'); + + task.done(); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-channelsplitternode-interface/ctor-channelsplitter.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-channelsplitternode-interface/ctor-channelsplitter.html new file mode 100644 index 00000000000..7fa9d6fa546 --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-channelsplitternode-interface/ctor-channelsplitter.html @@ -0,0 +1,111 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: ChannelSplitter + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'ChannelSplitterNode', context); + task.done(); + }); + + audit.define('default constructor', (task, should) => { + testDefaultConstructor(should, 'ChannelSplitterNode', context, { + prefix: 'node0', + numberOfInputs: 1, + numberOfOutputs: 6, + channelCount: 6, + channelCountMode: 'explicit', + channelInterpretation: 'discrete' + }); + + task.done(); + }); + + audit.define('test AudioNodeOptions', (task, should) => { + testAudioNodeOptions(should, context, 'ChannelSplitterNode', { + channelCount: + {value: 6, isFixed: true, errorType: 'InvalidStateError'}, + channelCountMode: { + value: 'explicit', + isFixed: true, + }, + channelInterpretation: { + value: 'discrete', + isFixed: true, + errorType: 'InvalidStateError' + }, + }); + task.done(); + }); + + audit.define('constructor options', (task, should) => { + let node; + let options = { + numberOfInputs: 3, + numberOfOutputs: 9, + channelInterpretation: 'discrete' + }; + + should( + () => { + node = new ChannelSplitterNode(context, options); + }, + 'node1 = new ChannelSplitterNode(context, ' + + JSON.stringify(options) + ')') + .notThrow(); + + should(node.numberOfInputs, 'node1.numberOfInputs').beEqualTo(1); + should(node.numberOfOutputs, 'node1.numberOfOutputs') + .beEqualTo(options.numberOfOutputs); + should(node.channelInterpretation, 'node1.channelInterpretation') + .beEqualTo(options.channelInterpretation); + + options = {numberOfOutputs: 99}; + should( + () => { + node = new ChannelSplitterNode(context, options); + }, + 'new ChannelSplitterNode(c, ' + JSON.stringify(options) + ')') + .throw('IndexSizeError'); + + options = {channelCount: 3}; + should( + () => { + node = new ChannelSplitterNode(context, options); + }, + 'new ChannelSplitterNode(c, ' + JSON.stringify(options) + ')') + .throw('InvalidStateError'); + + options = {channelCountMode: 'max'}; + should( + () => { + node = new ChannelSplitterNode(context, options); + }, + 'new ChannelSplitterNode(c, ' + JSON.stringify(options) + ')') + .throw('InvalidStateError'); + + task.done(); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-constantsourcenode-interface/ctor-constantsource.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-constantsourcenode-interface/ctor-constantsource.html new file mode 100644 index 00000000000..ea4a65e146b --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-constantsourcenode-interface/ctor-constantsource.html @@ -0,0 +1,50 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: ConstantSource + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'ConstantSourceNode', context); + task.done(); + }); + + audit.define('default constructor', (task, should) => { + let prefix = 'node0'; + let node = + testDefaultConstructor(should, 'ConstantSourceNode', context, { + prefix: prefix, + numberOfInputs: 0, + numberOfOutputs: 1, + channelCount: 2, + channelCountMode: 'max', + channelInterpretation: 'speakers' + }); + + testDefaultAttributes( + should, node, prefix, [{name: 'offset', value: 1}]); + + task.done(); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/ctor-convolver.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/ctor-convolver.html new file mode 100644 index 00000000000..cf818330060 --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/ctor-convolver.html @@ -0,0 +1,125 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: Convolver + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'ConvolverNode', context); + task.done(); + }); + + audit.define('default constructor', (task, should) => { + let prefix = 'node0'; + let node = testDefaultConstructor(should, 'ConvolverNode', context, { + prefix: prefix, + numberOfInputs: 1, + numberOfOutputs: 1, + channelCount: 2, + channelCountMode: 'clamped-max', + channelInterpretation: 'speakers' + }); + + testDefaultAttributes( + should, node, prefix, + [{name: 'normalize', value: true}, {name: 'buffer', value: null}]); + + task.done(); + }); + + audit.define('test AudioNodeOptions', (task, should) => { + testAudioNodeOptions(should, context, 'ConvolverNode', { + channelCount: + {value: 2, isFixed: true, errorType: 'NotSupportedError'}, + channelCountMode: { + value: 'clamped-max', + isFixed: true, + errorType: 'NotSupportedError' + }, + }); + task.done(); + }); + + audit.define('nullable buffer', (task, should) => { + let node; + let options = {buffer: null}; + + should( + () => { + node = new ConvolverNode(context, options); + }, + 'node1 = new ConvolverNode(c, ' + JSON.stringify(options)) + .notThrow(); + + should(node.buffer, 'node1.buffer').beEqualTo(null); + + task.done(); + }); + + audit.define('construct with options', (task, should) => { + let buf = context.createBuffer(1, 1, context.sampleRate); + let options = {buffer: buf, disableNormalization: false}; + + let message = + 'node = new ConvolverNode(c, ' + JSON.stringify(options) + ')'; + + let node; + should(() => { + node = new ConvolverNode(context, options); + }, message).notThrow(); + + should(node instanceof ConvolverNode, 'node1 instanceOf ConvolverNode') + .beEqualTo(true); + should(node.buffer === options.buffer, 'node1.buffer === <buf>') + .beEqualTo(true); + should(node.normalize, 'node1.normalize') + .beEqualTo(!options.disableNormalization); + + options.buffer = null; + options.disableNormalization = true; + + message = + 'node2 = new ConvolverNode(, ' + JSON.stringify(options) + ')'; + + should(() => { + node = new ConvolverNode(context, options); + }, message).notThrow(); + should(node.buffer, 'node2.buffer').beEqualTo(null); + should(node.normalize, 'node2.normalize') + .beEqualTo(!options.disableNormalization); + + options.disableNormalization = false; + message = 'node3 = new ConvolverNode(context, ' + + JSON.stringify(options) + ')'; + + should(() => { + node = new ConvolverNode(context, options); + }, message).notThrow(); + should(node.buffer, 'node3.buffer').beEqualTo(null); + should(node.normalize, 'node3.normalize') + .beEqualTo(!options.disableNormalization); + + task.done(); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-delaynode-interface/ctor-delay.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-delaynode-interface/ctor-delay.html new file mode 100644 index 00000000000..e7ccefc6553 --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-delaynode-interface/ctor-delay.html @@ -0,0 +1,76 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: Delay + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'DelayNode', context); + task.done(); + }); + + audit.define('default constructor', (task, should) => { + let prefix = 'node0'; + let node = testDefaultConstructor(should, 'DelayNode', context, { + prefix: prefix, + numberOfInputs: 1, + numberOfOutputs: 1, + channelCount: 2, + channelCountMode: 'max', + channelInterpretation: 'speakers' + }); + + testDefaultAttributes( + should, node, prefix, [{name: 'delayTime', value: 0}]); + + task.done(); + }); + + audit.define('test AudioNodeOptions', (task, should) => { + testAudioNodeOptions(should, context, 'DelayNode'); + task.done(); + }); + + audit.define('constructor options', (task, should) => { + let node; + let options = { + delayTime: 0.5, + maxDelayTime: 1.5, + }; + + should( + () => { + node = new DelayNode(context, options); + }, + 'node1 = new DelayNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + + should(node.delayTime.value, 'node1.delayTime.value') + .beEqualTo(options.delayTime); + should(node.delayTime.maxValue, 'node1.delayTime.maxValue') + .beEqualTo(options.maxDelayTime); + + task.done(); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html new file mode 100644 index 00000000000..799c1872f07 --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html @@ -0,0 +1,196 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: DynamicsCompressor + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'DynamicsCompressorNode', context); + task.done(); + }); + + audit.define('default constructor', (task, should) => { + let prefix = 'node0'; + let node = + testDefaultConstructor(should, 'DynamicsCompressorNode', context, { + prefix: prefix, + numberOfInputs: 1, + numberOfOutputs: 1, + channelCount: 2, + channelCountMode: 'clamped-max', + channelInterpretation: 'speakers' + }); + + testDefaultAttributes(should, node, prefix, [ + {name: 'threshold', value: -24}, {name: 'knee', value: 30}, + {name: 'ratio', value: 12}, {name: 'reduction', value: 0}, + {name: 'attack', value: Math.fround(0.003)}, + {name: 'release', value: 0.25} + ]); + + task.done(); + }); + + audit.define('test AudioNodeOptions', (task, should) => { + // Can't use testAudioNodeOptions because the constraints for this node + // are not supported there. + + // Array of test options to be run. Each entry is a dictionary where + // |testAttribute| is the name of the attribute to be tested, + // |testValue| is the value to be used, and |expectedErrorType| is the + // error type if the test is expected to throw an error. + // |expectedErrorType| should be set only if the test does throw. + let testOptions = [ + // Test channel count + { + testAttribute: 'channelCount', + testValue: 1, + }, + { + testAttribute: 'channelCount', + testValue: 2, + }, + { + testAttribute: 'channelCount', + testValue: 0, + expectedErrorType: 'NotSupportedError' + }, + { + testAttribute: 'channelCount', + testValue: 3, + expectedErrorType: 'NotSupportedError' + }, + { + testAttribute: 'channelCount', + testValue: 99, + expectedErrorType: 'NotSupportedError' + }, + // Test channel count mode + { + testAttribute: 'channelCountMode', + testValue: 'clamped-max', + }, + { + testAttribute: 'channelCountMode', + testValue: 'explicit', + }, + { + testAttribute: 'channelCountMode', + testValue: 'max', + expectedErrorType: 'NotSupportedError' + }, + { + testAttribute: 'channelCountMode', + testValue: 'foobar', + expectedErrorType: 'TypeError' + }, + // Test channel interpretation + { + testAttribute: 'channelInterpretation', + testValue: 'speakers', + }, + { + testAttribute: 'channelInterpretation', + testValue: 'discrete', + }, + { + testAttribute: 'channelInterpretation', + testValue: 'foobar', + expectedErrorType: 'TypeError' + } + ]; + + testOptions.forEach((option) => { + let nodeOptions = {}; + nodeOptions[option.testAttribute] = option.testValue; + + testNode(should, context, { + nodeOptions: nodeOptions, + testAttribute: option.testAttribute, + expectedValue: option.testValue, + expectedErrorType: option.expectedErrorType + }); + }); + + task.done(); + }); + + audit.define('constructor with options', (task, should) => { + let node; + let options = + {threshold: -33, knee: 15, ratio: 7, attack: 0.625, release: 0.125}; + + should( + () => { + node = new DynamicsCompressorNode(context, options); + }, + 'node1 = new DynamicsCompressorNode(c, ' + JSON.stringify(options) + + ')') + .notThrow(); + should( + node instanceof DynamicsCompressorNode, + 'node1 instanceof DynamicsCompressorNode') + .beEqualTo(true); + + should(node.threshold.value, 'node1.threshold.value') + .beEqualTo(options.threshold); + should(node.knee.value, 'node1.knee.value').beEqualTo(options.knee); + should(node.ratio.value, 'node1.ratio.value').beEqualTo(options.ratio); + should(node.attack.value, 'node1.attack.value') + .beEqualTo(options.attack); + should(node.release.value, 'node1.release.value') + .beEqualTo(options.release); + + should(node.channelCount, 'node1.channelCount').beEqualTo(2); + should(node.channelCountMode, 'node1.channelCountMode') + .beEqualTo('clamped-max'); + should(node.channelInterpretation, 'node1.channelInterpretation') + .beEqualTo('speakers'); + + task.done(); + }); + + audit.run(); + + // Test possible options for DynamicsCompressor constructor. + function testNode(should, context, options) { + // Node to be tested + let node; + + let createNodeFunction = () => { + return () => node = + new DynamicsCompressorNode(context, options.nodeOptions); + }; + + let message = 'new DynamicsCompressorNode(c, ' + + JSON.stringify(options.nodeOptions) + ')'; + + if (options.expectedErrorType) { + should(createNodeFunction(), message) + .throw(options.expectedErrorType); + } else { + should(createNodeFunction(), message).notThrow(); + should(node[options.testAttribute], 'node.' + options.testAttribute) + .beEqualTo(options.expectedValue); + } + } + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-gainnode-interface/ctor-gain.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-gainnode-interface/ctor-gain.html new file mode 100644 index 00000000000..dec273e9698 --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-gainnode-interface/ctor-gain.html @@ -0,0 +1,79 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: Gain + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'GainNode', context); + task.done(); + }); + + audit.define('default constructor', (task, should) => { + let prefix = 'node0'; + let node = testDefaultConstructor(should, 'GainNode', context, { + prefix: prefix, + numberOfInputs: 1, + numberOfOutputs: 1, + channelCount: 2, + channelCountMode: 'max', + channelInterpretation: 'speakers' + }); + + testDefaultAttributes(should, node, prefix, [{name: 'gain', value: 1}]); + + task.done(); + }); + + audit.define('test AudioNodeOptions', (task, should) => { + testAudioNodeOptions(should, context, 'GainNode'); + task.done(); + }); + + audit.define('constructor with options', (task, should) => { + let node; + let options = { + gain: -2, + }; + + should( + () => { + node = new GainNode(context, options); + }, + 'node1 = new GainNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + should(node instanceof GainNode, 'node1 instanceof GainNode') + .beEqualTo(true); + + should(node.gain.value, 'node1.gain.value').beEqualTo(options.gain); + + should(node.channelCount, 'node1.channelCount').beEqualTo(2); + should(node.channelCountMode, 'node1.channelCountMode') + .beEqualTo('max'); + should(node.channelInterpretation, 'node1.channelInterpretation') + .beEqualTo('speakers'); + + task.done(); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-iirfilternode-interface/ctor-iirfilter.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-iirfilternode-interface/ctor-iirfilter.html new file mode 100644 index 00000000000..bb89512ca62 --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-iirfilternode-interface/ctor-iirfilter.html @@ -0,0 +1,126 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: IIRFilter + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'IIRFilterNode', context); + task.done(); + }); + + audit.define('default constructor', (task, should) => { + let prefix = 'node0'; + let node = testDefaultConstructor(should, 'IIRFilterNode', context, { + prefix: prefix, + numberOfInputs: 1, + numberOfOutputs: 1, + channelCount: 2, + channelCountMode: 'max', + channelInterpretation: 'speakers', + constructorOptions: {feedforward: [1], feedback: [1, -.9]} + }); + + task.done(); + }); + + audit.define('test AudioNodeOptions', (task, should) => { + testAudioNodeOptions( + should, context, 'IIRFilterNode', + {additionalOptions: {feedforward: [1, 1], feedback: [1, .5]}}); + task.done(); + }); + + audit.define('constructor options', (task, should) => { + let node; + + let options = {feedback: [1, .5]}; + should( + () => { + node = new IIRFilterNode(context, options); + }, + 'node = new IIRFilterNode(, ' + JSON.stringify(options) + ')') + .throw('TypeError'); + + options = {feedforward: [1, 0.5]}; + should( + () => { + node = new IIRFilterNode(context, options); + }, + 'node = new IIRFilterNode(c, ' + JSON.stringify(options) + ')') + .throw('TypeError'); + + task.done(); + }); + + // Test functionality of constructor. This is needed because we have no + // way of determining if the filter coefficients were were actually set + // appropriately. + + // TODO(rtoy): This functionality test should be moved out to a separate + // file. + audit.define('functionality', (task, should) => { + let options = {feedback: [1, .5], feedforward: [1, 1]}; + + // Create two-channel offline context; sample rate and length are fairly + // arbitrary. Channel 0 contains the test output and channel 1 contains + // the expected output. + let sampleRate = 48000; + let renderLength = 0.125; + let testContext = + new OfflineAudioContext(2, renderLength * sampleRate, sampleRate); + + // The test node uses the constructor. The reference node creates the + // same filter but uses the old factory method. + let testNode = new IIRFilterNode(testContext, options); + let refNode = testContext.createIIRFilter( + Float32Array.from(options.feedforward), + Float32Array.from(options.feedback)); + + let source = testContext.createOscillator(); + source.connect(testNode); + source.connect(refNode); + + let merger = testContext.createChannelMerger( + testContext.destination.channelCount); + + testNode.connect(merger, 0, 0); + refNode.connect(merger, 0, 1); + + merger.connect(testContext.destination); + + source.start(); + testContext.startRendering() + .then(function(resultBuffer) { + let actual = resultBuffer.getChannelData(0); + let expected = resultBuffer.getChannelData(1); + + // The output from the two channels should be exactly equal + // because exactly the same IIR filter should have been created. + should(actual, 'Output of filter using new IIRFilter(...)') + .beEqualToArray(expected); + }) + .then(() => task.done()); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/ctor-offlineaudiocontext.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/ctor-offlineaudiocontext.html new file mode 100644 index 00000000000..79aafe7f1f0 --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/ctor-offlineaudiocontext.html @@ -0,0 +1,203 @@ +<!doctype html> +<html> + <head> + <title>Test Constructor: OfflineAudioContext</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + + <body> + <script> + let audit = Audit.createTaskRunner(); + + // Just a simple test of the 3-arg constructor; This should be + // well-covered by other layout tests that use the 3-arg constructor. + audit.define( + {label: 'basic', description: 'Old-style constructor'}, + (task, should) => { + let context; + + // First and only arg should be a dictionary. + should(() => { + new OfflineAudioContext(3); + }, 'new OfflineAudioContext(3)').throw('TypeError'); + + // Constructor needs 1 or 3 args, so 2 should throw. + should(() => { + new OfflineAudioContext(3, 42); + }, 'new OfflineAudioContext(3, 42)').throw('TypeError'); + + // Valid constructor + should(() => { + context = new OfflineAudioContext(3, 42, 12345); + }, 'context = new OfflineAudioContext(3, 42, 12345)').notThrow(); + + // Verify that the context was constructed correctly. + should(context.length, 'context.length').beEqualTo(42); + should(context.sampleRate, 'context.sampleRate').beEqualTo(12345); + should( + context.destination.channelCount, + 'context.destination.channelCount') + .beEqualTo(3); + should( + context.destination.channelCountMode, + 'context.destination.channelCountMode') + .beEqualTo('explicit'); + should( + context.destination.channelInterpretation, + 'context.destination.channelInterpretation') + .beEqualTo('speakers'); + task.done(); + }); + + // Test constructor throws an error if the required members of the + // dictionary are not given. + audit.define( + {label: 'options-1', description: 'Required options'}, + (task, should) => { + let context2; + + // No args should throw + should(() => { + new OfflineAudioContext(); + }, 'new OfflineAudioContext()').throw('TypeError'); + + // Empty OfflineAudioContextOptions should throw + should(() => { + new OfflineAudioContext({}); + }, 'new OfflineAudioContext({})').throw('TypeError'); + + let options = {length: 42}; + // sampleRate is required. + should( + () => { + new OfflineAudioContext(options); + }, + 'new OfflineAudioContext(' + JSON.stringify(options) + ')') + .throw('TypeError'); + + options = {sampleRate: 12345}; + // length is required. + should( + () => { + new OfflineAudioContext(options); + }, + 'new OfflineAudioContext(' + JSON.stringify(options) + ')') + .throw('TypeError'); + + // Valid constructor. Verify that the resulting context has the + // correct values. + options = {length: 42, sampleRate: 12345}; + should( + () => { + context2 = new OfflineAudioContext(options); + }, + 'c2 = new OfflineAudioContext(' + JSON.stringify(options) + ')') + .notThrow(); + should( + context2.destination.channelCount, + 'c2.destination.channelCount') + .beEqualTo(1); + should(context2.length, 'c2.length').beEqualTo(options.length); + should(context2.sampleRate, 'c2.sampleRate') + .beEqualTo(options.sampleRate); + should( + context2.destination.channelCountMode, + 'c2.destination.channelCountMode') + .beEqualTo('explicit'); + should( + context2.destination.channelInterpretation, + 'c2.destination.channelInterpretation') + .beEqualTo('speakers'); + + task.done(); + }); + + // Constructor should throw errors for invalid values specified by + // OfflineAudioContextOptions. + audit.define( + {label: 'options-2', description: 'Invalid options'}, + (task, should) => { + let options = {length: 42, sampleRate: 8000, numberOfChannels: 33}; + + // channelCount too large. + should( + () => { + new OfflineAudioContext(options); + }, + 'new OfflineAudioContext(' + JSON.stringify(options) + ')') + .throw('NotSupportedError'); + + // length cannot be 0 + options = {length: 0, sampleRate: 8000}; + should( + () => { + new OfflineAudioContext(options); + }, + 'new OfflineAudioContext(' + JSON.stringify(options) + ')') + .throw('NotSupportedError'); + + // sampleRate outside valid range + options = {length: 1, sampleRate: 1}; + should( + () => { + new OfflineAudioContext(options); + }, + 'new OfflineAudioContext(' + JSON.stringify(options) + ')') + .throw('NotSupportedError'); + + task.done(); + }); + + audit.define( + {label: 'options-3', description: 'Valid options'}, + (task, should) => { + let context; + let options = { + length: 1, + sampleRate: 8000, + }; + + // Verify context with valid constructor has the correct values. + should( + () => { + context = new OfflineAudioContext(options); + }, + 'c = new OfflineAudioContext' + JSON.stringify(options) + ')') + .notThrow(); + should(context.length, 'c.length').beEqualTo(options.length); + should(context.sampleRate, 'c.sampleRate') + .beEqualTo(options.sampleRate); + should( + context.destination.channelCount, 'c.destination.channelCount') + .beEqualTo(1); + should( + context.destination.channelCountMode, + 'c.destination.channelCountMode') + .beEqualTo('explicit'); + should( + context.destination.channelInterpretation, + 'c.destination.channelCountMode') + .beEqualTo('speakers'); + + options.numberOfChannels = 7; + should( + () => { + context = new OfflineAudioContext(options); + }, + 'c = new OfflineAudioContext' + JSON.stringify(options) + ')') + .notThrow(); + should( + context.destination.channelCount, 'c.destination.channelCount') + .beEqualTo(options.numberOfChannels); + + task.done(); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-oscillatornode-interface/ctor-oscillator.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-oscillatornode-interface/ctor-oscillator.html new file mode 100644 index 00000000000..aaf77aec555 --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-oscillatornode-interface/ctor-oscillator.html @@ -0,0 +1,106 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: Oscillator + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'OscillatorNode', context); + task.done(); + }); + + audit.define('default constructor', (task, should) => { + let prefix = 'node0'; + let node = testDefaultConstructor(should, 'OscillatorNode', context, { + prefix: prefix, + numberOfInputs: 0, + numberOfOutputs: 1, + channelCount: 2, + channelCountMode: 'max', + channelInterpretation: 'speakers' + }); + + testDefaultAttributes( + should, node, prefix, + [{name: 'type', value: 'sine'}, {name: 'frequency', value: 440}]); + + task.done(); + }); + + audit.define('test AudioNodeOptions', (task, should) => { + testAudioNodeOptions(should, context, 'OscillatorNode'); + task.done(); + }); + + audit.define('constructor options', (task, should) => { + let node; + let options = {type: 'sawtooth', detune: 7, frequency: 918}; + + should( + () => { + node = new OscillatorNode(context, options); + }, + 'node1 = new OscillatorNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + + should(node.type, 'node1.type').beEqualTo(options.type); + should(node.detune.value, 'node1.detune.value') + .beEqualTo(options.detune); + should(node.frequency.value, 'node1.frequency.value') + .beEqualTo(options.frequency); + + should(node.channelCount, 'node1.channelCount').beEqualTo(2); + should(node.channelCountMode, 'node1.channelCountMode') + .beEqualTo('max'); + should(node.channelInterpretation, 'node1.channelInterpretation') + .beEqualTo('speakers'); + + // Test that type and periodicWave options work as described. + options = { + type: 'sine', + periodicWave: new PeriodicWave(context, {real: [1, 1]}) + }; + should(() => { + node = new OscillatorNode(context, options); + }, 'new OscillatorNode(c, ' + JSON.stringify(options) + ')').notThrow(); + + options = {type: 'custom'}; + should( + () => { + node = new OscillatorNode(context, options); + }, + 'new OscillatorNode(c, ' + JSON.stringify(options) + ')') + .throw('InvalidStateError'); + + options = { + type: 'custom', + periodicWave: new PeriodicWave(context, {real: [1, 1]}) + }; + should(() => { + node = new OscillatorNode(context, options); + }, 'new OscillatorNode(, ' + JSON.stringify(options) + ')').notThrow(); + + task.done(); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-pannernode-interface/ctor-panner.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-pannernode-interface/ctor-panner.html new file mode 100644 index 00000000000..48b368ddf2d --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-pannernode-interface/ctor-panner.html @@ -0,0 +1,274 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: Panner + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'PannerNode', context); + task.done(); + }); + + audit.define('default constructor', (task, should) => { + let prefix = 'node0'; + let node = testDefaultConstructor(should, 'PannerNode', context, { + prefix: prefix, + numberOfInputs: 1, + numberOfOutputs: 1, + channelCount: 2, + channelCountMode: 'clamped-max', + channelInterpretation: 'speakers' + }); + + testDefaultAttributes(should, node, prefix, [ + {name: 'panningModel', value: 'equalpower'}, + {name: 'positionX', value: 0}, {name: 'positionY', value: 0}, + {name: 'positionZ', value: 0}, {name: 'orientationX', value: 1}, + {name: 'orientationY', value: 0}, {name: 'orientationZ', value: 0}, + {name: 'distanceModel', value: 'inverse'}, + {name: 'refDistance', value: 1}, {name: 'maxDistance', value: 10000}, + {name: 'rolloffFactor', value: 1}, + {name: 'coneInnerAngle', value: 360}, + {name: 'coneOuterAngle', value: 360}, + {name: 'coneOuterGain', value: 0} + ]); + + // Test the listener too, while we're at it. + let listenerAttributes = [ + {name: 'positionX', value: 0}, + {name: 'positionY', value: 0}, + {name: 'positionZ', value: 0}, + {name: 'forwardX', value: 0}, + {name: 'forwardY', value: 0}, + {name: 'forwardZ', value: -1}, + {name: 'upX', value: 0}, + {name: 'upY', value: 1}, + {name: 'upZ', value: 0}, + ]; + + listenerAttributes.forEach((item) => { + should( + context.listener[item.name].value, + 'context.listener.' + item.name + '.value') + .beEqualTo(item.value); + }); + + task.done(); + }); + + audit.define('test AudioNodeOptions', (task, should) => { + // Can't use testAudioNodeOptions because the constraints for this node + // are not supported there. + let node; + let success = true; + + // Test that we can set the channel count to 1 or 2. + let options = {channelCount: 1}; + should( + () => { + node = new PannerNode(context, options); + }, + 'node1 = new PannerNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + should(node.channelCount, 'node1.channelCount') + .beEqualTo(options.channelCount); + + options = {channelCount: 2}; + should( + () => { + node = new PannerNode(context, options); + }, + 'node2 = new PannerNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + should(node.channelCount, 'node2.channelCount') + .beEqualTo(options.channelCount); + + // Test that other channel counts throw an error + options = {channelCount: 0}; + should( + () => { + node = new PannerNode(context, options); + }, + 'new PannerNode(c, ' + JSON.stringify(options) + ')') + .throw('NotSupportedError'); + + options = {channelCount: 3}; + should( + () => { + node = new PannerNode(context, options); + }, + 'new PannerNode(c, ' + JSON.stringify(options) + ')') + .throw('NotSupportedError'); + + options = {channelCount: 99}; + should( + () => { + node = new PannerNode(context, options); + }, + 'new PannerNode(c, ' + JSON.stringify(options) + ')') + .throw('NotSupportedError'); + + // Test channelCountMode. A mode of "max" is illegal, but others are + // ok. + options = {channelCountMode: 'clamped-max'}; + should( + () => { + node = new PannerNode(context, options); + }, + 'node3 = new PannerNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + should(node.channelCountMode, 'node3.channelCountMode') + .beEqualTo(options.channelCountMode); + + options = {channelCountMode: 'explicit'}; + should( + () => { + node = new PannerNode(context, options); + }, + 'node4 = new PannerNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + should(node.channelCountMode, 'node4.channelCountMode') + .beEqualTo(options.channelCountMode); + + options = {channelCountMode: 'max'}; + should( + () => { + node = new PannerNode(context, options); + }, + 'new PannerNode(c, ' + JSON.stringify(options) + ')') + .throw('NotSupportedError'); + + options = {channelCountMode: 'foobar'}; + should( + () => { + node = new PannerNode(context, options); + }, + 'new PannerNode(c, " + JSON.stringify(options) + ")') + .throw('TypeError'); + + // Test channelInterpretation. + options = {channelInterpretation: 'speakers'}; + should( + () => { + node = new PannerNode(context, options); + }, + 'node5 = new PannerNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + should(node.channelInterpretation, 'node5.channelInterpretation') + .beEqualTo(options.channelInterpretation); + + options = {channelInterpretation: 'discrete'}; + should( + () => { + node = new PannerNode(context, options); + }, + 'node6 = new PannerNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + should(node.channelInterpretation, 'node6.channelInterpretation') + .beEqualTo(options.channelInterpretation); + + options = {channelInterpretation: 'foobar'}; + should( + () => { + node = new PannerNode(context, options); + }, + 'new PannerNode(c, ' + JSON.stringify(options) + ')') + .throw('TypeError'); + + task.done(); + }); + + audit.define('constructor with options', (task, should) => { + let node; + let success = true; + let options = { + panningModel: 'HRTF', + // We use full double float values here to verify also that the actual + // AudioParam value is properly rounded to a float. The actual value + // is immaterial as long as x != Math.fround(x). + positionX: Math.SQRT2, + positionY: 2 * Math.SQRT2, + positionZ: 3 * Math.SQRT2, + orientationX: -Math.SQRT2, + orientationY: -2 * Math.SQRT2, + orientationZ: -3 * Math.SQRT2, + distanceModel: 'linear', + // We use full double float values here to verify also that the actual + // attribute is a double float. The actual value is immaterial as + // long as x != Math.fround(x). + refDistance: Math.PI, + maxDistance: 2 * Math.PI, + rolloffFactor: 3 * Math.PI, + coneInnerAngle: 4 * Math.PI, + coneOuterAngle: 5 * Math.PI, + coneOuterGain: 6 * Math.PI + }; + + should( + () => { + node = new PannerNode(context, options); + }, + 'node = new PannerNode(c, ' + JSON.stringify(options) + ')') + .notThrow(); + should(node instanceof PannerNode, 'node instanceof PannerNode') + .beEqualTo(true); + + should(node.panningModel, 'node.panningModel') + .beEqualTo(options.panningModel); + should(node.positionX.value, 'node.positionX.value') + .beEqualTo(Math.fround(options.positionX)); + should(node.positionY.value, 'node.positionY.value') + .beEqualTo(Math.fround(options.positionY)); + should(node.positionZ.value, 'node.positionZ.value') + .beEqualTo(Math.fround(options.positionZ)); + should(node.orientationX.value, 'node.orientationX.value') + .beEqualTo(Math.fround(options.orientationX)); + should(node.orientationY.value, 'node.orientationY.value') + .beEqualTo(Math.fround(options.orientationY)); + should(node.orientationZ.value, 'node.orientationZ.value') + .beEqualTo(Math.fround(options.orientationZ)); + should(node.distanceModel, 'node.distanceModel') + .beEqualTo(options.distanceModel); + should(node.refDistance, 'node.refDistance') + .beEqualTo(options.refDistance); + should(node.maxDistance, 'node.maxDistance') + .beEqualTo(options.maxDistance); + should(node.rolloffFactor, 'node.rolloffFactor') + .beEqualTo(options.rolloffFactor); + should(node.coneInnerAngle, 'node.coneInnerAngle') + .beEqualTo(options.coneInnerAngle); + should(node.coneOuterAngle, 'node.coneOuterAngle') + .beEqualTo(options.coneOuterAngle); + should(node.coneOuterGain, 'node.coneOuterGain') + .beEqualTo(options.coneOuterGain); + + should(node.channelCount, 'node.channelCount').beEqualTo(2); + should(node.channelCountMode, 'node.channelCountMode') + .beEqualTo('clamped-max'); + should(node.channelInterpretation, 'node.channelInterpretation') + .beEqualTo('speakers'); + + task.done(); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-stereopanner-interface/ctor-stereopanner.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-stereopanner-interface/ctor-stereopanner.html new file mode 100644 index 00000000000..9de58cf783a --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-stereopanner-interface/ctor-stereopanner.html @@ -0,0 +1,125 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: StereoPanner + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'StereoPannerNode', context); + task.done(); + }); + + audit.define('default constructor', (task, should) => { + let prefix = 'node0'; + let node = testDefaultConstructor(should, 'StereoPannerNode', context, { + prefix: prefix, + numberOfInputs: 1, + numberOfOutputs: 1, + channelCount: 2, + channelCountMode: 'clamped-max', + channelInterpretation: 'speakers' + }); + + testDefaultAttributes(should, node, prefix, [{name: 'pan', value: 0}]); + + task.done(); + }); + + audit.define('test AudioNodeOptions', (task, should) => { + // Can't use testAudioNodeOptions because the constraints for this node + // are not supported there. + let node; + + // An array of tests. + [{ + // Test that we can set the channel count to 1 or 2 and that other + // channel counts throw an error. + attribute: 'channelCount', + tests: [ + {value: 1}, {value: 2}, {value: 0, error: 'NotSupportedError'}, + {value: 3, error: 'NotSupportedError'}, + {value: 99, error: 'NotSupportedError'} + ] + }, + { + // Test channelCountMode. A mode of "max" is illegal, but others are + // ok. But also throw an error of unknown values. + attribute: 'channelCountMode', + tests: [ + {value: 'clamped-max'}, {value: 'explicit'}, + {value: 'max', error: 'NotSupportedError'}, + {value: 'foobar', error: 'TypeError'} + ] + }, + { + // Test channelInterpretation can be set for valid values and an + // error is thrown for others. + attribute: 'channelInterpretation', + tests: [ + {value: 'speakers'}, {value: 'discrete'}, + {value: 'foobar', error: 'TypeError'} + ] + }].forEach(entry => { + entry.tests.forEach(testItem => { + let options = {}; + options[entry.attribute] = testItem.value; + let method = testItem.error ? 'throw' : 'notThrow'; + + should( + () => { + node = new StereoPannerNode(context, options); + }, + `new StereoPannerNode(c, ${JSON.stringify(options)})`)[method]( + testItem.error); + if (!testItem.error) + should(node[entry.attribute], `node.${entry.attribute}`) + .beEqualTo(options[entry.attribute]); + }); + }); + + task.done(); + }); + + audit.define('constructor with options', (task, should) => { + let node; + let options = { + pan: 0.75, + }; + + should( + () => { + node = new StereoPannerNode(context, options); + }, + 'node1 = new StereoPannerNode(, ' + JSON.stringify(options) + ')') + .notThrow(); + should( + node instanceof StereoPannerNode, + 'node1 instanceof StereoPannerNode') + .beEqualTo(true); + + should(node.pan.value, 'node1.pan.value').beEqualTo(options.pan); + + task.done(); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper.html new file mode 100644 index 00000000000..7aa33ca5aa3 --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper.html @@ -0,0 +1,72 @@ +<!DOCTYPE html> +<html> + <head> + <title> + Test Constructor: WaveShaper + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + <script src="/webaudio/resources/audionodeoptions.js"></script> + </head> + <body> + <script id="layout-test-code"> + let context; + + let audit = Audit.createTaskRunner(); + + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); + }); + + audit.define('incorrect construction', (task, should) => { + testInvalidConstructor(should, 'WaveShaperNode', context); + task.done(); + }); + + audit.define('valid default construction', (task, should) => { + let prefix = 'node0'; + let node = testDefaultConstructor(should, 'WaveShaperNode', context, { + prefix: prefix, + numberOfInputs: 1, + numberOfOutputs: 1, + channelCount: 2, + channelCountMode: 'max', + channelInterpretation: 'speakers' + }); + + testDefaultAttributes(should, node, prefix, [ + {name: 'curve', value: null}, {name: 'oversample', value: 'none'} + ]); + + task.done(); + }); + + audit.define('test AudioNodeOptions', (task, should) => { + testAudioNodeOptions(should, context, 'WaveShaperNode'); + task.done(); + }); + + audit.define('valid non-default', (task, should) => { + // Construct an WaveShaperNode with options + let options = {curve: Float32Array.from([1, 2, 3]), oversample: '4x'}; + let node; + + let message = + 'node1 = new WaveShaperNode(, ' + JSON.stringify(options) + ')'; + should(() => { + node = new WaveShaperNode(context, options); + }, message).notThrow(); + should(node.curve, 'node1.curve').beEqualToArray(options.curve); + should(node.oversample, 'node1.oversample') + .beEqualTo(options.oversample); + + task.done(); + }); + + audit.run(); + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/webdriver/tests/cookies/add_cookie.py b/tests/wpt/web-platform-tests/webdriver/tests/cookies/add_cookie.py index 88b79fba8f6..f865a0827a2 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/cookies/add_cookie.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/cookies/add_cookie.py @@ -1,70 +1,62 @@ -from tests.support.fixtures import clear_all_cookies from datetime import datetime, timedelta +from tests.support.asserts import assert_success +from tests.support.fixtures import clear_all_cookies + + +def add_cookie(session, cookie): + return session.transport.send( + "POST", "session/{session_id}/cookie".format(**vars(session)), + {"cookie": cookie}) + + def test_add_domain_cookie(session, url, server_config): + new_cookie = { + "name": "hello", + "value": "world", + "domain": server_config["browser_host"], + "path": "/", + "httpOnly": False, + "secure": False + } + session.url = url("/common/blank.html") clear_all_cookies(session) - create_cookie_request = { - "cookie": { - "name": "hello", - "value": "world", - "domain": server_config["domains"][""], - "path": "/", - "httpOnly": False, - "secure": False - } - } - result = session.transport.send("POST", "session/%s/cookie" % session.session_id, create_cookie_request) - assert result.status == 200 - assert "value" in result.body - assert result.body["value"] is None - - result = session.transport.send("GET", "session/%s/cookie" % session.session_id) - assert result.status == 200 - assert "value" in result.body - assert isinstance(result.body["value"], list) - assert len(result.body["value"]) == 1 - assert isinstance(result.body["value"][0], dict) - - cookie = result.body["value"][0] + + result = add_cookie(session, new_cookie) + assert_success(result) + + cookie = session.cookies("hello") + assert "domain" in cookie + assert isinstance(cookie["domain"], basestring) assert "name" in cookie assert isinstance(cookie["name"], basestring) assert "value" in cookie assert isinstance(cookie["value"], basestring) - assert "domain" in cookie - assert isinstance(cookie["domain"], basestring) assert cookie["name"] == "hello" assert cookie["value"] == "world" - assert cookie["domain"] == ".%s" % server_config["domains"][""] or cookie["domain"] == "%s" % server_config["domains"][""] + assert cookie["domain"] == server_config["browser_host"] or \ + cookie["domain"] == ".%s" % server_config["browser_host"] + def test_add_cookie_for_ip(session, url, server_config, configuration): - session.url = "http://127.0.0.1:%s/common/blank.html" % (server_config["ports"]["http"][0]) - clear_all_cookies(session) - create_cookie_request = { - "cookie": { - "name": "hello", - "value": "world", - "domain": "127.0.0.1", - "path": "/", - "httpOnly": False, - "secure": False - } + new_cookie = { + "name": "hello", + "value": "world", + "domain": "127.0.0.1", + "path": "/", + "httpOnly": False, + "secure": False } - result = session.transport.send("POST", "session/%s/cookie" % session.session_id, create_cookie_request) - assert result.status == 200 - assert "value" in result.body - assert result.body["value"] is None + session.url = "http://127.0.0.1:%s/common/blank.html" % (server_config["ports"]["http"][0]) + clear_all_cookies(session) - result = session.transport.send("GET", "session/%s/cookie" % session.session_id) - assert result.status == 200 - assert "value" in result.body - assert isinstance(result.body["value"], list) - assert len(result.body["value"]) == 1 - assert isinstance(result.body["value"][0], dict) + result = add_cookie(session, new_cookie) + assert_success(result) - cookie = result.body["value"][0] + cookie = session.cookies("hello") assert "name" in cookie assert isinstance(cookie["name"], basestring) assert "value" in cookie @@ -76,30 +68,24 @@ def test_add_cookie_for_ip(session, url, server_config, configuration): assert cookie["value"] == "world" assert cookie["domain"] == "127.0.0.1" + def test_add_non_session_cookie(session, url): + a_year_from_now = int( + (datetime.utcnow() + timedelta(days=365) - datetime.utcfromtimestamp(0)).total_seconds()) + + new_cookie = { + "name": "hello", + "value": "world", + "expiry": a_year_from_now + } + session.url = url("/common/blank.html") clear_all_cookies(session) - a_year_from_now = int((datetime.utcnow() + timedelta(days=365) - datetime.utcfromtimestamp(0)).total_seconds()) - create_cookie_request = { - "cookie": { - "name": "hello", - "value": "world", - "expiry": a_year_from_now - } - } - result = session.transport.send("POST", "session/%s/cookie" % session.session_id, create_cookie_request) - assert result.status == 200 - assert "value" in result.body - assert result.body["value"] is None - - result = session.transport.send("GET", "session/%s/cookie" % session.session_id) - assert result.status == 200 - assert "value" in result.body - assert isinstance(result.body["value"], list) - assert len(result.body["value"]) == 1 - assert isinstance(result.body["value"][0], dict) - - cookie = result.body["value"][0] + + result = add_cookie(session, new_cookie) + assert_success(result) + + cookie = session.cookies("hello") assert "name" in cookie assert isinstance(cookie["name"], basestring) assert "value" in cookie @@ -111,28 +97,20 @@ def test_add_non_session_cookie(session, url): assert cookie["value"] == "world" assert cookie["expiry"] == a_year_from_now + def test_add_session_cookie(session, url): + new_cookie = { + "name": "hello", + "value": "world" + } + session.url = url("/common/blank.html") clear_all_cookies(session) - create_cookie_request = { - "cookie": { - "name": "hello", - "value": "world" - } - } - result = session.transport.send("POST", "session/%s/cookie" % session.session_id, create_cookie_request) - assert result.status == 200 - assert "value" in result.body - assert result.body["value"] is None - - result = session.transport.send("GET", "session/%s/cookie" % session.session_id) - assert result.status == 200 - assert "value" in result.body - assert isinstance(result.body["value"], list) - assert len(result.body["value"]) == 1 - assert isinstance(result.body["value"][0], dict) - - cookie = result.body["value"][0] + + result = add_cookie(session, new_cookie) + assert_success(result) + + cookie = session.cookies("hello") assert "name" in cookie assert isinstance(cookie["name"], basestring) assert "value" in cookie @@ -143,29 +121,21 @@ def test_add_session_cookie(session, url): assert cookie["name"] == "hello" assert cookie["value"] == "world" + def test_add_session_cookie_with_leading_dot_character_in_domain(session, url, server_config): + new_cookie = { + "name": "hello", + "value": "world", + "domain": ".%s" % server_config["browser_host"] + } + session.url = url("/common/blank.html") clear_all_cookies(session) - create_cookie_request = { - "cookie": { - "name": "hello", - "value": "world", - "domain": ".%s" % server_config["domains"][""] - } - } - result = session.transport.send("POST", "session/%s/cookie" % session.session_id, create_cookie_request) - assert result.status == 200 - assert "value" in result.body - assert result.body["value"] is None - - result = session.transport.send("GET", "session/%s/cookie" % session.session_id) - assert result.status == 200 - assert "value" in result.body - assert isinstance(result.body["value"], list) - assert len(result.body["value"]) == 1 - assert isinstance(result.body["value"][0], dict) - - cookie = result.body["value"][0] + + result = add_cookie(session, new_cookie) + assert_success(result) + + cookie = session.cookies("hello") assert "name" in cookie assert isinstance(cookie["name"], basestring) assert "value" in cookie @@ -175,4 +145,5 @@ def test_add_session_cookie_with_leading_dot_character_in_domain(session, url, s assert cookie["name"] == "hello" assert cookie["value"] == "world" - assert cookie["domain"] == ".%s" % server_config["domains"][""] or cookie["domain"] == "%s" % server_config["domains"][""] + assert cookie["domain"] == server_config["browser_host"] or \ + cookie["domain"] == ".%s" % server_config["browser_host"] diff --git a/tests/wpt/web-platform-tests/xhr/close-worker-with-xhr-in-progress.html b/tests/wpt/web-platform-tests/xhr/close-worker-with-xhr-in-progress.html new file mode 100644 index 00000000000..4d03bea028f --- /dev/null +++ b/tests/wpt/web-platform-tests/xhr/close-worker-with-xhr-in-progress.html @@ -0,0 +1,26 @@ +<!doctype html> +<html> +<head> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> +async_test(t => { + function workerCode(origin) { + const xhr = new XMLHttpRequest(); + xhr.open('GET', origin + '/xhr/resources/image.gif?pipe=trickle(100:d2)', true); + xhr.responseType = 'blob'; + xhr.send(); + postMessage('sent'); + } + + const workerBlob = new Blob([workerCode.toString() + ";workerCode('" + location.origin + "');"], {type:"application/javascript"}); + const w = new Worker(URL.createObjectURL(workerBlob)); + w.onmessage = t.step_func(e => { + assert_equals(e.data, 'sent'); + t.step_timeout(t.step_func(() => { + w.terminate(); + t.step_timeout(t.step_func_done(() => {}), 500); + }, 100)); + }); +}, 'Terminating a worker with a XHR in progress doesn\'t crash'); +</script> |