diff options
author | WPT Sync Bot <josh+wptsync@joshmatthews.net> | 2018-03-23 21:12:55 -0400 |
---|---|---|
committer | WPT Sync Bot <josh+wptsync@joshmatthews.net> | 2018-03-23 22:48:00 -0400 |
commit | 2b35c55ac731d7994eec1bbd6c975662bf8c5e5c (patch) | |
tree | 13eb211efee02e9160438d12d287fec7ebc33b5f | |
parent | e8fdc677f440919507209ed42d0ea042c700042c (diff) | |
download | servo-2b35c55ac731d7994eec1bbd6c975662bf8c5e5c.tar.gz servo-2b35c55ac731d7994eec1bbd6c975662bf8c5e5c.zip |
Update web-platform-tests to revision d04a8fc02b85bd32799691759c8c05ead07cd939
63 files changed, 2068 insertions, 340 deletions
diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 2c1ba620819..d149292edfb 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -127149,6 +127149,30 @@ {} ] ], + "css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-vertical-rl.html": [ + [ + "/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-vertical-rl.html", + [ + [ + "/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-vertical-rl-ref.html", + "==" + ] + ], + {} + ] + ], + "css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row.html": [ + [ + "/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row.html", + [ + [ + "/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-tables/internal-containing-block-001.html": [ [ "/css/css-tables/internal-containing-block-001.html", @@ -251770,6 +251794,16 @@ {} ] ], + "css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-ref.html": [ + [ + {} + ] + ], + "css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-vertical-rl-ref.html": [ + [ + {} + ] + ], "css/css-tables/support/base.css": [ [ {} @@ -272445,6 +272479,11 @@ {} ] ], + "fonts/math/largeop-displayoperatorminheight2000-2AFF-italiccorrection3000.woff": [ + [ + {} + ] + ], "fonts/math/largeop-displayoperatorminheight5000.woff": [ [ {} @@ -285330,6 +285369,11 @@ {} ] ], + "interfaces/keyboard-lock.idl": [ + [ + {} + ] + ], "interfaces/magnetometer.idl": [ [ {} @@ -285405,6 +285449,11 @@ {} ] ], + "interfaces/web-animations.idl": [ + [ + {} + ] + ], "interfaces/web-nfc.idl": [ [ {} @@ -297780,6 +297829,21 @@ {} ] ], + "workers/modules/resources/nested-static-import-worker.js": [ + [ + {} + ] + ], + "workers/modules/resources/post-message-on-load-worker.js": [ + [ + {} + ] + ], + "workers/modules/resources/static-import-worker.js": [ + [ + {} + ] + ], "workers/non-automated/application-cache-dedicated.html": [ [ {} @@ -313643,6 +313707,12 @@ {} ] ], + "css/css-grid/grid-definition/grid-inline-auto-repeat-001.html": [ + [ + "/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html", + {} + ] + ], "css/css-grid/grid-definition/grid-inline-support-flexible-lengths-001.html": [ [ "/css/css-grid/grid-definition/grid-inline-support-flexible-lengths-001.html", @@ -315401,6 +315471,12 @@ {} ] ], + "css/css-tables/width-distribution/td-with-subpixel-padding-vertical-rl.html": [ + [ + "/css/css-tables/width-distribution/td-with-subpixel-padding-vertical-rl.html", + {} + ] + ], "css/css-tables/width-distribution/td-with-subpixel-padding.html": [ [ "/css/css-tables/width-distribution/td-with-subpixel-padding.html", @@ -317285,6 +317361,12 @@ {} ] ], + "css/css-typed-om/the-stylepropertymap/properties/column-span.html": [ + [ + "/css/css-typed-om/the-stylepropertymap/properties/column-span.html", + {} + ] + ], "css/css-typed-om/the-stylepropertymap/properties/direction.html": [ [ "/css/css-typed-om/the-stylepropertymap/properties/direction.html", @@ -321727,6 +321809,12 @@ } ] ], + "dom/ranges/Range-intersectsNode-2.html": [ + [ + "/dom/ranges/Range-intersectsNode-2.html", + {} + ] + ], "dom/ranges/Range-intersectsNode-binding.html": [ [ "/dom/ranges/Range-intersectsNode-binding.html", @@ -324841,6 +324929,16 @@ {} ] ], + "fetch/api/cors/cors-cookies-redirect.any.js": [ + [ + "/fetch/api/cors/cors-cookies-redirect.any.html", + {} + ], + [ + "/fetch/api/cors/cors-cookies-redirect.any.worker.html", + {} + ] + ], "fetch/api/cors/cors-cookies.any.js": [ [ "/fetch/api/cors/cors-cookies.any.html", @@ -338655,27 +338753,27 @@ {} ] ], - "keyboard-lock/navigator-keyboardLock-two-parallel-requests.https.html": [ + "keyboard-lock/navigator-keyboard-lock-two-parallel-requests.https.html": [ [ - "/keyboard-lock/navigator-keyboardLock-two-parallel-requests.https.html", + "/keyboard-lock/navigator-keyboard-lock-two-parallel-requests.https.html", {} ] ], - "keyboard-lock/navigator-keyboardLock-two-sequential-requests.https.html": [ + "keyboard-lock/navigator-keyboard-lock-two-sequential-requests.https.html": [ [ - "/keyboard-lock/navigator-keyboardLock-two-sequential-requests.https.html", + "/keyboard-lock/navigator-keyboard-lock-two-sequential-requests.https.html", {} ] ], - "keyboard-lock/navigator-keyboardLock.https.html": [ + "keyboard-lock/navigator-keyboard-lock.https.html": [ [ - "/keyboard-lock/navigator-keyboardLock.https.html", + "/keyboard-lock/navigator-keyboard-lock.https.html", {} ] ], - "keyboard-lock/navigator-keyboardUnlock.https.html": [ + "keyboard-lock/navigator-keyboard-unlock.https.html": [ [ - "/keyboard-lock/navigator-keyboardUnlock.https.html", + "/keyboard-lock/navigator-keyboard-unlock.https.html", {} ] ], @@ -338853,6 +338951,12 @@ {} ] ], + "mathml/presentation-markup/scripts/subsup-parameters-2.html": [ + [ + "/mathml/presentation-markup/scripts/subsup-parameters-2.html", + {} + ] + ], "mathml/presentation-markup/scripts/underover-1.html": [ [ "/mathml/presentation-markup/scripts/underover-1.html", @@ -350439,6 +350543,12 @@ {} ] ], + "payment-request/PaymentItem/type_member.https.html": [ + [ + "/payment-request/PaymentItem/type_member.https.html", + {} + ] + ], "payment-request/PaymentRequestUpdateEvent/constructor.http.html": [ [ "/payment-request/PaymentRequestUpdateEvent/constructor.http.html", @@ -350561,6 +350671,12 @@ {} ] ], + "payment-request/payment-request-insecure.http.html": [ + [ + "/payment-request/payment-request-insecure.http.html", + {} + ] + ], "payment-request/payment-request-not-exposed.https.worker.js": [ [ "/payment-request/payment-request-not-exposed.https.worker.html", @@ -361221,6 +361337,12 @@ {} ] ], + "shadow-dom/Element-interface-attachShadow-custom-element.html": [ + [ + "/shadow-dom/Element-interface-attachShadow-custom-element.html", + {} + ] + ], "shadow-dom/Element-interface-attachShadow.html": [ [ "/shadow-dom/Element-interface-attachShadow.html", @@ -369797,6 +369919,18 @@ {} ] ], + "workers/modules/dedicated-worker-options-type.html": [ + [ + "/workers/modules/dedicated-worker-options-type.html", + {} + ] + ], + "workers/modules/dedicated-worker-static-import.html": [ + [ + "/workers/modules/dedicated-worker-static-import.html", + {} + ] + ], "workers/name-property.html": [ [ "/workers/name-property.html", @@ -391299,7 +391433,7 @@ "support" ], "./.gitignore": [ - "4c0250a2fdf8f32f9df4db278c03f0a8722a90d7", + "551fbbbbeb5571fc8dfec671e248125097947728", "support" ], "./.gitmodules": [ @@ -396967,7 +397101,7 @@ "testharness" ], "IndexedDB/interfaces.any.js": [ - "df07f5da63c34969a24fe43bc4268418ab0a5132", + "ae562d6b568c1005c5eef5a230b8869729719dff", "testharness" ], "IndexedDB/interleaved-cursors-common.js": [ @@ -419495,7 +419629,7 @@ "support" ], "conformance-checkers/messages.json": [ - "ba6a1cf2867273360e8c9b7bb70da15bca4e15a7", + "5bbf4e62a4f95fdaf4528c20eb824006d2042582", "support" ], "conformance-checkers/tools/build-svg-tests.py": [ @@ -422507,7 +422641,7 @@ "testharness" ], "cookie-store/idlharness.tentative.html": [ - "24a4e59e8d3c0a481c4b448bd3fb677f30d0208f", + "8654087597cc0c11b880b0144897dab26691d12a", "testharness" ], "cookie-store/idlharness_serviceworker.js": [ @@ -501102,6 +501236,10 @@ "d00e8651be933262d7f64d22f6e8ce68d23d44eb", "testharness" ], + "css/css-grid/grid-definition/grid-inline-auto-repeat-001.html": [ + "dd057e3ae1332c813ae60dc0bf29b948b24e7f47", + "testharness" + ], "css/css-grid/grid-definition/grid-inline-support-flexible-lengths-001.html": [ "99215a797996322c89105b8ca5cb426628ec7563", "testharness" @@ -509654,6 +509792,22 @@ "55a759d84f38e6adf0f091c9c0ecaa69060cb51a", "testharness" ], + "css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-ref.html": [ + "2bb8a26451a23ebcf548ad147d301ea5d9603c25", + "support" + ], + "css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-vertical-rl-ref.html": [ + "bfb2b402c1887841f89fc7954a2cccacd3babab6", + "support" + ], + "css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-vertical-rl.html": [ + "67b7a983d1fed1a754356ba3a3359c60d9575d38", + "reftest" + ], + "css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row.html": [ + "da90cdb16cb229c4856df7c4ad14bf49d51b900d", + "reftest" + ], "css/css-tables/html-to-css-mapping-1.html": [ "55cf746ad6557259534e38a4879d7b6f5a994d6c", "testharness" @@ -509874,6 +510028,10 @@ "9eeb49d2d78c3f81825de0d9e24de2a097275175", "testharness" ], + "css/css-tables/width-distribution/td-with-subpixel-padding-vertical-rl.html": [ + "cf3f3ffb0dba2dc13f753f9a584084c9f070a48c", + "testharness" + ], "css/css-tables/width-distribution/td-with-subpixel-padding.html": [ "b93845c332e5153c8a28085303b165d3c96f984e", "testharness" @@ -522570,6 +522728,10 @@ "ec00a4b773f2ae421b8f688908925e28d2281614", "testharness" ], + "css/css-typed-om/the-stylepropertymap/properties/column-span.html": [ + "276ec2870bc105b046669daa0bdbeffdb080479c", + "testharness" + ], "css/css-typed-om/the-stylepropertymap/properties/direction.html": [ "b7c49aba4e8785f819beeb444c113d937d441089", "testharness" @@ -546770,6 +546932,10 @@ "c6c16aeceb585d7587e7447964112786f87700cd", "testharness" ], + "dom/ranges/Range-intersectsNode-2.html": [ + "9b613f401c6ef6bc9ef70fc43a83df4130d9149c", + "testharness" + ], "dom/ranges/Range-intersectsNode-binding.html": [ "93ac9f3cc9b506760b685b074cb0f66ea69bebb7", "testharness" @@ -550342,6 +550508,10 @@ "e6326b75fe6449f211ad19b98a9c1d7ed8c7c27f", "testharness" ], + "fetch/api/cors/cors-cookies-redirect.any.js": [ + "700c33865dbb6d6dfe63fc08f646d120e7966484", + "testharness" + ], "fetch/api/cors/cors-cookies.any.js": [ "246a6e661ef1179330f9109131cfcb2fa9f5bf64", "testharness" @@ -550931,7 +551101,7 @@ "support" ], "fetch/api/resources/inspect-headers.py": [ - "c9ac2870a45253664da7de1aaf82626fdd1482bb", + "c062c905d538cfa96156fd38d98f586b2c4fb3b5", "support" ], "fetch/api/resources/keepalive-iframe.html": [ @@ -550951,7 +551121,7 @@ "support" ], "fetch/api/resources/redirect.py": [ - "79c8b1bcad05e05a7b628edb22fdaedbdf2c3bc5", + "37307bdb30853c2e824cce1fd9a190741e4975ce", "support" ], "fetch/api/resources/script-with-header.py": [ @@ -551730,6 +551900,10 @@ "a218eeab3238839be7d0cc8c326e57d59bd51f83", "support" ], + "fonts/math/largeop-displayoperatorminheight2000-2AFF-italiccorrection3000.woff": [ + "8ace2a167d3e3a7f27af99431b5626834dac53a8", + "support" + ], "fonts/math/largeop-displayoperatorminheight5000.woff": [ "04f15e131b1ae051eeddbfda429ca154d2c6bda0", "support" @@ -552467,7 +552641,7 @@ "testharness" ], "hr-time/idlharness.html": [ - "f2cdcba041df089206cc9c811167c41a771905df", + "579176cad14656ca5cdc616dd1323dc38a5b62ba", "testharness" ], "hr-time/monotonic-clock.any.js": [ @@ -567187,7 +567361,7 @@ "testharness" ], "html/semantics/forms/the-select-element/selected-index.html": [ - "3dbf338e9065f7f4ad2abfbaa55cf50329768cc2", + "98b59224f658d97a782623a054e5c3c5611945a2", "testharness" ], "html/semantics/forms/the-textarea-element/.gitkeep": [ @@ -572147,7 +572321,11 @@ "support" ], "interfaces/html.idl": [ - "b2b35732b54cbe3406493a6c121363eccceb4f5c", + "7b9b8b054ad2848e7c5983e46222fbdf8b3b8da8", + "support" + ], + "interfaces/keyboard-lock.idl": [ + "7188a9233db3acc741650d46156e16e9e7a132fa", "support" ], "interfaces/magnetometer.idl": [ @@ -572210,6 +572388,10 @@ "7d0ee3d60a923bf454e18f9116cded1cc3a16f9b", "support" ], + "interfaces/web-animations.idl": [ + "8d00ee62fafedfd3e24925f48eed6ba26b5aafc7", + "support" + ], "interfaces/web-nfc.idl": [ "105e771bdd9587f029091a5ed590187ed6e86e2a", "support" @@ -572435,23 +572617,23 @@ "testharness" ], "keyboard-lock/idlharness.https.html": [ - "4b41c1c46a8f7d2374d0ff9d796f3f938c1f74d8", + "010771094a9dc58e03a2c1ca2d8416866284fc2b", "testharness" ], - "keyboard-lock/navigator-keyboardLock-two-parallel-requests.https.html": [ - "ee6fe59233abea9325bf7f5e14c1472a72e45a11", + "keyboard-lock/navigator-keyboard-lock-two-parallel-requests.https.html": [ + "b594f75f5b0c89c2a5f2b934d170b8ff81ad9839", "testharness" ], - "keyboard-lock/navigator-keyboardLock-two-sequential-requests.https.html": [ - "02ad8f54b7cebed96553bd96bbd7e8fc0227d3b1", + "keyboard-lock/navigator-keyboard-lock-two-sequential-requests.https.html": [ + "8990cc5772cdba1281c0a05c6a3c2a80b08b810e", "testharness" ], - "keyboard-lock/navigator-keyboardLock.https.html": [ - "572f4e827bc3807f4c71641e102d7bac9df3e391", + "keyboard-lock/navigator-keyboard-lock.https.html": [ + "f95f8408986d73501ec7cce09106a8536bd891b4", "testharness" ], - "keyboard-lock/navigator-keyboardUnlock.https.html": [ - "c4de12456714a34fb791b070304da31c99da080f", + "keyboard-lock/navigator-keyboard-unlock.https.html": [ + "f5cc2141ea7c74964d308784901d6d2c242f4369", "testharness" ], "longtask-timing/OWNERS": [ @@ -572622,6 +572804,10 @@ "a9198166947a3d181d21d2597d167d3962c67f6e", "testharness" ], + "mathml/presentation-markup/scripts/subsup-parameters-2.html": [ + "3f3d721e1f0eec90d0b173f02f01a5d4ac16a8cc", + "testharness" + ], "mathml/presentation-markup/scripts/underover-1.html": [ "372c5f1e01a0fe5e3350579985e4f586838c0ed2", "testharness" @@ -572975,7 +573161,7 @@ "support" ], "mathml/tools/largeop.py": [ - "46adcf9fce7218942711b6ca3742d74fce096c7f", + "cbf53783db1381e6fb0d22296d395104c4b6b545", "support" ], "mathml/tools/limits.py": [ @@ -581930,6 +582116,10 @@ "7bfce9810c1afdc53a99fa0036c472f6cfbe5deb", "testharness" ], + "payment-request/PaymentItem/type_member.https.html": [ + "5568f96eac7b0ebf1d91d468bb30b9eaa8b1a9f0", + "testharness" + ], "payment-request/PaymentRequestUpdateEvent/constructor.http.html": [ "017f1f1aca43171083833ddb27ff66e39902e85d", "testharness" @@ -582054,6 +582244,10 @@ "34dd889e8bc906eb9a99c192e547fab831099f7c", "testharness" ], + "payment-request/payment-request-insecure.http.html": [ + "34452230c20571ef161fa237130faea57240f532", + "testharness" + ], "payment-request/payment-request-not-exposed.https.worker.js": [ "b1c3cdc182cb967ec11b1cad826b333511203d77", "testharness" @@ -582151,7 +582345,7 @@ "support" ], "payment-request/show-method-postmessage-manual.https.html": [ - "d2be1d2872a473a48df7139ecd3804f33187ec8f", + "e9ca854ea9e13e7b662f0fa66890832bb2f13b69", "manual" ], "payment-request/updateWith-method-pmi-handling-manual.https.html": [ @@ -594330,6 +594524,10 @@ "e33e48a3eb754e961f07b7850caff67eee38fe69", "testharness" ], + "shadow-dom/Element-interface-attachShadow-custom-element.html": [ + "4628a8a6e145713c7e0e9df0960d51e34df2fc53", + "testharness" + ], "shadow-dom/Element-interface-attachShadow.html": [ "e5b4dedaf8f78a6ce771af4509da8acb3aca3441", "testharness" @@ -600963,7 +601161,7 @@ "testharness" ], "web-animations/interfaces/Animation/idlharness.html": [ - "b049999bb0512bfa0c3eb8b60176eb9213d663f7", + "c73f39e1c27f1b04b4c44ac4e1e747ef3d24b287", "testharness" ], "web-animations/interfaces/Animation/oncancel.html": [ @@ -601007,7 +601205,7 @@ "testharness" ], "web-animations/interfaces/AnimationPlaybackEvent/idlharness.html": [ - "bfdfc896fb5fe4451419464e35fe94b5e4938c2c", + "d9fc177ebbc3fa0317125912e38a4bfd65f727c8", "testharness" ], "web-animations/interfaces/Document/getAnimations.html": [ @@ -601023,7 +601221,7 @@ "testharness" ], "web-animations/interfaces/DocumentTimeline/idlharness.html": [ - "72cb7900f86611e9c2a1b0f4acd0f634555310b9", + "b811b4367df7d4f2a43955323f9ddb5b0a60da14", "testharness" ], "web-animations/interfaces/KeyframeEffect/composite.html": [ @@ -601039,7 +601237,7 @@ "testharness" ], "web-animations/interfaces/KeyframeEffect/idlharness.html": [ - "ffe493133d4029820f8b27389a15157706b738e8", + "c65dd7fd3c76ac1e5d6f22dbd36544f7900cd992", "testharness" ], "web-animations/interfaces/KeyframeEffect/iterationComposite.html": [ @@ -601339,7 +601537,7 @@ "testharness" ], "webaudio/idlharness.https.html": [ - "7876e16ea643f69315e18c3e17af0d7f95769420", + "f42681173fdf4cb8dad2049351f55f3a7ff0fcac", "testharness" ], "webaudio/js/buffer-loader.js": [ @@ -602951,7 +603149,7 @@ "testharness" ], "webrtc/RTCPeerConnection-setLocalDescription-offer.html": [ - "9f30ee4801fbcd574d90c3f15a733c448f148649", + "117fc91599d11b63f2d232a63bace8e367dbb72a", "testharness" ], "webrtc/RTCPeerConnection-setLocalDescription-pranswer.html": [ @@ -608030,6 +608228,26 @@ "6bffa3be83d81e2faa93119e710e4fee93fb855e", "testharness" ], + "workers/modules/dedicated-worker-options-type.html": [ + "9f6f1be759beb885e2baa746e36ace83685f649b", + "testharness" + ], + "workers/modules/dedicated-worker-static-import.html": [ + "d0d3dc37a8c061a1dc5213f8fe79e7f985c48b81", + "testharness" + ], + "workers/modules/resources/nested-static-import-worker.js": [ + "eb76ec7e8a0f9df6de7114e3aa9100f8374fea8f", + "support" + ], + "workers/modules/resources/post-message-on-load-worker.js": [ + "c67a79ade775435a67e5999d17e7cdda450c8e50", + "support" + ], + "workers/modules/resources/static-import-worker.js": [ + "f3020118d7e499e0e910abc7a733e0b9c3cf1e5a", + "support" + ], "workers/name-property.html": [ "1c53fc1fdc2d6c8ed5592d832a18bdbd3bca541b", "testharness" 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/dom/interfaces.html.ini b/tests/wpt/metadata/dom/interfaces.html.ini index a1bd285b66b..62a37f6dcfc 100644 --- a/tests/wpt/metadata/dom/interfaces.html.ini +++ b/tests/wpt/metadata/dom/interfaces.html.ini @@ -921,3 +921,6 @@ [Range interface: existence and properties of interface prototype object] expected: FAIL + [Test driver] + expected: FAIL + diff --git a/tests/wpt/metadata/fetch/api/cors/cors-cookies-redirect.any.js.ini b/tests/wpt/metadata/fetch/api/cors/cors-cookies-redirect.any.js.ini new file mode 100644 index 00000000000..a2543058306 --- /dev/null +++ b/tests/wpt/metadata/fetch/api/cors/cors-cookies-redirect.any.js.ini @@ -0,0 +1,9 @@ +[cors-cookies-redirect.any.worker.html] + [Untitled] + expected: FAIL + + +[cors-cookies-redirect.any.html] + [Untitled] + expected: FAIL + diff --git a/tests/wpt/metadata/hr-time/idlharness.html.ini b/tests/wpt/metadata/hr-time/idlharness.html.ini index 1b082bfa85f..e4cee0cde04 100644 --- a/tests/wpt/metadata/hr-time/idlharness.html.ini +++ b/tests/wpt/metadata/hr-time/idlharness.html.ini @@ -27,3 +27,9 @@ [Performance interface: window.performance must inherit property "toJSON()" with the proper type] expected: FAIL + [Test driver] + expected: FAIL + + [Stringification of window.performance] + expected: FAIL + diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini index 88656c22113..7c87c9bd1a8 100644 --- a/tests/wpt/metadata/html/dom/interfaces.html.ini +++ b/tests/wpt/metadata/html/dom/interfaces.html.ini @@ -13992,3 +13992,24 @@ [HTMLMarqueeElement interface: existence and properties of interface prototype object's @@unscopables property] expected: FAIL + [SVGElement interface: attribute dataset] + expected: FAIL + + [SVGElement interface: attribute nonce] + expected: FAIL + + [SVGElement interface: attribute tabIndex] + expected: FAIL + + [SVGElement interface: operation focus(FocusOptions)] + expected: FAIL + + [SVGElement interface: operation blur()] + expected: FAIL + + [HTMLElement interface: attribute nonce] + expected: FAIL + + [HTMLElement interface: document.createElement("noscript") must inherit property "nonce" with the proper type] + expected: FAIL + diff --git a/tests/wpt/metadata/navigation-timing/idlharness.html.ini b/tests/wpt/metadata/navigation-timing/idlharness.html.ini index 71e53d7cf85..bae322d90e6 100644 --- a/tests/wpt/metadata/navigation-timing/idlharness.html.ini +++ b/tests/wpt/metadata/navigation-timing/idlharness.html.ini @@ -1,5 +1,6 @@ [idlharness.html] type: testharness + expected: ERROR [PerformanceTiming interface: attribute unloadEventStart] expected: FAIL diff --git a/tests/wpt/metadata/performance-timeline/idlharness.html.ini b/tests/wpt/metadata/performance-timeline/idlharness.html.ini index 173fc1c6a27..39aea95bb4f 100644 --- a/tests/wpt/metadata/performance-timeline/idlharness.html.ini +++ b/tests/wpt/metadata/performance-timeline/idlharness.html.ini @@ -12,3 +12,6 @@ [PerformanceObserver interface: operation takeRecords()] expected: FAIL + [Test default toJSON operation of PerformanceMark] + expected: FAIL + diff --git a/tests/wpt/metadata/workers/modules/dedicated-worker-options-type.html.ini b/tests/wpt/metadata/workers/modules/dedicated-worker-options-type.html.ini new file mode 100644 index 00000000000..3bd93ae74ec --- /dev/null +++ b/tests/wpt/metadata/workers/modules/dedicated-worker-options-type.html.ini @@ -0,0 +1,7 @@ +[dedicated-worker-options-type.html] + [Test worker construction with an empty worker type.] + expected: FAIL + + [Test worker construction with an unknown worker type.] + expected: FAIL + diff --git a/tests/wpt/metadata/workers/modules/dedicated-worker-static-import.html.ini b/tests/wpt/metadata/workers/modules/dedicated-worker-static-import.html.ini new file mode 100644 index 00000000000..aeae8758af5 --- /dev/null +++ b/tests/wpt/metadata/workers/modules/dedicated-worker-static-import.html.ini @@ -0,0 +1,8 @@ +[dedicated-worker-static-import.html] + expected: ERROR + [Test static import on DedicatedWorkerGlobalScope.] + expected: TIMEOUT + + [Test nested static import on DedicatedWorkerGlobalScope.] + expected: NOTRUN + diff --git a/tests/wpt/web-platform-tests/.gitignore b/tests/wpt/web-platform-tests/.gitignore index 358ea4b3ff4..fd6a495c415 100644 --- a/tests/wpt/web-platform-tests/.gitignore +++ b/tests/wpt/web-platform-tests/.gitignore @@ -4,6 +4,7 @@ _venv/ .cache/ .pytest_cache/ +.tox/ # Node node_modules/ diff --git a/tests/wpt/web-platform-tests/IndexedDB/interfaces.any.js b/tests/wpt/web-platform-tests/IndexedDB/interfaces.any.js index f142db45bcb..f1b2a993e47 100644 --- a/tests/wpt/web-platform-tests/IndexedDB/interfaces.any.js +++ b/tests/wpt/web-platform-tests/IndexedDB/interfaces.any.js @@ -9,8 +9,7 @@ promise_test(async t => { ].map(url => fetch(url).then(response => response.text()))); const idl_array = new IdlArray(); - idl_array.add_untested_idls('interface LinkStyle {};'); // Needed by html - idl_array.add_untested_idls(html); + idl_array.add_untested_idls(html, { only: ['WindowOrWorkerGlobalScope'] }); idl_array.add_untested_idls(dom); idl_array.add_idls(indexeddb); idl_array.add_objects({ diff --git a/tests/wpt/web-platform-tests/conformance-checkers/messages.json b/tests/wpt/web-platform-tests/conformance-checkers/messages.json index 73e1d6910fc..1bdb90d2e3a 100644 --- a/tests/wpt/web-platform-tests/conformance-checkers/messages.json +++ b/tests/wpt/web-platform-tests/conformance-checkers/messages.json @@ -968,8 +968,8 @@ "html/elements/img/usemap-bad-value-novalid.html": "Bad value \u201c#\u201d for attribute \u201cusemap\u201d on element \u201cimg\u201d: Bad hash-name reference: A hash-name reference must have at least one character after \u201c#\u201d.", "html/elements/img/width-height-negative-novalid.html": "Bad value \u201c-1\u201d for attribute \u201cwidth\u201d on element \u201cimg\u201d: Bad non-negative integer: Expected a digit but saw \u201c-\u201d instead.", "html/elements/input/list-novalid.html": "The \u201clist\u201d attribute of the \u201cinput\u201d element must refer to a \u201cdatalist\u201d element.", - "html/elements/input/pattern-asterisk-novalid.html": "Bad value \u201c*\u201d for attribute \u201cpattern\u201d on element \u201cinput\u201d: Bad pattern: Invalid regular expression: \u201c*\u201d: Nothing to repeat.", - "html/elements/input/pattern-paren-novalid.html": "Bad value \u201c(\u201d for attribute \u201cpattern\u201d on element \u201cinput\u201d: Bad pattern: Invalid regular expression: \u201c(\u201d: Unterminated group.", + "html/elements/input/pattern-asterisk-novalid.html": "Bad value \u201c*\u201d for attribute \u201cpattern\u201d on element \u201cinput\u201d: Bad pattern: Dangling meta character '*' near index 0", + "html/elements/input/pattern-paren-novalid.html": "Bad value \u201c(\u201d for attribute \u201cpattern\u201d on element \u201cinput\u201d: Bad pattern: Unclosed group near index 1", "html/elements/input/type-image-formaction-empty-novalid.html": "Bad value \u201c\u201d for attribute \u201cformaction\u201d on element \u201cinput\u201d: Bad URL: Must be non-empty.", "html/elements/input/type-image-formaction-whitespace-only-novalid.html": "Bad value \u201c\t \n\u201d for attribute \u201cformaction\u201d on element \u201cinput\u201d: Bad URL: Must be non-empty.", "html/elements/input/type-image-formaction/fragment-backslash-novalid.html": "Bad value \u201c#\\\u201d for attribute \u201cformaction\u201d on element \u201cinput\u201d: Bad URL: Illegal character in fragment: \u201c\\\u201d is not allowed.", diff --git a/tests/wpt/web-platform-tests/cookie-store/idlharness.tentative.html b/tests/wpt/web-platform-tests/cookie-store/idlharness.tentative.html index 648d567a9e9..e9ffab3730f 100644 --- a/tests/wpt/web-platform-tests/cookie-store/idlharness.tentative.html +++ b/tests/wpt/web-platform-tests/cookie-store/idlharness.tentative.html @@ -19,6 +19,7 @@ promise_test(async t => { // Dependencies of HTML idl_array.add_untested_idls('interface Document {};'); idl_array.add_untested_idls('interface LinkStyle {};'); + idl_array.add_untested_idls('interface SVGElement {};'); idl_array.add_untested_idls(html); idl_array.add_untested_idls('interface Event {};'); diff --git a/tests/wpt/web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html b/tests/wpt/web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html new file mode 100644 index 00000000000..b06ffe5e43a --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html @@ -0,0 +1,48 @@ +<!DOCTYPE html> +<html lang=en> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: auto repeat tracks in indefinite containers with minimum size</title> +<link rel="author" title="Sergio Villar Senin" href="mailto:svillar@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-grid-1/#repeat-syntax"> +<meta name="assert" content="This test checks that we properly compute the number of required auto repeat tracks in indefinite sized containers with minimum sizes."> +<link rel="stylesheet" href="support/grid.css"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="support/testing-utils.js"></script> +<style> +.grid { + display: inline-grid; + grid: 20px / 20px; + min-width: 20px; + min-height: 20px; + justify-content: start; + align-content: start; +} +</style> +<div id="log"></div> + +<div id="autoFillColumns" class="grid"></div> +<div id="autoFitColumns" class="grid"></div> + +<div id="autoFillRows" class="grid"></div> +<div id="autoFitRows" class="grid"></div> + +<script> +// Exact fit +TestingUtils.testGridTemplateColumnsRows("autoFillColumns", "repeat(auto-fill, 10px)", "20px", ["repeat(2, 10px)", "10px 10px"], "20px"); +TestingUtils.testGridTemplateColumnsRows("autoFitColumns", "repeat(auto-fit, 10px)", "20px", ["repeat(2, 0px)", "0px 0px"], "20px"); +TestingUtils.testGridTemplateColumnsRows("autoFillRows", "20px", "repeat(auto-fill, 10px)", "20px", ["repeat(2, 10px)", "10px 10px"]); +TestingUtils.testGridTemplateColumnsRows("autoFitRows", "20px", "repeat(auto-fit, 10px)", "20px", ["repeat(2, 0px)", "0px 0px"]); + +// Require an extra track +TestingUtils.testGridTemplateColumnsRows("autoFillColumns", "repeat(auto-fill, 9px)", "20px", ["repeat(3, 9px)", "9px 9px 9px"], "20px"); +TestingUtils.testGridTemplateColumnsRows("autoFitColumns", "repeat(auto-fit, 9px)", "20px", ["repeat(2, 0px)", "0px 0px"], "20px"); +TestingUtils.testGridTemplateColumnsRows("autoFillRows", "20px", "repeat(auto-fill, 9px)", "20px", ["repeat(3, 9px)", "9px 9px 9px"]); +TestingUtils.testGridTemplateColumnsRows("autoFitRows", "20px", "repeat(auto-fit, 9px)", "20px", ["repeat(3, 0px)", "0px 0px 0px"]); + +// A single repetition is enough to fill in all the available space +TestingUtils.testGridTemplateColumnsRows("autoFillColumns", "repeat(auto-fill, 30px)", "20px", "30px", "20px"); +TestingUtils.testGridTemplateColumnsRows("autoFitColumns", "repeat(auto-fit, 30px)", "20px", "0px", "20px"); +TestingUtils.testGridTemplateColumnsRows("autoFillRows", "20px", "repeat(auto-fill, 30px)", "20px", "30px"); +TestingUtils.testGridTemplateColumnsRows("autoFitRows", "20px", "repeat(auto-fit, 30px)", "20px", "0px"); +</script> diff --git a/tests/wpt/web-platform-tests/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-ref.html b/tests/wpt/web-platform-tests/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-ref.html new file mode 100644 index 00000000000..02f0f54c3fb --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-ref.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +Passes if there is an unbroken rectangular border. +<style>td { width: 20px; height: 20px; padding: 2px }</style> +<table style="position: absolute; top: 30.3px; border: 2px solid black; border-collapse: collapse"> + <tr> + <td></td> + <td></td> + <td></td> + <td></td> + <td></td> + </tr> +</table> diff --git a/tests/wpt/web-platform-tests/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-vertical-rl-ref.html b/tests/wpt/web-platform-tests/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-vertical-rl-ref.html new file mode 100644 index 00000000000..9784962be48 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-vertical-rl-ref.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +Passes if there is an unbroken rectangular border. +<style>td { width: 20px; height: 20px; padding: 2px }</style> +<table style="position: absolute; top: 30.3px; border: 2px solid black; + border-collapse: collapse; writing-mode: vertical-rl"> + <tr> + <td></td> + <td></td> + <td></td> + <td></td> + <td></td> + </tr> +</table> diff --git a/tests/wpt/web-platform-tests/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-vertical-rl.html b/tests/wpt/web-platform-tests/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-vertical-rl.html new file mode 100644 index 00000000000..48edbde2816 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row-vertical-rl.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<link rel="help" href="https://drafts.csswg.org/css-tables-3/#height-distribution-algorithm"> +<link rel="match" href="td-different-subpixel-padding-in-same-row-vertical-rl-ref.html"> +Passes if there is an unbroken rectangular border. +<style>td { width: 20px; height: 20px }</style> +<table style="position: absolute; top: 30.3px; border: 2px solid black; + border-collapse: collapse; writing-mode: vertical-rl"> + <tr> + <td style="padding: 2px 1px"></td> + <td style="padding: 2px 1.2px"></td> + <td style="padding: 2px 1.5px"></td> + <td style="padding: 2px 1.7px"></td> + <td style="padding: 2px"></td> + </tr> +</table> diff --git a/tests/wpt/web-platform-tests/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row.html b/tests/wpt/web-platform-tests/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row.html new file mode 100644 index 00000000000..a7fe908e0db --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-tables/height-distribution/td-different-subpixel-padding-in-same-row.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<link rel="help" href="https://drafts.csswg.org/css-tables-3/#height-distribution-algorithm"> +<link rel="match" href="td-different-subpixel-padding-in-same-row-ref.html"> +Passes if there is an unbroken rectangular border. +<style>td { width: 20px; height: 20px }</style> +<table style="position: absolute; top: 30.3px; border: 2px solid black; border-collapse: collapse"> + <tr> + <td style="padding: 1px 2px"></td> + <td style="padding: 1.2px 2px"></td> + <td style="padding: 1.5px 2px"></td> + <td style="padding: 1.7px 2px"></td> + <td style="padding: 2px"></td> + </tr> +</table> diff --git a/tests/wpt/web-platform-tests/css/css-tables/width-distribution/td-with-subpixel-padding-vertical-rl.html b/tests/wpt/web-platform-tests/css/css-tables/width-distribution/td-with-subpixel-padding-vertical-rl.html new file mode 100644 index 00000000000..18ed2ddd00f --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-tables/width-distribution/td-with-subpixel-padding-vertical-rl.html @@ -0,0 +1,55 @@ +<!DOCTYPE html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<link rel="help" href="https://drafts.csswg.org/css-tables/#width-distribution" /> +<style> +td div { + display: inline-block; + width: 20px; + height: 20px; + background: blue; +} +</style> +Passes if each column (logical row) has two blue squares. +<div style="writing-mode: vertical-rl"> +<table> + <tr> + <td class='target' style="padding: 0.8px 0"><div></div> <div></div></td> + <td style="padding: 0.8px 0; width: 30px"></td> + </tr> +</table> +<table> + <tr> + <td class='target' style="padding: 1px 0"><div></div> <div></div></td> + <td style="padding: 1px 0; width: 30px"></td> + </tr> +</table> +<table> + <tr> + <td class='target' style="padding: 1.3px 0"><div></div> <div></div></td> + <td style="padding: 1.3px 0; width: 30px"></td> + </tr> +</table> +<table> + <tr> + <td class='target' style="padding: 1.5px 0"><div></div> <div></div></td> + <td style="padding: 1.5px 0; width: 30px"></td> + </tr> +</table> +<table> + <tr> + <td class='target' style="padding: 1.7px 0"><div></div> <div></div></td> + <td style="padding: 1.7px 0; width: 30px"></td> + </tr> +</table> +</div> +<script> +test(() => { + var targets = document.getElementsByClassName('target'); + for (var i = 0; i < targets.length; ++i) { + var divs = targets[i].getElementsByTagName('div'); + assert_equals(divs.length, 2); + assert_equals(divs[0].offsetLeft, divs[1].offsetLeft, 'Contents of td.target[' + i + '] should not wrap'); + } +}); +</script> diff --git a/tests/wpt/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/column-span.html b/tests/wpt/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/column-span.html new file mode 100644 index 00000000000..28087a1cddd --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/column-span.html @@ -0,0 +1,21 @@ +<!doctype html> +<meta charset="utf-8"> +<title>'column-span' property</title> +<link rel="help" href="https://drafts.css-houdini.org/css-typed-om/#dom-stylepropertymapreadonly-get"> +<link rel="help" href="https://drafts.css-houdini.org/css-typed-om/#dom-stylepropertymap-set"> +<link rel="help" href="https://drafts.css-houdini.org/css-typed-om/#reify-stylevalue"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="../../resources/testhelper.js"></script> +<script src="resources/testsuite.js"></script> +<body> +<div id="log"></div> +<script> +'use strict'; + +runPropertyTests('column-span', [ + { syntax: 'none' }, + { syntax: 'all' }, +]); + +</script> diff --git a/tests/wpt/web-platform-tests/dom/ranges/Range-intersectsNode-2.html b/tests/wpt/web-platform-tests/dom/ranges/Range-intersectsNode-2.html new file mode 100644 index 00000000000..48072d98af6 --- /dev/null +++ b/tests/wpt/web-platform-tests/dom/ranges/Range-intersectsNode-2.html @@ -0,0 +1,36 @@ +<!doctype htlml> +<title>Range.intersectsNode</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="div"><span id="s0">s0</span><span id="s1">s1</span><span id="s2">s2</span></div> +<script> +// Taken from Chromium bug: http://crbug.com/822510 +test(() => { + const range = new Range(); + const div = document.getElementById('div'); + const s0 = document.getElementById('s0'); + const s1 = document.getElementById('s1'); + const s2 = document.getElementById('s2'); + + // Range encloses s0 + range.setStart(div, 0); + range.setEnd(div, 1); + assert_true(range.intersectsNode(s0), '[s0] range.intersectsNode(s0)'); + assert_false(range.intersectsNode(s1), '[s0] range.intersectsNode(s1)'); + assert_false(range.intersectsNode(s2), '[s0] range.intersectsNode(s2)'); + + // Range encloses s1 + range.setStart(div, 1); + range.setEnd(div, 2); + assert_false(range.intersectsNode(s0), '[s1] range.intersectsNode(s0)'); + assert_true(range.intersectsNode(s1), '[s1] range.intersectsNode(s1)'); + assert_false(range.intersectsNode(s2), '[s1] range.intersectsNode(s2)'); + + // Range encloses s2 + range.setStart(div, 2); + range.setEnd(div, 3); + assert_false(range.intersectsNode(s0), '[s2] range.intersectsNode(s0)'); + assert_false(range.intersectsNode(s1), '[s2] range.intersectsNode(s1)'); + assert_true(range.intersectsNode(s2), '[s2] range.intersectsNode(s2)'); +}, 'Range.intersectsNode() simple cases'); +</script> diff --git a/tests/wpt/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.js b/tests/wpt/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.js new file mode 100644 index 00000000000..f5217b42460 --- /dev/null +++ b/tests/wpt/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.js @@ -0,0 +1,49 @@ +// META: script=/common/utils.js +// META: script=../resources/utils.js +// META: script=/common/get-host-info.sub.js + +var redirectUrl = get_host_info().HTTP_REMOTE_ORIGIN + dirname(location.pathname) + RESOURCES_DIR + "redirect.py"; +var urlSetCookies1 = get_host_info().HTTP_REMOTE_ORIGIN + dirname(location.pathname) + RESOURCES_DIR + "top.txt"; +var urlSetCookies2 = get_host_info().HTTP_ORIGIN_WITH_DIFFERENT_PORT + dirname(location.pathname) + RESOURCES_DIR + "top.txt"; +var urlCheckCookies = get_host_info().HTTP_ORIGIN_WITH_DIFFERENT_PORT + dirname(location.pathname) + RESOURCES_DIR + "inspect-headers.py?cors&headers=cookie"; + +var urlSetCookiesParameters = "?pipe=header(Access-Control-Allow-Origin," + location.origin + ")"; +urlSetCookiesParameters += "|header(Access-Control-Allow-Credentials,true)"; + +urlSetCookiesParameters1 = urlSetCookiesParameters + "|header(Set-Cookie,a=1)"; +urlSetCookiesParameters2 = urlSetCookiesParameters + "|header(Set-Cookie,a=2)"; + +urlClearCookiesParameters1 = urlSetCookiesParameters + "|header(Set-Cookie,a=1%3B%20max-age=0)"; +urlClearCookiesParameters2 = urlSetCookiesParameters + "|header(Set-Cookie,a=2%3B%20max-age=0)"; + +promise_test(async (test) => { + await fetch(urlSetCookies1 + urlSetCookiesParameters1, {"credentials": "include", "mode": "cors"}); + await fetch(urlSetCookies2 + urlSetCookiesParameters2, {"credentials": "include", "mode": "cors"}); +}, "Set cookies"); + +function doTest(usePreflight) { + promise_test(async (test) => { + var url = redirectUrl; + var uuid_token = token(); + var urlParameters = "?token=" + uuid_token + "&max_age=0"; + urlParameters += "&redirect_status=301"; + urlParameters += "&location=" + encodeURIComponent(urlCheckCookies); + urlParameters += "&allow_headers=a&headers=Cookie"; + headers = []; + if (usePreflight) + headers.push(["a", "b"]); + + var requestInit = {"credentials": "include", "mode": "cors", "headers": headers}; + var response = await fetch(url + urlParameters, requestInit); + + assert_equals(response.headers.get("x-request-cookie") , "a=2", "Request includes cookie(s)"); + }, "Testing credentials after cross-origin redirection with CORS and " + (usePreflight ? "" : "no ") + "preflight"); +} + +doTest(false); +doTest(true); + +promise_test(async (test) => { + await fetch(urlSetCookies1 + urlClearCookiesParameters1, {"credentials": "include", "mode": "cors"}); + await fetch(urlSetCookies2 + urlClearCookiesParameters2, {"credentials": "include", "mode": "cors"}); +}, "Clean cookies"); diff --git a/tests/wpt/web-platform-tests/fetch/api/resources/inspect-headers.py b/tests/wpt/web-platform-tests/fetch/api/resources/inspect-headers.py index c4ace18ab64..d53038cee0b 100644 --- a/tests/wpt/web-platform-tests/fetch/api/resources/inspect-headers.py +++ b/tests/wpt/web-platform-tests/fetch/api/resources/inspect-headers.py @@ -16,7 +16,10 @@ def main(request, response): headers.append(("Access-Control-Allow-Methods", "GET, POST, HEAD")) exposed_headers = ["x-request-" + header for header in checked_headers] headers.append(("Access-Control-Expose-Headers", ", ".join(exposed_headers))) - headers.append(("Access-Control-Allow-Headers", ", ".join(request.headers))) + if "allow_headers" in request.GET: + headers.append(("Access-Control-Allow-Headers", request.GET['allow_headers'])) + else: + headers.append(("Access-Control-Allow-Headers", ", ".join(request.headers))) headers.append(("content-type", "text/plain")) return headers, "" diff --git a/tests/wpt/web-platform-tests/fetch/api/resources/redirect.py b/tests/wpt/web-platform-tests/fetch/api/resources/redirect.py index 3d313e5b0b4..40c1b99961a 100644 --- a/tests/wpt/web-platform-tests/fetch/api/resources/redirect.py +++ b/tests/wpt/web-platform-tests/fetch/api/resources/redirect.py @@ -7,10 +7,14 @@ def main(request, response): status = 302 headers = [("Content-Type", "text/plain"), ("Cache-Control", "no-cache"), - ("Pragma", "no-cache"), - ("Access-Control-Allow-Origin", "*")] - token = None + ("Pragma", "no-cache")] + if "Origin" in request.headers: + headers.append(("Access-Control-Allow-Origin", request.headers.get("Origin", ""))) + headers.append(("Access-Control-Allow-Credentials", "true")) + else: + headers.append(("Access-Control-Allow-Origin", "*")) + token = None if "token" in request.GET: token = request.GET.first("token") data = request.server.stash.take(token) diff --git a/tests/wpt/web-platform-tests/fonts/math/largeop-displayoperatorminheight2000-2AFF-italiccorrection3000.woff b/tests/wpt/web-platform-tests/fonts/math/largeop-displayoperatorminheight2000-2AFF-italiccorrection3000.woff Binary files differnew file mode 100644 index 00000000000..0b4f8bf46a7 --- /dev/null +++ b/tests/wpt/web-platform-tests/fonts/math/largeop-displayoperatorminheight2000-2AFF-italiccorrection3000.woff diff --git a/tests/wpt/web-platform-tests/hr-time/idlharness.html b/tests/wpt/web-platform-tests/hr-time/idlharness.html index c3fd9070ad0..4abaf6033fd 100644 --- a/tests/wpt/web-platform-tests/hr-time/idlharness.html +++ b/tests/wpt/web-platform-tests/hr-time/idlharness.html @@ -18,12 +18,7 @@ function doTest([html, hr_time]) { var idl_array = new IdlArray(); - // HTML is needed for WindowOrWorkerGlobalScope. Provide dummy interfaces for - // things that HTML depends on in turn which are not under tests. - idl_array.add_untested_idls('interface Document {};'); - idl_array.add_untested_idls('interface EventTarget {};'); - idl_array.add_untested_idls('interface LinkStyle {};'); - idl_array.add_untested_idls(html); + idl_array.add_untested_idls(html, { only: ['WindowOrWorkerGlobalScope'] }); idl_array.add_idls(hr_time); idl_array.add_objects({ Performance: ["window.performance"], diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/the-select-element/selected-index.html b/tests/wpt/web-platform-tests/html/semantics/forms/the-select-element/selected-index.html index 46f19da7da2..70f6772b876 100644 --- a/tests/wpt/web-platform-tests/html/semantics/forms/the-select-element/selected-index.html +++ b/tests/wpt/web-platform-tests/html/semantics/forms/the-select-element/selected-index.html @@ -25,6 +25,11 @@ <option></option> <option selected></option> </select> + + <select id=display-none> + <option style="display:none"></option> + <option></option> + </select> </form> <script> @@ -100,4 +105,19 @@ test(function () { form.reset(); assertSelectedIndex(select, 1); }, "set and reset (HTMLOptionsCollection)"); + +test(function () { + var select = document.getElementById('display-none'); + assertSelectedIndex(select, 0); +}, "get display:none"); + +test(function () { + var select = document.getElementById('display-none'); + select.offsetTop; // force rendering + assertSelectedIndex(select, 0); + select.options[1].selected = true; + assertSelectedIndex(select, 1); + select.options[1].selected = false; + assertSelectedIndex(select, 0); +}, "reset to display:none"); </script> diff --git a/tests/wpt/web-platform-tests/interfaces/html.idl b/tests/wpt/web-platform-tests/interfaces/html.idl index 89558dfe133..af85b42db6c 100644 --- a/tests/wpt/web-platform-tests/interfaces/html.idl +++ b/tests/wpt/web-platform-tests/interfaces/html.idl @@ -97,14 +97,10 @@ interface HTMLElement : Element { [CEReactions] attribute DOMString lang; [CEReactions] attribute boolean translate; [CEReactions] attribute DOMString dir; - [SameObject] readonly attribute DOMStringMap dataset; // user interaction [CEReactions] attribute boolean hidden; void click(); - [CEReactions] attribute long tabIndex; - void focus(optional FocusOptions options); - void blur(); [CEReactions] attribute DOMString accessKey; readonly attribute DOMString accessKeyLabel; [CEReactions] attribute boolean draggable; @@ -124,6 +120,17 @@ HTMLElement includes ElementContentEditable; // Note: intentionally not [HTMLConstructor] interface HTMLUnknownElement : HTMLElement { }; +interface mixin HTMLOrSVGElement { + [SameObject] readonly attribute DOMStringMap dataset; + attribute DOMString nonce; + + [CEReactions] attribute long tabIndex; + void focus(optional FocusOptions options); + void blur(); +}; +HTMLElement includes HTMLOrSVGElement; +SVGElement includes HTMLOrSVGElement; + [Exposed=Window, OverrideBuiltins] interface DOMStringMap { @@ -164,16 +171,11 @@ interface HTMLLinkElement : HTMLElement { [CEReactions] attribute DOMString as; // (default "") [SameObject, PutForwards=value] readonly attribute DOMTokenList relList; [CEReactions] attribute DOMString media; - [CEReactions] attribute DOMString nonce; [CEReactions] attribute DOMString integrity; [CEReactions] attribute DOMString hreflang; [CEReactions] attribute DOMString type; [SameObject, PutForwards=value] readonly attribute DOMTokenList sizes; [CEReactions] attribute DOMString referrerPolicy; - [CEReactions] attribute DOMString workerType; - [CEReactions] attribute DOMString updateViaCache; - - // also has obsolete members }; HTMLLinkElement includes LinkStyle; @@ -191,8 +193,6 @@ interface HTMLMetaElement : HTMLElement { HTMLConstructor] interface HTMLStyleElement : HTMLElement { [CEReactions] attribute DOMString media; - [CEReactions] attribute DOMString nonce; - [CEReactions] attribute DOMString type; }; HTMLStyleElement includes LinkStyle; @@ -1108,11 +1108,8 @@ interface HTMLScriptElement : HTMLElement { [CEReactions] attribute boolean defer; [CEReactions] attribute DOMString? crossOrigin; [CEReactions] attribute DOMString text; - [CEReactions] attribute DOMString nonce; [CEReactions] attribute DOMString integrity; - - // also has obsolete members }; [Exposed=Window, @@ -2379,6 +2376,10 @@ partial interface HTMLPreElement { [CEReactions] attribute long width; }; +partial interface HTMLStyleElement { + [CEReactions] attribute DOMString type; +}; + partial interface HTMLScriptElement { [CEReactions] attribute DOMString charset; [CEReactions] attribute DOMString event; diff --git a/tests/wpt/web-platform-tests/interfaces/keyboard-lock.idl b/tests/wpt/web-platform-tests/interfaces/keyboard-lock.idl new file mode 100644 index 00000000000..771c716ccad --- /dev/null +++ b/tests/wpt/web-platform-tests/interfaces/keyboard-lock.idl @@ -0,0 +1,8 @@ +partial interface Navigator { + [SecureContext, SameObject] readonly attribute Keyboard keyboard; +}; + +[SecureContext, Exposed=Window] interface Keyboard { + Promise<void> lock(optional sequence<DOMString> keyCodes = []); + void unlock(); +}; diff --git a/tests/wpt/web-platform-tests/interfaces/web-animations.idl b/tests/wpt/web-platform-tests/interfaces/web-animations.idl new file mode 100644 index 00000000000..f5683f54d23 --- /dev/null +++ b/tests/wpt/web-platform-tests/interfaces/web-animations.idl @@ -0,0 +1,154 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the Web Animations spec. +// See https://drafts.csswg.org/web-animations/ + +[Exposed=Window] +interface AnimationTimeline { + readonly attribute double? currentTime; +}; + +dictionary DocumentTimelineOptions { + DOMHighResTimeStamp originTime = 0; +}; + +[Exposed=Window, + Constructor (optional DocumentTimelineOptions options)] +interface DocumentTimeline : AnimationTimeline { +}; + +[Exposed=Window, + Constructor (optional AnimationEffect? effect = null, + optional AnimationTimeline? timeline)] +interface Animation : EventTarget { + attribute DOMString id; + attribute AnimationEffect? effect; + attribute AnimationTimeline? timeline; + attribute double? startTime; + attribute double? currentTime; + attribute double playbackRate; + readonly attribute AnimationPlayState playState; + readonly attribute boolean pending; + readonly attribute Promise<Animation> ready; + readonly attribute Promise<Animation> finished; + attribute EventHandler onfinish; + attribute EventHandler oncancel; + void cancel (); + void finish (); + void play (); + void pause (); + void updatePlaybackRate (double playbackRate); + void reverse (); +}; + +enum AnimationPlayState { "idle", "running", "paused", "finished" }; + +[Exposed=Window] +interface AnimationEffect { + EffectTiming getTiming(); + ComputedEffectTiming getComputedTiming(); + void updateTiming(optional OptionalEffectTiming timing); +}; + +dictionary EffectTiming { + double delay = 0; + double endDelay = 0; + FillMode fill = "auto"; + double iterationStart = 0.0; + unrestricted double iterations = 1.0; + (unrestricted double or DOMString) duration = "auto"; + PlaybackDirection direction = "normal"; + DOMString easing = "linear"; +}; + +dictionary OptionalEffectTiming { + double delay; + double endDelay; + FillMode fill; + double iterationStart; + unrestricted double iterations; + (unrestricted double or DOMString) duration; + PlaybackDirection direction; + DOMString easing; +}; + +enum FillMode { "none", "forwards", "backwards", "both", "auto" }; + +enum PlaybackDirection { "normal", "reverse", "alternate", "alternate-reverse" }; + +dictionary ComputedEffectTiming : EffectTiming { + unrestricted double endTime; + unrestricted double activeDuration; + double? localTime; + double? progress; + unrestricted double? currentIteration; +}; + +[Exposed=Window, + Constructor ((Element or CSSPseudoElement)? target, + object? keyframes, + optional (unrestricted double or KeyframeEffectOptions) options), + Constructor (KeyframeEffect source)] +interface KeyframeEffect : AnimationEffect { + attribute (Element or CSSPseudoElement)? target; + attribute IterationCompositeOperation iterationComposite; + attribute CompositeOperation composite; + sequence<object> getKeyframes (); + void setKeyframes (object? keyframes); +}; + +dictionary BaseComputedKeyframe { + double? offset = null; + double computedOffset; + DOMString easing = "linear"; + CompositeOperation? composite = null; +}; + +dictionary BasePropertyIndexedKeyframe { + (double? or sequence<double?>) offset = []; + (DOMString or sequence<DOMString>) easing = []; + (CompositeOperation? or sequence<CompositeOperation?>) composite = []; +}; + +dictionary BaseKeyframe { + double? offset = null; + DOMString easing = "linear"; + CompositeOperation? composite = null; +}; + +dictionary KeyframeEffectOptions : EffectTiming { + IterationCompositeOperation iterationComposite = "replace"; + CompositeOperation composite = "replace"; +}; + +enum IterationCompositeOperation {"replace", "accumulate"}; + +enum CompositeOperation {"replace", "add", "accumulate"}; + +interface mixin Animatable { + Animation animate (object? keyframes, + optional (unrestricted double or KeyframeAnimationOptions) options); + sequence<Animation> getAnimations (); +}; +dictionary KeyframeAnimationOptions : KeyframeEffectOptions { + DOMString id = ""; +}; + +partial interface Document { + readonly attribute DocumentTimeline timeline; + sequence<Animation> getAnimations(); +}; + +Element includes Animatable; + +CSSPseudoElement includes Animatable; + +[Exposed=Window, + Constructor (DOMString type, optional AnimationPlaybackEventInit eventInitDict)] +interface AnimationPlaybackEvent : Event { + readonly attribute double? currentTime; + readonly attribute double? timelineTime; +}; +dictionary AnimationPlaybackEventInit : EventInit { + double? currentTime = null; + double? timelineTime = null; +}; diff --git a/tests/wpt/web-platform-tests/keyboard-lock/idlharness.https.html b/tests/wpt/web-platform-tests/keyboard-lock/idlharness.https.html index 9caa379f4f6..1c3ade02842 100644 --- a/tests/wpt/web-platform-tests/keyboard-lock/idlharness.https.html +++ b/tests/wpt/web-platform-tests/keyboard-lock/idlharness.https.html @@ -1,41 +1,34 @@ <!doctype html> <html> <head> -<title>Keyboard Lock IDL tests</title> -<link rel="help" href="https://github.com/w3c/keyboard-lock"/> +<title>Keyboard IDL tests</title> +<link rel="help" href="https://w3c.github.io/keyboard-lock/"/> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/resources/WebIDLParser.js"></script> <script src="/resources/idlharness.js"></script> -</head> -<body> -<pre id="untested_idl" style="display: none"> -interface Navigator { -}; -</pre> -<!-- - The reason of the failure of keyboardLock test looks like a code defect in - idlharness.js. media-capabilities/idlharness.html is also impacted by this - issue. See https://codereview.chromium.org/2805763004/#ps620001, which - includes a potential fix. - TODO(joedow): Submit the fix. ---> -<pre id="idl" style="display: none"> -partial interface Navigator { - [SecureContext] Promise<void> keyboardLock(optional sequence<DOMString> keyCodes = []); - [SecureContext] void keyboardUnlock(); -}; -</pre> <script> -var idl_array = new IdlArray(); -idl_array.add_untested_idls( - document.getElementById("untested_idl").textContent); -idl_array.add_idls(document.getElementById("idl").textContent); -idl_array.add_objects({ - Navigator: ["navigator"] -}); -idl_array.test(); +'use strict'; + +function doTest(idls) { + var idl_array = new IdlArray(); + idl_array.add_untested_idls('interface Navigator {};'); + for (let idl of idls) { + idl_array.add_idls(idl); + } + idl_array.add_objects({ + Navigator: ['navigator'], + Keyboard: ['navigator.keyboard'], + }); + idl_array.test(); +}; + +function fetchText(url) { + return fetch(url).then((response) => response.text()); +} + +promise_test(() => { + return Promise.all(["/interfaces/keyboard-lock.idl"].map(fetchText)) + .then(doTest); +}, "Test driver"); </script> -<div id="log"></div> -</body> -</html> diff --git a/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboardLock-two-parallel-requests.https.html b/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboard-lock-two-parallel-requests.https.html index d553c064d50..501f36fb358 100644 --- a/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboardLock-two-parallel-requests.https.html +++ b/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboard-lock-two-parallel-requests.https.html @@ -5,11 +5,11 @@ 'use strict'; promise_test((t) => { - const p1 = navigator.keyboardLock(['a', 'b']); - const p2 = navigator.keyboardLock(['c', 'd']); + const p1 = navigator.keyboard.lock(['a', 'b']); + const p2 = navigator.keyboard.lock(['c', 'd']); return promise_rejects(t, null, p2, - 'keyboardLock() should only be ' + + 'keyboard.lock() should only be ' + 'executed if another request has finished.'); -}, 'Keyboard Lock keyboardLock twice in parallel'); +}, '[Keyboard Lock] keyboard.lock twice in parallel'); </script> diff --git a/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboardLock-two-sequential-requests.https.html b/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboard-lock-two-sequential-requests.https.html index 7670be4f383..4403930bf62 100644 --- a/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboardLock-two-sequential-requests.https.html +++ b/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboard-lock-two-sequential-requests.https.html @@ -5,10 +5,10 @@ 'use strict'; promise_test(() => { - return navigator.keyboardLock(['a', 'b']) + return navigator.keyboard.lock(['a', 'b']) .then(() => { - return navigator.keyboardLock(['c', 'd']); + return navigator.keyboard.lock(['c', 'd']); }); -}, 'Keyboard Lock keyboardLock twice sequentially'); +}, '[Keyboard Lock] keyboard.lock called twice sequentially'); </script> diff --git a/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboardLock.https.html b/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboard-lock.https.html index 6711decc121..d39e8907647 100644 --- a/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboardLock.https.html +++ b/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboard-lock.https.html @@ -5,9 +5,9 @@ 'use strict'; promise_test(() => { - const p = navigator.keyboardLock(['a', 'b']); + const p = navigator.keyboard.lock(['a', 'b']); assert_true(p instanceof Promise); return p; -}, 'Keyboard Lock keyboardLock'); +}, '[Keyboard Lock] keyboard.lock'); </script> diff --git a/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboardUnlock.https.html b/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboard-unlock.https.html index ceb7a968949..87b10ee49a9 100644 --- a/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboardUnlock.https.html +++ b/tests/wpt/web-platform-tests/keyboard-lock/navigator-keyboard-unlock.https.html @@ -5,8 +5,8 @@ 'use strict'; test(() => { - assert_equals(navigator.keyboardUnlock(), + assert_equals(navigator.keyboard.unlock(), undefined); -}, 'Keyboard Lock keyboardUnlock'); +}, '[Keyboard Lock] keyboard.unlock'); </script> diff --git a/tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/subsup-parameters-2.html b/tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/subsup-parameters-2.html new file mode 100644 index 00000000000..eaa4f0ffab1 --- /dev/null +++ b/tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/subsup-parameters-2.html @@ -0,0 +1,132 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>Subscripts and Superscripts parameters</title> +<link rel="help" href="http://www.mathml-association.org/MathMLinHTML5/S3.html#SS4"> +<meta name="assert" content="Elements msub, msup, subsup and msubsup correctly use the italic correction from the MATH table."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<style> + math, mspace { + font-size: 10px; + } + @font-face { + font-family: largeop-displayoperatorminheight5000; + src: url("/fonts/math/largeop-displayoperatorminheight5000.woff"); + } + @font-face { + font-family: largeop-displayoperatorminheight2000-2AFF-italiccorrection3000; + src: url("/fonts/math/largeop-displayoperatorminheight2000-2AFF-italiccorrection3000.woff"); + } +</style> +<script> + function getBox(aId) { + return document.getElementById(aId).getBoundingClientRect(); + } + + setup({ explicit_done: true }); + window.addEventListener("load", function() { + // Delay the check to workaround WebKit's bug https://webkit.org/b/174030. + requestAnimationFrame(() => { document.fonts.ready.then(runTests); }); + }); + + /* + These two tests verify that: + - In msub, the script is at the right of the base minus the italic correction. + - In msup, the script is just at the right of the base. + - In msubsup, the scripts are shifted by the italic correction. + - In mmultiscripts, postscript pairs are shifted by the italic correction. + - In mmultiscripts, prescript pairs are vertically aligned. + */ + var epsilon = 1; + function runTests() { + test(function() { + var v = 0; + assert_approx_equals(getBox("base001").right - getBox("sub001").left, v, epsilon, "msub"); + assert_approx_equals(getBox("sup002").left, getBox("base002").right, epsilon, "msup"); + assert_approx_equals(getBox("sup003").left - getBox("sub003").left, v, epsilon, "msubsup"); + assert_approx_equals(getBox("sup004").left - getBox("sub004").left, v, epsilon, "mmultiscripts postscripts"); + assert_approx_equals(getBox("sup005").left - getBox("sub005").left, 0, epsilon, "mmultiscripts prescripts"); + }, "Null Italic Correction"); + test(function() { + var emToPx = 10 / 1000; // font-size: 10px, font.em = 1000 + var v = 3000 * emToPx; + assert_approx_equals(getBox("base011").right - getBox("sub011").left, v, epsilon, "msub"); + assert_approx_equals(getBox("sup012").left, getBox("base012").right, epsilon, "msup"); + assert_approx_equals(getBox("sup013").left - getBox("sub013").left, v, epsilon, "msubsup"); + assert_approx_equals(getBox("sup014").left - getBox("sub014").left, v, epsilon, "mmultiscripts postscripts"); + assert_approx_equals(getBox("sup015").left - getBox("sub015").left, 0, epsilon, "mmultiscripts prescripts"); + }, "NonNull Italic Correction"); + done(); + } +</script> +</head> +<body> + <div id="log"></div> + <h2>Null Italic Correction</h2> + <p> + <math displaystyle="true" style="font-family: largeop-displayoperatorminheight5000;"> + <msub> + <mo id="base001" lspace="0px" rspace="0px">⫿</mo> + <mspace id="sub001" height="1em" width="1em" mathbackground="blue"/> + </msub> + </math> + <math displaystyle="true" style="font-family: largeop-displayoperatorminheight5000;"> + <msup> + <mo id="base002" lspace="0px" rspace="0px">⫿</mo> + <mspace id="sup002" height="1em" width="1em" mathbackground="blue"/> + </msup> + </math> + <math displaystyle="true" style="font-family: largeop-displayoperatorminheight5000;"> + <msubsup> + <mo lspace="0px" rspace="0px">⫿</mo> + <mspace id="sub003" height="1em" width="1em" mathbackground="blue"/> + <mspace id="sup003" height="1em" width="1em" mathbackground="green"/> + </msubsup> + </math> + <math displaystyle="true" style="font-family: largeop-displayoperatorminheight5000;"> + <mmultiscripts> + <mo lspace="0px" rspace="0px">⫿</mo> + <mspace id="sub004" height="1em" width="1em" mathbackground="blue"/> + <mspace id="sup004" height="1em" width="1em" mathbackground="green"/> + <mprescripts/> + <mspace id="sub005" height="1em" width="1em" mathbackground="magenta"/> + <mspace id="sup005" height="1em" width="1em" mathbackground="cyan"/> + </mmultiscripts> + </math> + </p> + <h2>NonNull Italic Correction</h2> + <p> + <math displaystyle="true" style="font-family: largeop-displayoperatorminheight2000-2AFF-italiccorrection3000;"> + <msub> + <mo id="base011" lspace="0px" rspace="0px">⫿</mo> + <mspace id="sub011" height="1em" width="1em" mathbackground="blue"/> + </msub> + </math> + <math displaystyle="true" style="font-family: largeop-displayoperatorminheight2000-2AFF-italiccorrection3000;"> + <msup> + <mo id="base012" lspace="0px" rspace="0px">⫿</mo> + <mspace id="sup012" height="1em" width="1em" mathbackground="blue"/> + </msup> + </math> + <math displaystyle="true" style="font-family: largeop-displayoperatorminheight2000-2AFF-italiccorrection3000;"> + <msubsup> + <mo lspace="0px" rspace="0px">⫿</mo> + <mspace id="sub013" height="1em" width="1em" mathbackground="blue"/> + <mspace id="sup013" height="1em" width="1em" mathbackground="green"/> + </msubsup> + </math> + <math displaystyle="true" style="font-family: largeop-displayoperatorminheight2000-2AFF-italiccorrection3000;"> + <mmultiscripts> + <mo lspace="0px" rspace="0px">⫿</mo> + <mspace id="sub014" height="1em" width="1em" mathbackground="blue"/> + <mspace id="sup014" height="1em" width="1em" mathbackground="green"/> + <mprescripts/> + <mspace id="sub015" height="1em" width="1em" mathbackground="magenta"/> + <mspace id="sup015" height="1em" width="1em" mathbackground="cyan"/> + </mmultiscripts> + </math> + </p> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/mathml/tools/largeop.py b/tests/wpt/web-platform-tests/mathml/tools/largeop.py index 3c9c6c4c949..73d967689bb 100644 --- a/tests/wpt/web-platform-tests/mathml/tools/largeop.py +++ b/tests/wpt/web-platform-tests/mathml/tools/largeop.py @@ -12,3 +12,21 @@ g = f.createChar(-1, "uni2AFF.display") mathfont.drawRectangleGlyph(g, mathfont.em, v1, 0) f[nAryWhiteVerticalBarCodePoint].verticalVariants = "uni2AFF uni2AFF.display" mathfont.save(f) + +v1 = 2 * mathfont.em +v2 = 3 * mathfont.em +f = mathfont.create("largeop-displayoperatorminheight%d-2AFF-italiccorrection%d" % (v1, v2)) +f.copyright = "Copyright (c) 2018 Igalia S.L." +f.math.DisplayOperatorMinHeight = v1 +mathfont.createSquareGlyph(f, nAryWhiteVerticalBarCodePoint) +g = f.createChar(-1, "uni2AFF.display") +p = g.glyphPen() +p.moveTo(0, 0) +p.lineTo(v2, v1) +p.lineTo(v2 + mathfont.em, v1) +p.lineTo(mathfont.em, 0) +p.closePath(); +g.width = mathfont.em + v2 +g.italicCorrection = v2 +f[nAryWhiteVerticalBarCodePoint].verticalVariants = "uni2AFF uni2AFF.display" +mathfont.save(f) diff --git a/tests/wpt/web-platform-tests/payment-request/PaymentItem/type_member.https.html b/tests/wpt/web-platform-tests/payment-request/PaymentItem/type_member.https.html new file mode 100644 index 00000000000..dc62a83f597 --- /dev/null +++ b/tests/wpt/web-platform-tests/payment-request/PaymentItem/type_member.https.html @@ -0,0 +1,77 @@ +<!doctype html> +<meta charset="utf8"> +<link rel="help" href="https://w3c.github.io/payment-request/#dom-paymentitem-type"> +<title> + PaymentItem type member +</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> +const validMethods = [ + { supportedMethods: "basic-card" }, + { supportedMethods: "https://apple.com/apple-pay" }, +]; +const validTotal = { + label: "Total", + amount: { + currency: "USD", + value: "5.00", + }, +}; +const validDisplayItem = { + label: "Item", + amount: { + currency: "USD", + value: "1.00", + }, +}; +const validDetails = { + total: validTotal, + displayItems: [validDisplayItem], +}; + +test(() => { + new PaymentRequest(validMethods, validDetails); +}, "Smoke test"); + +test(() => { + // Let's make an invalid DisplayItem for the total + const invalidTotal = Object.assign({}, validTotal, { + type: "this is not valid", + }); + const invalidDetails = Object.assign({}, validDetails, { + total: invalidTotal, + }); + assert_throws(new TypeError(), () => { + new PaymentRequest(validMethods, invalidDetails); + }); +}, "An invalid enum value for PaymentDetailsInit.total's type throws TypeError"); + +test(() => { + // Let's make an invalid DisplayItem to add to displayItems + const invalidDisplayItem = Object.assign({}, validDisplayItem, { + type: "this is not valid", + }); + const invalidDetails = Object.assign({}, validDetails, { + displayItems: [invalidDisplayItem, validDisplayItem], + }); + assert_throws(new TypeError(), () => { + new PaymentRequest(validMethods, invalidDetails); + }); +}, "Invalid enum value for PaymentItem.type member throws a TypeError"); + +test(() => { + // Let's make an invalid DisplayItem to add to displayItems + const taxDisplayItem = Object.assign({}, validDisplayItem, { type: "tax" }); + const taxTotal = Object.assign({}, validTotal, { type: "tax" }); + const validDetailsWithType = Object.assign({}, validDetails, { + total: taxTotal, + displayItems: [taxDisplayItem], + }); + try { + new PaymentRequest(validMethods, validDetailsWithType); + } catch (err) { + assert_unexpected(err.message); + } +}, "Valid enum values for PaymentItem.type member does not throw"); +</script> diff --git a/tests/wpt/web-platform-tests/payment-request/payment-request-insecure.http.html b/tests/wpt/web-platform-tests/payment-request/payment-request-insecure.http.html new file mode 100644 index 00000000000..02122203d51 --- /dev/null +++ b/tests/wpt/web-platform-tests/payment-request/payment-request-insecure.http.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<!-- Copyright © 2017 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). --> +<meta charset="utf-8"> +<title>Test for PaymentRequest Constructor (insecure)</title> +<link rel="help" href="https://w3c.github.io/payment-request/#paymentrequest-interface"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> +test(() => { + assert_false(isSecureContext); + assert_false("PaymentRequest" in window); +}, "PaymentRequest constructor must not be exposed in insecure context"); +</script> diff --git a/tests/wpt/web-platform-tests/payment-request/show-method-postmessage-manual.https.html b/tests/wpt/web-platform-tests/payment-request/show-method-postmessage-manual.https.html index 00ce84a4859..1067fb3cd58 100644 --- a/tests/wpt/web-platform-tests/payment-request/show-method-postmessage-manual.https.html +++ b/tests/wpt/web-platform-tests/payment-request/show-method-postmessage-manual.https.html @@ -9,6 +9,35 @@ setup({ explicit_done: true, explicit_timeout: true, + allow_uncaught_exception: true, +}); + +const defaultMethods = Object.freeze([ + { supportedMethods: "basic-card" }, + { supportedMethods: "https://apple.com/pay" }, +]); + +const defaultDetails = Object.freeze({ + id: "fail", + total: { + label: "Total", + amount: { + currency: "USD", + value: "1.00", + }, + }, +}); + +test(() => { + assert_throws( + "SecurityError", + () => { + const request = new PaymentRequest(defaultMethods, defaultDetails); + request.show(); // <--- should throw here + request.abort(); + }, + "throws a SecurityError if not triggered by user activation" + ); }); async function runUserActivation(button) { @@ -27,6 +56,7 @@ async function runUserActivation(button) { }, button.textContent.trim()); done(); } + </script> <h2>Test PaymentRequest.show() triggered by user activation using postMessage()</h2> <p> diff --git a/tests/wpt/web-platform-tests/resources/chromium/fake_bluetooth.mojom.js b/tests/wpt/web-platform-tests/resources/chromium/fake_bluetooth.mojom.js index 4daf3f058e2..08c26b68f61 100644 --- a/tests/wpt/web-platform-tests/resources/chromium/fake_bluetooth.mojom.js +++ b/tests/wpt/web-platform-tests/resources/chromium/fake_bluetooth.mojom.js @@ -2270,6 +2270,155 @@ encoder.writeUint32(0); encoder.encodeStruct(codec.NullableString, val.descriptorId); }; + function FakeCentral_RemoveFakeDescriptor_Params(values) { + this.initDefaults_(); + this.initFields_(values); + } + + + FakeCentral_RemoveFakeDescriptor_Params.prototype.initDefaults_ = function() { + this.descriptorId = null; + this.characteristicId = null; + this.serviceId = null; + this.peripheralAddress = null; + }; + FakeCentral_RemoveFakeDescriptor_Params.prototype.initFields_ = function(fields) { + for(var field in fields) { + if (this.hasOwnProperty(field)) + this[field] = fields[field]; + } + }; + + FakeCentral_RemoveFakeDescriptor_Params.validate = function(messageValidator, offset) { + var err; + err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); + if (err !== validator.validationError.NONE) + return err; + + var kVersionSizes = [ + {version: 0, numBytes: 40} + ]; + err = messageValidator.validateStructVersion(offset, kVersionSizes); + if (err !== validator.validationError.NONE) + return err; + + + // validate FakeCentral_RemoveFakeDescriptor_Params.descriptorId + err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) + if (err !== validator.validationError.NONE) + return err; + + + // validate FakeCentral_RemoveFakeDescriptor_Params.characteristicId + err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) + if (err !== validator.validationError.NONE) + return err; + + + // validate FakeCentral_RemoveFakeDescriptor_Params.serviceId + err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, false) + if (err !== validator.validationError.NONE) + return err; + + + // validate FakeCentral_RemoveFakeDescriptor_Params.peripheralAddress + err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 24, false) + if (err !== validator.validationError.NONE) + return err; + + return validator.validationError.NONE; + }; + + FakeCentral_RemoveFakeDescriptor_Params.encodedSize = codec.kStructHeaderSize + 32; + + FakeCentral_RemoveFakeDescriptor_Params.decode = function(decoder) { + var packed; + var val = new FakeCentral_RemoveFakeDescriptor_Params(); + var numberOfBytes = decoder.readUint32(); + var version = decoder.readUint32(); + val.descriptorId = decoder.decodeStruct(codec.String); + val.characteristicId = decoder.decodeStruct(codec.String); + val.serviceId = decoder.decodeStruct(codec.String); + val.peripheralAddress = decoder.decodeStruct(codec.String); + return val; + }; + + FakeCentral_RemoveFakeDescriptor_Params.encode = function(encoder, val) { + var packed; + encoder.writeUint32(FakeCentral_RemoveFakeDescriptor_Params.encodedSize); + encoder.writeUint32(0); + encoder.encodeStruct(codec.String, val.descriptorId); + encoder.encodeStruct(codec.String, val.characteristicId); + encoder.encodeStruct(codec.String, val.serviceId); + encoder.encodeStruct(codec.String, val.peripheralAddress); + }; + function FakeCentral_RemoveFakeDescriptor_ResponseParams(values) { + this.initDefaults_(); + this.initFields_(values); + } + + + FakeCentral_RemoveFakeDescriptor_ResponseParams.prototype.initDefaults_ = function() { + this.success = false; + }; + FakeCentral_RemoveFakeDescriptor_ResponseParams.prototype.initFields_ = function(fields) { + for(var field in fields) { + if (this.hasOwnProperty(field)) + this[field] = fields[field]; + } + }; + + FakeCentral_RemoveFakeDescriptor_ResponseParams.validate = function(messageValidator, offset) { + var err; + err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); + if (err !== validator.validationError.NONE) + return err; + + var kVersionSizes = [ + {version: 0, numBytes: 16} + ]; + err = messageValidator.validateStructVersion(offset, kVersionSizes); + if (err !== validator.validationError.NONE) + return err; + + + return validator.validationError.NONE; + }; + + FakeCentral_RemoveFakeDescriptor_ResponseParams.encodedSize = codec.kStructHeaderSize + 8; + + FakeCentral_RemoveFakeDescriptor_ResponseParams.decode = function(decoder) { + var packed; + var val = new FakeCentral_RemoveFakeDescriptor_ResponseParams(); + var numberOfBytes = decoder.readUint32(); + var version = decoder.readUint32(); + packed = decoder.readUint8(); + val.success = (packed >> 0) & 1 ? true : false; + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + return val; + }; + + FakeCentral_RemoveFakeDescriptor_ResponseParams.encode = function(encoder, val) { + var packed; + encoder.writeUint32(FakeCentral_RemoveFakeDescriptor_ResponseParams.encodedSize); + encoder.writeUint32(0); + packed = 0; + packed |= (val.success & 1) << 0 + encoder.writeUint8(packed); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + }; function FakeCentral_SetNextReadCharacteristicResponse_Params(values) { this.initDefaults_(); this.initFields_(values); @@ -2747,25 +2896,25 @@ encoder.skip(1); encoder.skip(1); }; - function FakeCentral_GetLastWrittenValue_Params(values) { + function FakeCentral_GetLastWrittenCharacteristicValue_Params(values) { this.initDefaults_(); this.initFields_(values); } - FakeCentral_GetLastWrittenValue_Params.prototype.initDefaults_ = function() { + FakeCentral_GetLastWrittenCharacteristicValue_Params.prototype.initDefaults_ = function() { this.characteristicId = null; this.serviceId = null; this.peripheralAddress = null; }; - FakeCentral_GetLastWrittenValue_Params.prototype.initFields_ = function(fields) { + FakeCentral_GetLastWrittenCharacteristicValue_Params.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; - FakeCentral_GetLastWrittenValue_Params.validate = function(messageValidator, offset) { + FakeCentral_GetLastWrittenCharacteristicValue_Params.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) @@ -2779,19 +2928,19 @@ return err; - // validate FakeCentral_GetLastWrittenValue_Params.characteristicId + // validate FakeCentral_GetLastWrittenCharacteristicValue_Params.characteristicId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) if (err !== validator.validationError.NONE) return err; - // validate FakeCentral_GetLastWrittenValue_Params.serviceId + // validate FakeCentral_GetLastWrittenCharacteristicValue_Params.serviceId err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) if (err !== validator.validationError.NONE) return err; - // validate FakeCentral_GetLastWrittenValue_Params.peripheralAddress + // validate FakeCentral_GetLastWrittenCharacteristicValue_Params.peripheralAddress err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, false) if (err !== validator.validationError.NONE) return err; @@ -2799,11 +2948,11 @@ return validator.validationError.NONE; }; - FakeCentral_GetLastWrittenValue_Params.encodedSize = codec.kStructHeaderSize + 24; + FakeCentral_GetLastWrittenCharacteristicValue_Params.encodedSize = codec.kStructHeaderSize + 24; - FakeCentral_GetLastWrittenValue_Params.decode = function(decoder) { + FakeCentral_GetLastWrittenCharacteristicValue_Params.decode = function(decoder) { var packed; - var val = new FakeCentral_GetLastWrittenValue_Params(); + var val = new FakeCentral_GetLastWrittenCharacteristicValue_Params(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); val.characteristicId = decoder.decodeStruct(codec.String); @@ -2812,32 +2961,32 @@ return val; }; - FakeCentral_GetLastWrittenValue_Params.encode = function(encoder, val) { + FakeCentral_GetLastWrittenCharacteristicValue_Params.encode = function(encoder, val) { var packed; - encoder.writeUint32(FakeCentral_GetLastWrittenValue_Params.encodedSize); + encoder.writeUint32(FakeCentral_GetLastWrittenCharacteristicValue_Params.encodedSize); encoder.writeUint32(0); encoder.encodeStruct(codec.String, val.characteristicId); encoder.encodeStruct(codec.String, val.serviceId); encoder.encodeStruct(codec.String, val.peripheralAddress); }; - function FakeCentral_GetLastWrittenValue_ResponseParams(values) { + function FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams(values) { this.initDefaults_(); this.initFields_(values); } - FakeCentral_GetLastWrittenValue_ResponseParams.prototype.initDefaults_ = function() { + FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.prototype.initDefaults_ = function() { this.success = false; this.value = null; }; - FakeCentral_GetLastWrittenValue_ResponseParams.prototype.initFields_ = function(fields) { + FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.prototype.initFields_ = function(fields) { for(var field in fields) { if (this.hasOwnProperty(field)) this[field] = fields[field]; } }; - FakeCentral_GetLastWrittenValue_ResponseParams.validate = function(messageValidator, offset) { + FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.validate = function(messageValidator, offset) { var err; err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); if (err !== validator.validationError.NONE) @@ -2852,7 +3001,7 @@ - // validate FakeCentral_GetLastWrittenValue_ResponseParams.value + // validate FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.value err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 1, codec.Uint8, true, [0], 0); if (err !== validator.validationError.NONE) return err; @@ -2860,11 +3009,11 @@ return validator.validationError.NONE; }; - FakeCentral_GetLastWrittenValue_ResponseParams.encodedSize = codec.kStructHeaderSize + 16; + FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.encodedSize = codec.kStructHeaderSize + 16; - FakeCentral_GetLastWrittenValue_ResponseParams.decode = function(decoder) { + FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.decode = function(decoder) { var packed; - var val = new FakeCentral_GetLastWrittenValue_ResponseParams(); + var val = new FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); packed = decoder.readUint8(); @@ -2880,9 +3029,9 @@ return val; }; - FakeCentral_GetLastWrittenValue_ResponseParams.encode = function(encoder, val) { + FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.encode = function(encoder, val) { var packed; - encoder.writeUint32(FakeCentral_GetLastWrittenValue_ResponseParams.encodedSize); + encoder.writeUint32(FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.encodedSize); encoder.writeUint32(0); packed = 0; packed |= (val.success & 1) << 0 @@ -3070,6 +3219,329 @@ encoder.skip(1); encoder.skip(1); }; + function FakeCentral_SetNextWriteDescriptorResponse_Params(values) { + this.initDefaults_(); + this.initFields_(values); + } + + + FakeCentral_SetNextWriteDescriptorResponse_Params.prototype.initDefaults_ = function() { + this.gattCode = 0; + this.descriptorId = null; + this.characteristicId = null; + this.serviceId = null; + this.peripheralAddress = null; + }; + FakeCentral_SetNextWriteDescriptorResponse_Params.prototype.initFields_ = function(fields) { + for(var field in fields) { + if (this.hasOwnProperty(field)) + this[field] = fields[field]; + } + }; + + FakeCentral_SetNextWriteDescriptorResponse_Params.validate = function(messageValidator, offset) { + var err; + err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); + if (err !== validator.validationError.NONE) + return err; + + var kVersionSizes = [ + {version: 0, numBytes: 48} + ]; + err = messageValidator.validateStructVersion(offset, kVersionSizes); + if (err !== validator.validationError.NONE) + return err; + + + + // validate FakeCentral_SetNextWriteDescriptorResponse_Params.descriptorId + err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) + if (err !== validator.validationError.NONE) + return err; + + + // validate FakeCentral_SetNextWriteDescriptorResponse_Params.characteristicId + err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, false) + if (err !== validator.validationError.NONE) + return err; + + + // validate FakeCentral_SetNextWriteDescriptorResponse_Params.serviceId + err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 24, false) + if (err !== validator.validationError.NONE) + return err; + + + // validate FakeCentral_SetNextWriteDescriptorResponse_Params.peripheralAddress + err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 32, false) + if (err !== validator.validationError.NONE) + return err; + + return validator.validationError.NONE; + }; + + FakeCentral_SetNextWriteDescriptorResponse_Params.encodedSize = codec.kStructHeaderSize + 40; + + FakeCentral_SetNextWriteDescriptorResponse_Params.decode = function(decoder) { + var packed; + var val = new FakeCentral_SetNextWriteDescriptorResponse_Params(); + var numberOfBytes = decoder.readUint32(); + var version = decoder.readUint32(); + val.gattCode = decoder.decodeStruct(codec.Uint16); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + val.descriptorId = decoder.decodeStruct(codec.String); + val.characteristicId = decoder.decodeStruct(codec.String); + val.serviceId = decoder.decodeStruct(codec.String); + val.peripheralAddress = decoder.decodeStruct(codec.String); + return val; + }; + + FakeCentral_SetNextWriteDescriptorResponse_Params.encode = function(encoder, val) { + var packed; + encoder.writeUint32(FakeCentral_SetNextWriteDescriptorResponse_Params.encodedSize); + encoder.writeUint32(0); + encoder.encodeStruct(codec.Uint16, val.gattCode); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.encodeStruct(codec.String, val.descriptorId); + encoder.encodeStruct(codec.String, val.characteristicId); + encoder.encodeStruct(codec.String, val.serviceId); + encoder.encodeStruct(codec.String, val.peripheralAddress); + }; + function FakeCentral_SetNextWriteDescriptorResponse_ResponseParams(values) { + this.initDefaults_(); + this.initFields_(values); + } + + + FakeCentral_SetNextWriteDescriptorResponse_ResponseParams.prototype.initDefaults_ = function() { + this.success = false; + }; + FakeCentral_SetNextWriteDescriptorResponse_ResponseParams.prototype.initFields_ = function(fields) { + for(var field in fields) { + if (this.hasOwnProperty(field)) + this[field] = fields[field]; + } + }; + + FakeCentral_SetNextWriteDescriptorResponse_ResponseParams.validate = function(messageValidator, offset) { + var err; + err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); + if (err !== validator.validationError.NONE) + return err; + + var kVersionSizes = [ + {version: 0, numBytes: 16} + ]; + err = messageValidator.validateStructVersion(offset, kVersionSizes); + if (err !== validator.validationError.NONE) + return err; + + + return validator.validationError.NONE; + }; + + FakeCentral_SetNextWriteDescriptorResponse_ResponseParams.encodedSize = codec.kStructHeaderSize + 8; + + FakeCentral_SetNextWriteDescriptorResponse_ResponseParams.decode = function(decoder) { + var packed; + var val = new FakeCentral_SetNextWriteDescriptorResponse_ResponseParams(); + var numberOfBytes = decoder.readUint32(); + var version = decoder.readUint32(); + packed = decoder.readUint8(); + val.success = (packed >> 0) & 1 ? true : false; + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + return val; + }; + + FakeCentral_SetNextWriteDescriptorResponse_ResponseParams.encode = function(encoder, val) { + var packed; + encoder.writeUint32(FakeCentral_SetNextWriteDescriptorResponse_ResponseParams.encodedSize); + encoder.writeUint32(0); + packed = 0; + packed |= (val.success & 1) << 0 + encoder.writeUint8(packed); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + }; + function FakeCentral_GetLastWrittenDescriptorValue_Params(values) { + this.initDefaults_(); + this.initFields_(values); + } + + + FakeCentral_GetLastWrittenDescriptorValue_Params.prototype.initDefaults_ = function() { + this.descriptorId = null; + this.characteristicId = null; + this.serviceId = null; + this.peripheralAddress = null; + }; + FakeCentral_GetLastWrittenDescriptorValue_Params.prototype.initFields_ = function(fields) { + for(var field in fields) { + if (this.hasOwnProperty(field)) + this[field] = fields[field]; + } + }; + + FakeCentral_GetLastWrittenDescriptorValue_Params.validate = function(messageValidator, offset) { + var err; + err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); + if (err !== validator.validationError.NONE) + return err; + + var kVersionSizes = [ + {version: 0, numBytes: 40} + ]; + err = messageValidator.validateStructVersion(offset, kVersionSizes); + if (err !== validator.validationError.NONE) + return err; + + + // validate FakeCentral_GetLastWrittenDescriptorValue_Params.descriptorId + err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) + if (err !== validator.validationError.NONE) + return err; + + + // validate FakeCentral_GetLastWrittenDescriptorValue_Params.characteristicId + err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) + if (err !== validator.validationError.NONE) + return err; + + + // validate FakeCentral_GetLastWrittenDescriptorValue_Params.serviceId + err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, false) + if (err !== validator.validationError.NONE) + return err; + + + // validate FakeCentral_GetLastWrittenDescriptorValue_Params.peripheralAddress + err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 24, false) + if (err !== validator.validationError.NONE) + return err; + + return validator.validationError.NONE; + }; + + FakeCentral_GetLastWrittenDescriptorValue_Params.encodedSize = codec.kStructHeaderSize + 32; + + FakeCentral_GetLastWrittenDescriptorValue_Params.decode = function(decoder) { + var packed; + var val = new FakeCentral_GetLastWrittenDescriptorValue_Params(); + var numberOfBytes = decoder.readUint32(); + var version = decoder.readUint32(); + val.descriptorId = decoder.decodeStruct(codec.String); + val.characteristicId = decoder.decodeStruct(codec.String); + val.serviceId = decoder.decodeStruct(codec.String); + val.peripheralAddress = decoder.decodeStruct(codec.String); + return val; + }; + + FakeCentral_GetLastWrittenDescriptorValue_Params.encode = function(encoder, val) { + var packed; + encoder.writeUint32(FakeCentral_GetLastWrittenDescriptorValue_Params.encodedSize); + encoder.writeUint32(0); + encoder.encodeStruct(codec.String, val.descriptorId); + encoder.encodeStruct(codec.String, val.characteristicId); + encoder.encodeStruct(codec.String, val.serviceId); + encoder.encodeStruct(codec.String, val.peripheralAddress); + }; + function FakeCentral_GetLastWrittenDescriptorValue_ResponseParams(values) { + this.initDefaults_(); + this.initFields_(values); + } + + + FakeCentral_GetLastWrittenDescriptorValue_ResponseParams.prototype.initDefaults_ = function() { + this.success = false; + this.value = null; + }; + FakeCentral_GetLastWrittenDescriptorValue_ResponseParams.prototype.initFields_ = function(fields) { + for(var field in fields) { + if (this.hasOwnProperty(field)) + this[field] = fields[field]; + } + }; + + FakeCentral_GetLastWrittenDescriptorValue_ResponseParams.validate = function(messageValidator, offset) { + var err; + err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); + if (err !== validator.validationError.NONE) + return err; + + var kVersionSizes = [ + {version: 0, numBytes: 24} + ]; + err = messageValidator.validateStructVersion(offset, kVersionSizes); + if (err !== validator.validationError.NONE) + return err; + + + + // validate FakeCentral_GetLastWrittenDescriptorValue_ResponseParams.value + err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 1, codec.Uint8, true, [0], 0); + if (err !== validator.validationError.NONE) + return err; + + return validator.validationError.NONE; + }; + + FakeCentral_GetLastWrittenDescriptorValue_ResponseParams.encodedSize = codec.kStructHeaderSize + 16; + + FakeCentral_GetLastWrittenDescriptorValue_ResponseParams.decode = function(decoder) { + var packed; + var val = new FakeCentral_GetLastWrittenDescriptorValue_ResponseParams(); + var numberOfBytes = decoder.readUint32(); + var version = decoder.readUint32(); + packed = decoder.readUint8(); + val.success = (packed >> 0) & 1 ? true : false; + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + decoder.skip(1); + val.value = decoder.decodeArrayPointer(codec.Uint8); + return val; + }; + + FakeCentral_GetLastWrittenDescriptorValue_ResponseParams.encode = function(encoder, val) { + var packed; + encoder.writeUint32(FakeCentral_GetLastWrittenDescriptorValue_ResponseParams.encodedSize); + encoder.writeUint32(0); + packed = 0; + packed |= (val.success & 1) << 0 + encoder.writeUint8(packed); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.skip(1); + encoder.encodeArrayPointer(codec.Uint8, val.value); + }; var kFakeBluetooth_SetLESupported_Name = 0; var kFakeBluetooth_SimulateCentral_Name = 1; var kFakeBluetooth_AllResponsesConsumed_Name = 2; @@ -3310,11 +3782,14 @@ var kFakeCentral_AddFakeCharacteristic_Name = 8; var kFakeCentral_RemoveFakeCharacteristic_Name = 9; var kFakeCentral_AddFakeDescriptor_Name = 10; - var kFakeCentral_SetNextReadCharacteristicResponse_Name = 11; - var kFakeCentral_SetNextWriteCharacteristicResponse_Name = 12; - var kFakeCentral_SetNextSubscribeToNotificationsResponse_Name = 13; - var kFakeCentral_GetLastWrittenValue_Name = 14; - var kFakeCentral_SetNextReadDescriptorResponse_Name = 15; + var kFakeCentral_RemoveFakeDescriptor_Name = 11; + var kFakeCentral_SetNextReadCharacteristicResponse_Name = 12; + var kFakeCentral_SetNextWriteCharacteristicResponse_Name = 13; + var kFakeCentral_SetNextSubscribeToNotificationsResponse_Name = 14; + var kFakeCentral_GetLastWrittenCharacteristicValue_Name = 15; + var kFakeCentral_SetNextReadDescriptorResponse_Name = 16; + var kFakeCentral_SetNextWriteDescriptorResponse_Name = 17; + var kFakeCentral_GetLastWrittenDescriptorValue_Name = 18; function FakeCentralPtr(handleOrPtrInfo) { this.ptr = new bindings.InterfacePtrController(FakeCentral, @@ -3623,6 +4098,34 @@ }); }.bind(this)); }; + FakeCentralPtr.prototype.removeFakeDescriptor = function() { + return FakeCentralProxy.prototype.removeFakeDescriptor + .apply(this.ptr.getProxy(), arguments); + }; + + FakeCentralProxy.prototype.removeFakeDescriptor = function(descriptorId, characteristicId, serviceId, peripheralAddress) { + var params = new FakeCentral_RemoveFakeDescriptor_Params(); + params.descriptorId = descriptorId; + params.characteristicId = characteristicId; + params.serviceId = serviceId; + params.peripheralAddress = peripheralAddress; + return new Promise(function(resolve, reject) { + var builder = new codec.MessageV1Builder( + kFakeCentral_RemoveFakeDescriptor_Name, + codec.align(FakeCentral_RemoveFakeDescriptor_Params.encodedSize), + codec.kMessageExpectsResponse, 0); + builder.encodeStruct(FakeCentral_RemoveFakeDescriptor_Params, params); + var message = builder.finish(); + this.receiver_.acceptAndExpectResponse(message).then(function(message) { + var reader = new codec.MessageReader(message); + var responseParams = + reader.decodeStruct(FakeCentral_RemoveFakeDescriptor_ResponseParams); + resolve(responseParams); + }).catch(function(result) { + reject(Error("Connection error: " + result)); + }); + }.bind(this)); + }; FakeCentralPtr.prototype.setNextReadCharacteristicResponse = function() { return FakeCentralProxy.prototype.setNextReadCharacteristicResponse .apply(this.ptr.getProxy(), arguments); @@ -3708,27 +4211,27 @@ }); }.bind(this)); }; - FakeCentralPtr.prototype.getLastWrittenValue = function() { - return FakeCentralProxy.prototype.getLastWrittenValue + FakeCentralPtr.prototype.getLastWrittenCharacteristicValue = function() { + return FakeCentralProxy.prototype.getLastWrittenCharacteristicValue .apply(this.ptr.getProxy(), arguments); }; - FakeCentralProxy.prototype.getLastWrittenValue = function(characteristicId, serviceId, peripheralAddress) { - var params = new FakeCentral_GetLastWrittenValue_Params(); + FakeCentralProxy.prototype.getLastWrittenCharacteristicValue = function(characteristicId, serviceId, peripheralAddress) { + var params = new FakeCentral_GetLastWrittenCharacteristicValue_Params(); params.characteristicId = characteristicId; params.serviceId = serviceId; params.peripheralAddress = peripheralAddress; return new Promise(function(resolve, reject) { var builder = new codec.MessageV1Builder( - kFakeCentral_GetLastWrittenValue_Name, - codec.align(FakeCentral_GetLastWrittenValue_Params.encodedSize), + kFakeCentral_GetLastWrittenCharacteristicValue_Name, + codec.align(FakeCentral_GetLastWrittenCharacteristicValue_Params.encodedSize), codec.kMessageExpectsResponse, 0); - builder.encodeStruct(FakeCentral_GetLastWrittenValue_Params, params); + builder.encodeStruct(FakeCentral_GetLastWrittenCharacteristicValue_Params, params); var message = builder.finish(); this.receiver_.acceptAndExpectResponse(message).then(function(message) { var reader = new codec.MessageReader(message); var responseParams = - reader.decodeStruct(FakeCentral_GetLastWrittenValue_ResponseParams); + reader.decodeStruct(FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams); resolve(responseParams); }).catch(function(result) { reject(Error("Connection error: " + result)); @@ -3765,6 +4268,63 @@ }); }.bind(this)); }; + FakeCentralPtr.prototype.setNextWriteDescriptorResponse = function() { + return FakeCentralProxy.prototype.setNextWriteDescriptorResponse + .apply(this.ptr.getProxy(), arguments); + }; + + FakeCentralProxy.prototype.setNextWriteDescriptorResponse = function(gattCode, descriptorId, characteristicId, serviceId, peripheralAddress) { + var params = new FakeCentral_SetNextWriteDescriptorResponse_Params(); + params.gattCode = gattCode; + params.descriptorId = descriptorId; + params.characteristicId = characteristicId; + params.serviceId = serviceId; + params.peripheralAddress = peripheralAddress; + return new Promise(function(resolve, reject) { + var builder = new codec.MessageV1Builder( + kFakeCentral_SetNextWriteDescriptorResponse_Name, + codec.align(FakeCentral_SetNextWriteDescriptorResponse_Params.encodedSize), + codec.kMessageExpectsResponse, 0); + builder.encodeStruct(FakeCentral_SetNextWriteDescriptorResponse_Params, params); + var message = builder.finish(); + this.receiver_.acceptAndExpectResponse(message).then(function(message) { + var reader = new codec.MessageReader(message); + var responseParams = + reader.decodeStruct(FakeCentral_SetNextWriteDescriptorResponse_ResponseParams); + resolve(responseParams); + }).catch(function(result) { + reject(Error("Connection error: " + result)); + }); + }.bind(this)); + }; + FakeCentralPtr.prototype.getLastWrittenDescriptorValue = function() { + return FakeCentralProxy.prototype.getLastWrittenDescriptorValue + .apply(this.ptr.getProxy(), arguments); + }; + + FakeCentralProxy.prototype.getLastWrittenDescriptorValue = function(descriptorId, characteristicId, serviceId, peripheralAddress) { + var params = new FakeCentral_GetLastWrittenDescriptorValue_Params(); + params.descriptorId = descriptorId; + params.characteristicId = characteristicId; + params.serviceId = serviceId; + params.peripheralAddress = peripheralAddress; + return new Promise(function(resolve, reject) { + var builder = new codec.MessageV1Builder( + kFakeCentral_GetLastWrittenDescriptorValue_Name, + codec.align(FakeCentral_GetLastWrittenDescriptorValue_Params.encodedSize), + codec.kMessageExpectsResponse, 0); + builder.encodeStruct(FakeCentral_GetLastWrittenDescriptorValue_Params, params); + var message = builder.finish(); + this.receiver_.acceptAndExpectResponse(message).then(function(message) { + var reader = new codec.MessageReader(message); + var responseParams = + reader.decodeStruct(FakeCentral_GetLastWrittenDescriptorValue_ResponseParams); + resolve(responseParams); + }).catch(function(result) { + reject(Error("Connection error: " + result)); + }); + }.bind(this)); + }; function FakeCentralStub(delegate) { this.delegate_ = delegate; @@ -3802,6 +4362,9 @@ FakeCentralStub.prototype.addFakeDescriptor = function(descriptorUuid, characteristicId, serviceId, peripheralAddress) { return this.delegate_ && this.delegate_.addFakeDescriptor && this.delegate_.addFakeDescriptor(descriptorUuid, characteristicId, serviceId, peripheralAddress); } + FakeCentralStub.prototype.removeFakeDescriptor = function(descriptorId, characteristicId, serviceId, peripheralAddress) { + return this.delegate_ && this.delegate_.removeFakeDescriptor && this.delegate_.removeFakeDescriptor(descriptorId, characteristicId, serviceId, peripheralAddress); + } FakeCentralStub.prototype.setNextReadCharacteristicResponse = function(gattCode, value, characteristicId, serviceId, peripheralAddress) { return this.delegate_ && this.delegate_.setNextReadCharacteristicResponse && this.delegate_.setNextReadCharacteristicResponse(gattCode, value, characteristicId, serviceId, peripheralAddress); } @@ -3811,12 +4374,18 @@ FakeCentralStub.prototype.setNextSubscribeToNotificationsResponse = function(gattCode, characteristicId, serviceId, peripheralAddress) { return this.delegate_ && this.delegate_.setNextSubscribeToNotificationsResponse && this.delegate_.setNextSubscribeToNotificationsResponse(gattCode, characteristicId, serviceId, peripheralAddress); } - FakeCentralStub.prototype.getLastWrittenValue = function(characteristicId, serviceId, peripheralAddress) { - return this.delegate_ && this.delegate_.getLastWrittenValue && this.delegate_.getLastWrittenValue(characteristicId, serviceId, peripheralAddress); + FakeCentralStub.prototype.getLastWrittenCharacteristicValue = function(characteristicId, serviceId, peripheralAddress) { + return this.delegate_ && this.delegate_.getLastWrittenCharacteristicValue && this.delegate_.getLastWrittenCharacteristicValue(characteristicId, serviceId, peripheralAddress); } FakeCentralStub.prototype.setNextReadDescriptorResponse = function(gattCode, value, descriptorId, characteristicId, serviceId, peripheralAddress) { return this.delegate_ && this.delegate_.setNextReadDescriptorResponse && this.delegate_.setNextReadDescriptorResponse(gattCode, value, descriptorId, characteristicId, serviceId, peripheralAddress); } + FakeCentralStub.prototype.setNextWriteDescriptorResponse = function(gattCode, descriptorId, characteristicId, serviceId, peripheralAddress) { + return this.delegate_ && this.delegate_.setNextWriteDescriptorResponse && this.delegate_.setNextWriteDescriptorResponse(gattCode, descriptorId, characteristicId, serviceId, peripheralAddress); + } + FakeCentralStub.prototype.getLastWrittenDescriptorValue = function(descriptorId, characteristicId, serviceId, peripheralAddress) { + return this.delegate_ && this.delegate_.getLastWrittenDescriptorValue && this.delegate_.getLastWrittenDescriptorValue(descriptorId, characteristicId, serviceId, peripheralAddress); + } FakeCentralStub.prototype.accept = function(message) { var reader = new codec.MessageReader(message); @@ -4004,6 +4573,22 @@ responder.accept(message); }); return true; + case kFakeCentral_RemoveFakeDescriptor_Name: + var params = reader.decodeStruct(FakeCentral_RemoveFakeDescriptor_Params); + this.removeFakeDescriptor(params.descriptorId, params.characteristicId, params.serviceId, params.peripheralAddress).then(function(response) { + var responseParams = + new FakeCentral_RemoveFakeDescriptor_ResponseParams(); + responseParams.success = response.success; + var builder = new codec.MessageV1Builder( + kFakeCentral_RemoveFakeDescriptor_Name, + codec.align(FakeCentral_RemoveFakeDescriptor_ResponseParams.encodedSize), + codec.kMessageIsResponse, reader.requestID); + builder.encodeStruct(FakeCentral_RemoveFakeDescriptor_ResponseParams, + responseParams); + var message = builder.finish(); + responder.accept(message); + }); + return true; case kFakeCentral_SetNextReadCharacteristicResponse_Name: var params = reader.decodeStruct(FakeCentral_SetNextReadCharacteristicResponse_Params); this.setNextReadCharacteristicResponse(params.gattCode, params.value, params.characteristicId, params.serviceId, params.peripheralAddress).then(function(response) { @@ -4052,18 +4637,18 @@ responder.accept(message); }); return true; - case kFakeCentral_GetLastWrittenValue_Name: - var params = reader.decodeStruct(FakeCentral_GetLastWrittenValue_Params); - this.getLastWrittenValue(params.characteristicId, params.serviceId, params.peripheralAddress).then(function(response) { + case kFakeCentral_GetLastWrittenCharacteristicValue_Name: + var params = reader.decodeStruct(FakeCentral_GetLastWrittenCharacteristicValue_Params); + this.getLastWrittenCharacteristicValue(params.characteristicId, params.serviceId, params.peripheralAddress).then(function(response) { var responseParams = - new FakeCentral_GetLastWrittenValue_ResponseParams(); + new FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams(); responseParams.success = response.success; responseParams.value = response.value; var builder = new codec.MessageV1Builder( - kFakeCentral_GetLastWrittenValue_Name, - codec.align(FakeCentral_GetLastWrittenValue_ResponseParams.encodedSize), + kFakeCentral_GetLastWrittenCharacteristicValue_Name, + codec.align(FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.encodedSize), codec.kMessageIsResponse, reader.requestID); - builder.encodeStruct(FakeCentral_GetLastWrittenValue_ResponseParams, + builder.encodeStruct(FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams, responseParams); var message = builder.finish(); responder.accept(message); @@ -4085,6 +4670,39 @@ responder.accept(message); }); return true; + case kFakeCentral_SetNextWriteDescriptorResponse_Name: + var params = reader.decodeStruct(FakeCentral_SetNextWriteDescriptorResponse_Params); + this.setNextWriteDescriptorResponse(params.gattCode, params.descriptorId, params.characteristicId, params.serviceId, params.peripheralAddress).then(function(response) { + var responseParams = + new FakeCentral_SetNextWriteDescriptorResponse_ResponseParams(); + responseParams.success = response.success; + var builder = new codec.MessageV1Builder( + kFakeCentral_SetNextWriteDescriptorResponse_Name, + codec.align(FakeCentral_SetNextWriteDescriptorResponse_ResponseParams.encodedSize), + codec.kMessageIsResponse, reader.requestID); + builder.encodeStruct(FakeCentral_SetNextWriteDescriptorResponse_ResponseParams, + responseParams); + var message = builder.finish(); + responder.accept(message); + }); + return true; + case kFakeCentral_GetLastWrittenDescriptorValue_Name: + var params = reader.decodeStruct(FakeCentral_GetLastWrittenDescriptorValue_Params); + this.getLastWrittenDescriptorValue(params.descriptorId, params.characteristicId, params.serviceId, params.peripheralAddress).then(function(response) { + var responseParams = + new FakeCentral_GetLastWrittenDescriptorValue_ResponseParams(); + responseParams.success = response.success; + responseParams.value = response.value; + var builder = new codec.MessageV1Builder( + kFakeCentral_GetLastWrittenDescriptorValue_Name, + codec.align(FakeCentral_GetLastWrittenDescriptorValue_ResponseParams.encodedSize), + codec.kMessageIsResponse, reader.requestID); + builder.encodeStruct(FakeCentral_GetLastWrittenDescriptorValue_ResponseParams, + responseParams); + var message = builder.finish(); + responder.accept(message); + }); + return true; default: return false; } @@ -4138,6 +4756,10 @@ if (message.expectsResponse()) paramsClass = FakeCentral_AddFakeDescriptor_Params; break; + case kFakeCentral_RemoveFakeDescriptor_Name: + if (message.expectsResponse()) + paramsClass = FakeCentral_RemoveFakeDescriptor_Params; + break; case kFakeCentral_SetNextReadCharacteristicResponse_Name: if (message.expectsResponse()) paramsClass = FakeCentral_SetNextReadCharacteristicResponse_Params; @@ -4150,14 +4772,22 @@ if (message.expectsResponse()) paramsClass = FakeCentral_SetNextSubscribeToNotificationsResponse_Params; break; - case kFakeCentral_GetLastWrittenValue_Name: + case kFakeCentral_GetLastWrittenCharacteristicValue_Name: if (message.expectsResponse()) - paramsClass = FakeCentral_GetLastWrittenValue_Params; + paramsClass = FakeCentral_GetLastWrittenCharacteristicValue_Params; break; case kFakeCentral_SetNextReadDescriptorResponse_Name: if (message.expectsResponse()) paramsClass = FakeCentral_SetNextReadDescriptorResponse_Params; break; + case kFakeCentral_SetNextWriteDescriptorResponse_Name: + if (message.expectsResponse()) + paramsClass = FakeCentral_SetNextWriteDescriptorResponse_Params; + break; + case kFakeCentral_GetLastWrittenDescriptorValue_Name: + if (message.expectsResponse()) + paramsClass = FakeCentral_GetLastWrittenDescriptorValue_Params; + break; } if (paramsClass === null) return validator.validationError.NONE; @@ -4212,6 +4842,10 @@ if (message.isResponse()) paramsClass = FakeCentral_AddFakeDescriptor_ResponseParams; break; + case kFakeCentral_RemoveFakeDescriptor_Name: + if (message.isResponse()) + paramsClass = FakeCentral_RemoveFakeDescriptor_ResponseParams; + break; case kFakeCentral_SetNextReadCharacteristicResponse_Name: if (message.isResponse()) paramsClass = FakeCentral_SetNextReadCharacteristicResponse_ResponseParams; @@ -4224,14 +4858,22 @@ if (message.isResponse()) paramsClass = FakeCentral_SetNextSubscribeToNotificationsResponse_ResponseParams; break; - case kFakeCentral_GetLastWrittenValue_Name: + case kFakeCentral_GetLastWrittenCharacteristicValue_Name: if (message.isResponse()) - paramsClass = FakeCentral_GetLastWrittenValue_ResponseParams; + paramsClass = FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams; break; case kFakeCentral_SetNextReadDescriptorResponse_Name: if (message.isResponse()) paramsClass = FakeCentral_SetNextReadDescriptorResponse_ResponseParams; break; + case kFakeCentral_SetNextWriteDescriptorResponse_Name: + if (message.isResponse()) + paramsClass = FakeCentral_SetNextWriteDescriptorResponse_ResponseParams; + break; + case kFakeCentral_GetLastWrittenDescriptorValue_Name: + if (message.isResponse()) + paramsClass = FakeCentral_GetLastWrittenDescriptorValue_ResponseParams; + break; } if (paramsClass === null) return validator.validationError.NONE; diff --git a/tests/wpt/web-platform-tests/resources/chromium/web-bluetooth-test.js b/tests/wpt/web-platform-tests/resources/chromium/web-bluetooth-test.js index c10685f376c..e08c8c4afa2 100644 --- a/tests/wpt/web-platform-tests/resources/chromium/web-bluetooth-test.js +++ b/tests/wpt/web-platform-tests/resources/chromium/web-bluetooth-test.js @@ -377,7 +377,7 @@ class FakeRemoteGATTCharacteristic { await this.fake_central_ptr_.setNextWriteCharacteristicResponse( gatt_code, ...this.ids_); - if (!success) throw 'setNextWriteResponse failed'; + if (!success) throw 'setNextWriteCharacteristicResponse failed'; } // Sets the next subscribe to notifications response for characteristic with @@ -397,9 +397,10 @@ class FakeRemoteGATTCharacteristic { // Returns null if no value has yet been written to the characteristic. async getLastWrittenValue() { let {success, value} = - await this.fake_central_ptr_.getLastWrittenValue(...this.ids_); + await this.fake_central_ptr_.getLastWrittenCharacteristicValue( + ...this.ids_); - if (!success) throw 'getLastWrittenValue failed'; + if (!success) throw 'getLastWrittenCharacteristicValue failed'; return value; } @@ -444,6 +445,39 @@ class FakeRemoteGATTDescriptor { if (!success) throw 'setNextReadDescriptorResponse failed'; } + + // Sets the next write response for this descriptor to |code|. + // |code| could be a GATT Error Response from + // BT 4.2 Vol 3 Part F 3.4.1.1 Error Response or a number outside that range + // returned by specific platforms e.g. Android returns 0x101 to signal a GATT + // failure. + async setNextWriteResponse(gatt_code) { + let {success} = + await this.fake_central_ptr_.setNextWriteDescriptorResponse( + gatt_code, ...this.ids_); + + if (!success) throw 'setNextWriteDescriptorResponse failed'; + } + + // Gets the last successfully written value to the descriptor. + // Returns null if no value has yet been written to the descriptor. + async getLastWrittenValue() { + let {success, value} = + await this.fake_central_ptr_.getLastWrittenDescriptorValue( + ...this.ids_); + + if (!success) throw 'getLastWrittenDescriptorValue failed'; + + return value; + } + + // Removes the fake GATT Descriptor from its fake characteristic. + async remove() { + let {success} = + await this.fake_central_ptr_.removeFakeDescriptor(...this.ids_); + + if (!success) throw 'remove failed'; + } } // FakeChooser allows clients to simulate events that a user would trigger when diff --git a/tests/wpt/web-platform-tests/resources/idlharness.js b/tests/wpt/web-platform-tests/resources/idlharness.js index af17cee66a6..fee33fd15a9 100644 --- a/tests/wpt/web-platform-tests/resources/idlharness.js +++ b/tests/wpt/web-platform-tests/resources/idlharness.js @@ -177,7 +177,7 @@ IdlArray.prototype.add_idls = function(raw_idls, options) }; //@} -IdlArray.prototype.add_untested_idls = function(raw_idls) +IdlArray.prototype.add_untested_idls = function(raw_idls, options) //@{ { /** Entry point. See documentation at beginning of file. */ @@ -193,7 +193,7 @@ IdlArray.prototype.add_untested_idls = function(raw_idls) } } } - this.internal_add_idls(parsed_idls); + this.internal_add_idls(parsed_idls, options); }; //@} @@ -274,14 +274,14 @@ IdlArray.prototype.internal_add_idls = function(parsed_idls, options) } parsed_idl.array = this; - if (parsed_idl.name in this.members) - { - throw "Duplicate identifier " + parsed_idl.name; - } if (should_skip(parsed_idl.name)) { return; } + if (parsed_idl.name in this.members) + { + throw "Duplicate identifier " + parsed_idl.name; + } switch(parsed_idl.type) { case "interface": @@ -2069,6 +2069,7 @@ IdlInterface.prototype.add_iterable_members = function(member) }; IdlInterface.prototype.test_to_json_operation = function(memberHolderObject, member) { + var instanceName = memberHolderObject.constructor.name; if (member.has_extended_attribute("Default")) { var map = this.default_to_json_operation(); test(function() { @@ -2082,12 +2083,12 @@ IdlInterface.prototype.test_to_json_operation = function(memberHolderObject, mem this.array.assert_type_is(json[k], type); delete json[k]; }, this); - }.bind(this), "Test default toJSON operation of " + this.name); + }.bind(this), "Test default toJSON operation of " + instanceName); } else { test(function() { - assert_true(this.array.is_json_type(member.idlType), JSON.stringify(member.idlType) + " is not an appropriate return value for the toJSON operation of " + this.name); + assert_true(this.array.is_json_type(member.idlType), JSON.stringify(member.idlType) + " is not an appropriate return value for the toJSON operation of " + instanceName); this.array.assert_type_is(memberHolderObject.toJSON(), member.idlType); - }.bind(this), "Test toJSON operation of " + this.name); + }.bind(this), "Test toJSON operation of " + instanceName); } }; diff --git a/tests/wpt/web-platform-tests/resources/test/conftest.py b/tests/wpt/web-platform-tests/resources/test/conftest.py index 047ca1caed2..4688421af23 100644 --- a/tests/wpt/web-platform-tests/resources/test/conftest.py +++ b/tests/wpt/web-platform-tests/resources/test/conftest.py @@ -24,8 +24,8 @@ def pytest_configure(config): config.driver = webdriver.Firefox(firefox_binary=config.getoption("--binary")) config.server = WPTServer(WPT_ROOT) config.server.start() - config.add_cleanup(lambda: config.server.stop()) - config.add_cleanup(lambda: config.driver.quit()) + config.add_cleanup(config.server.stop) + config.add_cleanup(config.driver.quit) class HTMLItem(pytest.Item, pytest.Collector): def __init__(self, filename, parent): 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 c758d5bd327..d9c3fcf611c 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 @@ -12,7 +12,7 @@ <body> <script> "use strict"; - function wrap(obj) { + function wrap(member, obj) { function F(obj) { this._obj = obj; } @@ -20,25 +20,25 @@ F.prototype.toJSON = function() { return this._obj; } - + Object.defineProperty(F, 'name', { value: member.name }); return new F(obj); } var i, obj; i = interfaceFrom("interface A { [Default] object toJSON(); attribute long foo; };"); - i.test_to_json_operation(wrap({ foo: 123 }), i.members[0]); + i.test_to_json_operation(wrap(i, { foo: 123 }), i.members[0]); // should fail (wrong type) i = interfaceFrom("interface B { [Default] object toJSON(); attribute long foo; };"); - i.test_to_json_operation(wrap({ foo: "a value" }), i.members[0]); + i.test_to_json_operation(wrap(i, { foo: "a value" }), i.members[0]); // should handle extraneous attributes (e.g. from an extension specification) i = interfaceFrom("interface C { [Default] object toJSON(); attribute long foo; };"); - i.test_to_json_operation(wrap({ foo: 123, bar: 456 }), i.members[0]); + i.test_to_json_operation(wrap(i, { foo: 123, bar: 456 }), i.members[0]); // should fail (missing property) i = interfaceFrom("interface D { [Default] object toJSON(); attribute long foo; };"); - i.test_to_json_operation(wrap({ }), i.members[0]); + i.test_to_json_operation(wrap(i, { }), i.members[0]); // should fail (should be writable) obj = Object.defineProperties({}, { foo: { @@ -48,7 +48,7 @@ value: 123 }}); i = interfaceFrom("interface F { [Default] object toJSON(); attribute long foo; };"); - i.test_to_json_operation(wrap(obj), i.members[0]); + i.test_to_json_operation(wrap(i, obj), i.members[0]); // should fail (should be enumerable) obj = Object.defineProperties({}, { foo: { @@ -58,7 +58,7 @@ value: 123 }}); i = interfaceFrom("interface G { [Default] object toJSON(); attribute long foo; };"); - i.test_to_json_operation(wrap(obj), i.members[0]); + i.test_to_json_operation(wrap(i, obj), i.members[0]); // should fail (should be configurable) obj = Object.defineProperties({}, { foo: { @@ -68,27 +68,27 @@ value: 123 }}); i = interfaceFrom("interface H { [Default] object toJSON(); attribute long foo; };"); - i.test_to_json_operation(wrap(obj), i.members[0]); + i.test_to_json_operation(wrap(i, obj), i.members[0]); var idl = new IdlArray(); idl.add_idls("interface I : J { [Default] object toJSON(); attribute long foo; };"); idl.add_idls("interface J { [Default] object toJSON(); attribute DOMString foo;};"); var i = idl.members.I; - i.test_to_json_operation(wrap({ foo: 123 }), i.members[0]); + i.test_to_json_operation(wrap(i, { foo: 123 }), i.members[0]); i = interfaceFrom("interface K { [Default] object toJSON(); };"); - i.test_to_json_operation(wrap({}), i.members[0]); + i.test_to_json_operation(wrap(i, {}), i.members[0]); i = interfaceFrom("interface L { DOMString toJSON(); };"); - i.test_to_json_operation(wrap("a string"), i.members[0]); + i.test_to_json_operation(wrap(i, "a string"), i.members[0]); // should fail (wrong output type) i = interfaceFrom("interface M { DOMString toJSON(); };"); - i.test_to_json_operation(wrap({}), i.members[0]); + i.test_to_json_operation(wrap(i, {}), i.members[0]); // should fail (not an IDL type) i = interfaceFrom("interface N { DOMException toJSON(); };"); - i.test_to_json_operation(wrap({}), i.members[0]); + i.test_to_json_operation(wrap(i, {}), i.members[0]); </script> <script type="text/json" id="expected"> { diff --git a/tests/wpt/web-platform-tests/resources/test/wptserver.py b/tests/wpt/web-platform-tests/resources/test/wptserver.py index b06f3e81745..2fd5b9a6f3f 100644 --- a/tests/wpt/web-platform-tests/resources/test/wptserver.py +++ b/tests/wpt/web-platform-tests/resources/test/wptserver.py @@ -1,48 +1,49 @@ import json import os -import ssl import subprocess +import time import urllib2 _CONFIG_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'config.test.json') -with open(_CONFIG_FILE, 'r') as config_handle: - config = json.loads(config_handle.read()) - host = config["host"] - port = config["ports"]["https"][0] class WPTServer(object): - base_url = 'https://%s:%s' % (host, port) def __init__(self, wpt_root): self.wpt_root = wpt_root + with open(_CONFIG_FILE, 'r') as config_handle: + config = json.load(config_handle) + self.host = config["host"] + self.http_port = config["ports"]["http"][0] + self.https_port = config["ports"]["https"][0] + self.base_url = 'http://%s:%s' % (self.host, self.http_port) + self.https_base_url = 'https://%s:%s' % (self.host, self.https_port) def start(self): self.devnull = open(os.devnull, 'w') self.proc = subprocess.Popen( [os.path.join(self.wpt_root, 'wpt'), 'serve', '--config=' + _CONFIG_FILE], - stdout=self.devnull, stderr=self.devnull, cwd=self.wpt_root) - context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) - context.verify_mode = ssl.CERT_NONE - context.check_hostname = False - while True: + for retry in range(5): + # Exponential backoff. + time.sleep(2 ** retry) if self.proc.poll() != None: - raise Exception('Could not start wptserve.') - - try: - urllib2.urlopen(self.base_url, timeout=1, context=context) break - except urllib2.URLError as e: + try: + urllib2.urlopen(self.base_url, timeout=1) + return + except urllib2.URLError: pass + raise Exception('Could not start wptserve.') + def stop(self): - self.proc.kill() + self.proc.terminate() self.proc.wait() self.devnull.close() def url(self, abs_path): - return self.base_url + '/' + os.path.relpath(abs_path, self.wpt_root) + return self.https_base_url + '/' + os.path.relpath(abs_path, self.wpt_root) diff --git a/tests/wpt/web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element.html b/tests/wpt/web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element.html new file mode 100644 index 00000000000..b59460e17b9 --- /dev/null +++ b/tests/wpt/web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element.html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<title>Shadow DOM: Attaching a ShadowRoot for custom elements</title> +<meta name="author" title="Hayato Ito" href="mailto:hayato@chromium.org"> +<link rel="help" href="https://dom.spec.whatwg.org/#dom-element-attachshadow"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> +class MyAutonomousCustomElement extends HTMLElement { +} + +customElements.define('my-custom', MyAutonomousCustomElement); + +test(() => { + assert_true(document.createElement('my-custom').attachShadow({mode: "open"}) instanceof ShadowRoot); +}, 'Element.attachShadow must create an instance of ShadowRoot for autonomous custom elements'); + +class MyCustomizedBuiltinElement extends HTMLInputElement { +} + +customElements.define('my-input', MyCustomizedBuiltinElement, { extends: 'input' }); + +test(() => { + assert_throws({'name': 'NotSupportedError'}, () => { + document.createElement('input', {is: 'my-input'}).attachShadow({mode: "open"}); + }); +}, 'Element.attachShadow must throw a NotSupportedError for customized built-in elements'); +</script> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/tools/.gitignore b/tests/wpt/web-platform-tests/tools/.gitignore index 034e3ccb760..f888ce9935a 100644 --- a/tests/wpt/web-platform-tests/tools/.gitignore +++ b/tests/wpt/web-platform-tests/tools/.gitignore @@ -3,7 +3,6 @@ .coverage.* htmlcov/ coverage.xml -.tox/ .cache/ .hypothesis/ *.py[co] diff --git a/tests/wpt/web-platform-tests/tools/gitignore/gitignore.py b/tests/wpt/web-platform-tests/tools/gitignore/gitignore.py index 629ed6b412e..0be6f8f4c9c 100644 --- a/tests/wpt/web-platform-tests/tools/gitignore/gitignore.py +++ b/tests/wpt/web-platform-tests/tools/gitignore/gitignore.py @@ -17,6 +17,12 @@ def fnmatch_translate(pat, path_name=False): else: any_char = "." parts.append("^(?:.*/)?") + if pat[-1] == "/": + # If the last character is / match this directory or any subdirectory + pat = pat[:-1] + suffix = "(?:/|$)" + else: + suffix = "$" while i < len(pat): c = pat[i] if c == "\\": @@ -63,7 +69,7 @@ def fnmatch_translate(pat, path_name=False): if seq: raise ValueError - parts.append("$") + parts.append(suffix) try: return re.compile("".join(parts)) except Exception: @@ -84,7 +90,7 @@ def parse_line(line): if dir_only: line = line[:-1] - return invert, dir_only, fnmatch_translate(line, "/" in line) + return invert, dir_only, fnmatch_translate(line, dir_only) class PathFilter(object): diff --git a/tests/wpt/web-platform-tests/tools/gitignore/tests/test_gitignore.py b/tests/wpt/web-platform-tests/tools/gitignore/tests/test_gitignore.py index 44f3353e941..75a0d58b2c6 100644 --- a/tests/wpt/web-platform-tests/tools/gitignore/tests/test_gitignore.py +++ b/tests/wpt/web-platform-tests/tools/gitignore/tests/test_gitignore.py @@ -11,7 +11,8 @@ match_data = [ ("/*.c", False, ["a.c", ".c"]), ("**/b", False, ["a/b", "a/c/b"]), ("*b", True, ["ab"]), - ("**/b", True, ["a/b"]) + ("**/b", True, ["a/b"]), + ("a/", True, ["a", "a/b", "a/b/c"]) ] mismatch_data = [ @@ -23,6 +24,7 @@ mismatch_data = [ ("**b", True, ["a/b"]), ("a[/]b", True, ["a/b"]), ("**/b", True, ["a/c/b"]), + ("a", True, ["ab"]) ] invalid_data = [ @@ -40,21 +42,25 @@ filter_data = [ ("c/b", True) ] + def expand_data(compact_data): for pattern, path_name, inputs in compact_data: for input in inputs: yield pattern, input, path_name + @pytest.mark.parametrize("pattern, input, path_name", expand_data(match_data)) def tests_match(pattern, input, path_name): regexp = fnmatch_translate(pattern, path_name) assert regexp.match(input) is not None + @pytest.mark.parametrize("pattern, input, path_name", expand_data(mismatch_data)) def tests_no_match(pattern, input, path_name): regexp = fnmatch_translate(pattern, path_name) assert regexp.match(input) is None + @pytest.mark.parametrize("pattern", invalid_data) def tests_invalid(pattern): with pytest.raises(ValueError): @@ -62,6 +68,7 @@ def tests_invalid(pattern): with pytest.raises(ValueError): fnmatch_translate(pattern, True) + @pytest.mark.parametrize("path, expected", filter_data) def test_path_filter(path, expected): extras = [ diff --git a/tests/wpt/web-platform-tests/tools/lint/lint.py b/tests/wpt/web-platform-tests/tools/lint/lint.py index 7eb3d4ac7ec..8c53d2132f5 100644 --- a/tests/wpt/web-platform-tests/tools/lint/lint.py +++ b/tests/wpt/web-platform-tests/tools/lint/lint.py @@ -60,7 +60,7 @@ you could add the following line to the lint.whitelist file. %s: %s""" def all_filesystem_paths(repo_root, subdir=None): - path_filter = PathFilter(repo_root, extras=[".git/*"]) + path_filter = PathFilter(repo_root, extras=[".git/"]) if subdir: expanded_path = subdir else: @@ -72,8 +72,7 @@ def all_filesystem_paths(repo_root, subdir=None): yield path dirnames[:] = [item for item in dirnames if path_filter(os.path.relpath(os.path.join(dirpath, item) + "/", - repo_root))] - + repo_root)+"/")] def _all_files_equal(paths): """ diff --git a/tests/wpt/web-platform-tests/web-animations/interfaces/Animation/idlharness.html b/tests/wpt/web-platform-tests/web-animations/interfaces/Animation/idlharness.html index 20fca1361e7..0b737a5882e 100644 --- a/tests/wpt/web-platform-tests/web-animations/interfaces/Animation/idlharness.html +++ b/tests/wpt/web-platform-tests/web-animations/interfaces/Animation/idlharness.html @@ -7,43 +7,22 @@ <script src="/resources/WebIDLParser.js"></script> <script src="/resources/idlharness.js"></script> <div id="log"></div> -<script type="text/plain" id="Animation-IDL"> -enum AnimationPlayState { "idle", "pending", "running", "paused", "finished" }; - -[Constructor (optional AnimationEffect? effect = null, - optional AnimationTimeline? timeline)] -interface Animation : EventTarget { - attribute DOMString id; - attribute AnimationEffect? effect; - attribute AnimationTimeline? timeline; - attribute double? startTime; - attribute double? currentTime; - attribute double playbackRate; - readonly attribute AnimationPlayState playState; - readonly attribute boolean pending; - readonly attribute Promise<Animation> ready; - readonly attribute Promise<Animation> finished; - attribute EventHandler onfinish; - attribute EventHandler oncancel; - void cancel (); - void finish (); - void play (); - void pause (); - void updatePlaybackRate (double playbackRate); - void reverse (); -}; -</script> <script> 'use strict'; -const idlArray = new IdlArray(); - -idlArray.add_untested_idls('interface AnimationTimeline {};'); -idlArray.add_untested_idls('interface EventHandler {};'); -idlArray.add_untested_idls('interface EventTarget {};'); -idlArray.add_idls(document.getElementById('Animation-IDL').textContent); -idlArray.add_objects( { Animation: ['new Animation()'] } ); +promise_test(async () => { + const text = await fetch('/interfaces/web-animations.idl').then(response => + response.text(), + ); + const idlArray = new IdlArray(); + idlArray.add_idls(text, { only: ['Animation', 'AnimationPlayState'] }); -idlArray.test(); + idlArray.add_untested_idls('interface AnimationTimeline {};'); + idlArray.add_untested_idls('interface EventHandler {};'); + idlArray.add_untested_idls('interface EventTarget {};'); + idlArray.add_objects( { Animation: ['new Animation()'] } ); + idlArray.test(); + done(); +}, 'Animation interface.'); </script> diff --git a/tests/wpt/web-platform-tests/web-animations/interfaces/AnimationPlaybackEvent/idlharness.html b/tests/wpt/web-platform-tests/web-animations/interfaces/AnimationPlaybackEvent/idlharness.html index 0c3517387cd..9570c0f0dbf 100644 --- a/tests/wpt/web-platform-tests/web-animations/interfaces/AnimationPlaybackEvent/idlharness.html +++ b/tests/wpt/web-platform-tests/web-animations/interfaces/AnimationPlaybackEvent/idlharness.html @@ -8,39 +8,32 @@ <script src="/resources/WebIDLParser.js"></script> <script src="/resources/idlharness.js"></script> <div id="log"></div> -<script type="text/plain" id="AnimationPlaybackEvent-IDL"> -dictionary EventInit { - boolean bubbles = false; - boolean cancelable = false; - boolean composed = false; -}; -dictionary AnimationPlaybackEventInit : EventInit { - double? currentTime = null; - double? timelineTime = null; -}; - -[Exposed=Window, - Constructor (DOMString type, - optional AnimationPlaybackEventInit eventInitDict -)] -interface AnimationPlaybackEvent : Event { - readonly attribute double? currentTime; - readonly attribute double? timelineTime; -}; -</script> <script> 'use strict'; -const idlArray = new IdlArray(); - -idlArray.add_untested_idls('interface Event {};'); -idlArray.add_idls( - document.getElementById('AnimationPlaybackEvent-IDL').textContent -); -idlArray.add_objects({ - AnimationPlaybackEvent: [ 'new AnimationPlaybackEvent(\'cancel\')' ], -}); +promise_test(async () => { + const text = await fetch('/interfaces/web-animations.idl').then(response => + response.text(), + ); + const idlArray = new IdlArray(); + idlArray.add_untested_idls(`dictionary EventInit { + boolean bubbles = false; + boolean cancelable = false; + boolean composed = false; + };`); + idlArray.add_idls(text, { + only: [ + 'AnimationPlaybackEventInit', + 'AnimationPlaybackEvent', + ] + }); -idlArray.test(); + idlArray.add_untested_idls('interface Event {};'); + idlArray.add_objects({ + AnimationPlaybackEvent: ['new AnimationPlaybackEvent(\'cancel\')'], + }); + idlArray.test(); + done(); +}, 'AnimationPlaybackEvent interface.'); </script> diff --git a/tests/wpt/web-platform-tests/web-animations/interfaces/DocumentTimeline/idlharness.html b/tests/wpt/web-platform-tests/web-animations/interfaces/DocumentTimeline/idlharness.html index 696f4f79385..6b22c91780e 100644 --- a/tests/wpt/web-platform-tests/web-animations/interfaces/DocumentTimeline/idlharness.html +++ b/tests/wpt/web-platform-tests/web-animations/interfaces/DocumentTimeline/idlharness.html @@ -7,30 +7,24 @@ <script src="/resources/WebIDLParser.js"></script> <script src="/resources/idlharness.js"></script> <div id="log"></div> -<script type="text/plain" id="AnimationTimeline-IDL"> -interface AnimationTimeline { - readonly attribute double? currentTime; -}; -</script> -<script type="text/plain" id="DocumentTimeline-IDL"> -dictionary DocumentTimelineOptions { - DOMHighResTimeStamp originTime = 0; -}; -[Constructor (optional DocumentTimelineOptions options)] -interface DocumentTimeline : AnimationTimeline { -}; -</script> <script> 'use strict'; -const idlArray = new IdlArray(); - -idlArray.add_idls( - document.getElementById('AnimationTimeline-IDL').textContent); -idlArray.add_idls( - document.getElementById('DocumentTimeline-IDL').textContent); -idlArray.add_objects( { DocumentTimeline: ['document.timeline'] } ); - -idlArray.test(); +promise_test(async () => { + const text = await fetch('/interfaces/web-animations.idl').then(response => + response.text(), + ); + const idlArray = new IdlArray(); + idlArray.add_idls(text, { + only: [ + 'AnimationTimeline', + 'DocumentTimelineOptions', + 'DocumentTimeline', + ] + }); + idlArray.add_objects({ DocumentTimeline: ['document.timeline'] }); + idlArray.test(); + done(); +}, 'DocumentTimeline interface.'); </script> diff --git a/tests/wpt/web-platform-tests/web-animations/interfaces/KeyframeEffect/idlharness.html b/tests/wpt/web-platform-tests/web-animations/interfaces/KeyframeEffect/idlharness.html index 0340a19d31c..00cdd998cfa 100644 --- a/tests/wpt/web-platform-tests/web-animations/interfaces/KeyframeEffect/idlharness.html +++ b/tests/wpt/web-platform-tests/web-animations/interfaces/KeyframeEffect/idlharness.html @@ -10,14 +10,6 @@ <script src="/resources/idlharness.js"></script> <div id="log"></div> <script type="text/plain" id="AnimationEffect-IDL"> -enum FillMode { "none", "forwards", "backwards", "both", "auto" }; -enum PlaybackDirection { - "normal", - "reverse", - "alternate", - "alternate-reverse" -}; - dictionary EffectTiming { double delay = 0.0; double endDelay = 0.0; @@ -55,46 +47,33 @@ interface AnimationEffect { void updateTiming(optional OptionalEffectTiming timing); }; </script> -<script type="text/plain" id="KeyframeEffect-IDL"> -enum IterationCompositeOperation { "replace", "accumulate" }; -enum CompositeOperation { "replace", "add", "accumulate" }; - -dictionary KeyframeEffectOptions : EffectTiming { - IterationCompositeOperation iterationComposite = "replace"; - CompositeOperation composite = "replace"; -}; - -[Exposed=Window, - Constructor ((Element or CSSPseudoElement)? target, - object? keyframes, - optional (unrestricted double or KeyframeEffectOptions) options), - Constructor (KeyframeEffect source)] -interface KeyframeEffect : AnimationEffect { - attribute (Element or CSSPseudoElement)? target; - attribute IterationCompositeOperation iterationComposite; - attribute CompositeOperation composite; - - sequence<object> getKeyframes (); - void setKeyframes (object? keyframes); -}; -</script> <script> 'use strict'; -const idlArray = new IdlArray(); - -idlArray.add_untested_idls('interface CSSPseudoElement {};'); -idlArray.add_untested_idls('interface Element {};'); -idlArray.add_untested_idls( - document.getElementById('AnimationEffect-IDL').textContent -); -idlArray.add_idls( - document.getElementById('KeyframeEffect-IDL').textContent -); -idlArray.add_objects({ - KeyframeEffect: ['new KeyframeEffect(null, null)'], -}); +promise_test(async () => { + const idlArray = new IdlArray(); + idlArray.add_untested_idls( + document.getElementById('AnimationEffect-IDL').textContent + ); + const text = await fetch('/interfaces/web-animations.idl').then(response => + response.text(), + ); + idlArray.add_idls(text, { + only: [ + 'IterationCompositeOperation', + 'CompositeOperation', + 'KeyframeEffectOptions', + 'KeyframeEffect', + ] + }); -idlArray.test(); + idlArray.add_untested_idls('interface CSSPseudoElement {};'); + idlArray.add_untested_idls('interface Element {};'); + idlArray.add_objects({ + KeyframeEffect: ['new KeyframeEffect(null, null)'], + }); + idlArray.test(); + done(); +}, 'KeyframeEffect interface.'); </script> diff --git a/tests/wpt/web-platform-tests/webaudio/idlharness.https.html b/tests/wpt/web-platform-tests/webaudio/idlharness.https.html index a8be8d0ea53..9e15e4798de 100644 --- a/tests/wpt/web-platform-tests/webaudio/idlharness.https.html +++ b/tests/wpt/web-platform-tests/webaudio/idlharness.https.html @@ -25,12 +25,15 @@ promise_test(async t => { const idl_array = new IdlArray(); - - idl_array.add_untested_idls('interface LinkStyle {};'); // Dependency of HTML + // Dependencies of HTML + idl_array.add_untested_idls('interface LinkStyle {};'); + idl_array.add_untested_idls('interface SVGElement {};'); idl_array.add_untested_idls(html); + idl_array.add_untested_idls(dom); idl_array.add_untested_idls(mediacapture); idl_array.add_untested_idls('interface Worklet {};'); + idl_array.add_idls(webaudio); const sample_rate = 44100; diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html index 5de04e916e6..76df63a8a80 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html @@ -99,11 +99,12 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + const pc2 = new RTCPeerConnection(); return generateOffer({ pc, data: true }) .then(offer => promise_rejects(t, 'InvalidModificationError', - pc.setLocalDescription(offer))); + pc2.setLocalDescription(offer))); }, 'setLocalDescription() with offer not created by own createOffer() should reject with InvalidModificationError'); promise_test(t => { diff --git a/tests/wpt/web-platform-tests/workers/modules/dedicated-worker-options-type.html b/tests/wpt/web-platform-tests/workers/modules/dedicated-worker-options-type.html new file mode 100644 index 00000000000..b7c96b15295 --- /dev/null +++ b/tests/wpt/web-platform-tests/workers/modules/dedicated-worker-options-type.html @@ -0,0 +1,47 @@ +<!DOCTYPE html> +<title>DedicatedWorker: WorkerOptions 'type'</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> + +promise_test(() => { + const worker = new Worker('resources/post-message-on-load-worker.js'); + return new Promise(resolve => worker.onmessage = resolve) + .then(msg_event => assert_equals(msg_event.data, 'LOADED')); +}, 'Test worker construction with the default worker type.'); + +promise_test(() => { + const worker = new Worker('resources/post-message-on-load-worker.js', + { type: 'classic' }); + return new Promise(resolve => worker.onmessage = resolve) + .then(msg_event => assert_equals(msg_event.data, 'LOADED')); +}, 'Test worker construction with the "classic" worker type.'); + +promise_test(() => { + const worker = new Worker('resources/post-message-on-load-worker.js', + { type: 'module' }); + return new Promise(resolve => worker.onmessage = resolve) + .then(msg_event => assert_equals(msg_event.data, 'LOADED')); +}, 'Test worker construction with the "module" worker type.'); + +test(() => { + try { + new Worker('resources/post-message-on-load-worker.js', { type: '' }); + assert_unreached( + 'Worker construction with an empty type should throw an exception'); + } catch (e) { + assert_equals(e.name, 'TypeError'); + } +}, 'Test worker construction with an empty worker type.'); + +test(() => { + try { + new Worker('resources/post-message-on-load-worker.js', { type: 'unknown' }); + assert_unreached( + 'Worker construction with an unknown type should throw an exception'); + } catch (e) { + assert_equals(e.name, 'TypeError'); + } +}, 'Test worker construction with an unknown worker type.'); + +</script> diff --git a/tests/wpt/web-platform-tests/workers/modules/dedicated-worker-static-import.html b/tests/wpt/web-platform-tests/workers/modules/dedicated-worker-static-import.html new file mode 100644 index 00000000000..ee5de185800 --- /dev/null +++ b/tests/wpt/web-platform-tests/workers/modules/dedicated-worker-static-import.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<title>DedicatedWorker: static import</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> + +promise_test(() => { + const worker = new Worker('resources/static-import-worker.js', + { type: 'module' }); + return new Promise(resolve => worker.onmessage = resolve) + .then(msg_event => assert_equals(msg_event.data, 'LOADED')); +}, 'Test static import on DedicatedWorkerGlobalScope.'); + +promise_test(() => { + const worker = new Worker('resources/nested-static-import-worker.js', + { type: 'module' }); + return new Promise(resolve => worker.onmessage = resolve) + .then(msg_event => assert_equals(msg_event.data, 'LOADED')); +}, 'Test nested static import on DedicatedWorkerGlobalScope.'); + +</script> diff --git a/tests/wpt/web-platform-tests/workers/modules/resources/nested-static-import-worker.js b/tests/wpt/web-platform-tests/workers/modules/resources/nested-static-import-worker.js new file mode 100644 index 00000000000..bcaf7d89c58 --- /dev/null +++ b/tests/wpt/web-platform-tests/workers/modules/resources/nested-static-import-worker.js @@ -0,0 +1 @@ +import './static-import-worker.js'; diff --git a/tests/wpt/web-platform-tests/workers/modules/resources/post-message-on-load-worker.js b/tests/wpt/web-platform-tests/workers/modules/resources/post-message-on-load-worker.js new file mode 100644 index 00000000000..93818ccad90 --- /dev/null +++ b/tests/wpt/web-platform-tests/workers/modules/resources/post-message-on-load-worker.js @@ -0,0 +1 @@ +postMessage('LOADED'); diff --git a/tests/wpt/web-platform-tests/workers/modules/resources/static-import-worker.js b/tests/wpt/web-platform-tests/workers/modules/resources/static-import-worker.js new file mode 100644 index 00000000000..edb8caf34af --- /dev/null +++ b/tests/wpt/web-platform-tests/workers/modules/resources/static-import-worker.js @@ -0,0 +1 @@ +import './post-message-on-load-worker.js'; |