Update web-platform-tests to revision d04a8fc02b85bd32799691759c8c05ead07cd939

This commit is contained in:
WPT Sync Bot 2018-03-23 21:12:55 -04:00
parent e8fdc677f4
commit 2b35c55ac7
63 changed files with 2068 additions and 340 deletions

View file

@ -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": [
[ [
"/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": [ "css/css-tables/support/base.css": [
[ [
{} {}
@ -272445,6 +272479,11 @@
{} {}
] ]
], ],
"fonts/math/largeop-displayoperatorminheight2000-2AFF-italiccorrection3000.woff": [
[
{}
]
],
"fonts/math/largeop-displayoperatorminheight5000.woff": [ "fonts/math/largeop-displayoperatorminheight5000.woff": [
[ [
{} {}
@ -285330,6 +285369,11 @@
{} {}
] ]
], ],
"interfaces/keyboard-lock.idl": [
[
{}
]
],
"interfaces/magnetometer.idl": [ "interfaces/magnetometer.idl": [
[ [
{} {}
@ -285405,6 +285449,11 @@
{} {}
] ]
], ],
"interfaces/web-animations.idl": [
[
{}
]
],
"interfaces/web-nfc.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": [ "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": [
[ [
"/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": [
[ [
"/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": [
[ [
"/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": [
[ [
"/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.js": [
[ [
"/fetch/api/cors/cors-cookies.any.html", "/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": [
[ [
"/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": [
[ [
"/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.js": [
[ [
"/payment-request/payment-request-not-exposed.https.worker.html", "/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": [
[ [
"/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": [
[ [
"/workers/name-property.html", "/workers/name-property.html",
@ -391299,7 +391433,7 @@
"support" "support"
], ],
"./.gitignore": [ "./.gitignore": [
"4c0250a2fdf8f32f9df4db278c03f0a8722a90d7", "551fbbbbeb5571fc8dfec671e248125097947728",
"support" "support"
], ],
"./.gitmodules": [ "./.gitmodules": [
@ -396967,7 +397101,7 @@
"testharness" "testharness"
], ],
"IndexedDB/interfaces.any.js": [ "IndexedDB/interfaces.any.js": [
"df07f5da63c34969a24fe43bc4268418ab0a5132", "ae562d6b568c1005c5eef5a230b8869729719dff",
"testharness" "testharness"
], ],
"IndexedDB/interleaved-cursors-common.js": [ "IndexedDB/interleaved-cursors-common.js": [
@ -419495,7 +419629,7 @@
"support" "support"
], ],
"conformance-checkers/messages.json": [ "conformance-checkers/messages.json": [
"ba6a1cf2867273360e8c9b7bb70da15bca4e15a7", "5bbf4e62a4f95fdaf4528c20eb824006d2042582",
"support" "support"
], ],
"conformance-checkers/tools/build-svg-tests.py": [ "conformance-checkers/tools/build-svg-tests.py": [
@ -422507,7 +422641,7 @@
"testharness" "testharness"
], ],
"cookie-store/idlharness.tentative.html": [ "cookie-store/idlharness.tentative.html": [
"24a4e59e8d3c0a481c4b448bd3fb677f30d0208f", "8654087597cc0c11b880b0144897dab26691d12a",
"testharness" "testharness"
], ],
"cookie-store/idlharness_serviceworker.js": [ "cookie-store/idlharness_serviceworker.js": [
@ -501102,6 +501236,10 @@
"d00e8651be933262d7f64d22f6e8ce68d23d44eb", "d00e8651be933262d7f64d22f6e8ce68d23d44eb",
"testharness" "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": [ "css/css-grid/grid-definition/grid-inline-support-flexible-lengths-001.html": [
"99215a797996322c89105b8ca5cb426628ec7563", "99215a797996322c89105b8ca5cb426628ec7563",
"testharness" "testharness"
@ -509654,6 +509792,22 @@
"55a759d84f38e6adf0f091c9c0ecaa69060cb51a", "55a759d84f38e6adf0f091c9c0ecaa69060cb51a",
"testharness" "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": [ "css/css-tables/html-to-css-mapping-1.html": [
"55cf746ad6557259534e38a4879d7b6f5a994d6c", "55cf746ad6557259534e38a4879d7b6f5a994d6c",
"testharness" "testharness"
@ -509874,6 +510028,10 @@
"9eeb49d2d78c3f81825de0d9e24de2a097275175", "9eeb49d2d78c3f81825de0d9e24de2a097275175",
"testharness" "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": [ "css/css-tables/width-distribution/td-with-subpixel-padding.html": [
"b93845c332e5153c8a28085303b165d3c96f984e", "b93845c332e5153c8a28085303b165d3c96f984e",
"testharness" "testharness"
@ -522570,6 +522728,10 @@
"ec00a4b773f2ae421b8f688908925e28d2281614", "ec00a4b773f2ae421b8f688908925e28d2281614",
"testharness" "testharness"
], ],
"css/css-typed-om/the-stylepropertymap/properties/column-span.html": [
"276ec2870bc105b046669daa0bdbeffdb080479c",
"testharness"
],
"css/css-typed-om/the-stylepropertymap/properties/direction.html": [ "css/css-typed-om/the-stylepropertymap/properties/direction.html": [
"b7c49aba4e8785f819beeb444c113d937d441089", "b7c49aba4e8785f819beeb444c113d937d441089",
"testharness" "testharness"
@ -546770,6 +546932,10 @@
"c6c16aeceb585d7587e7447964112786f87700cd", "c6c16aeceb585d7587e7447964112786f87700cd",
"testharness" "testharness"
], ],
"dom/ranges/Range-intersectsNode-2.html": [
"9b613f401c6ef6bc9ef70fc43a83df4130d9149c",
"testharness"
],
"dom/ranges/Range-intersectsNode-binding.html": [ "dom/ranges/Range-intersectsNode-binding.html": [
"93ac9f3cc9b506760b685b074cb0f66ea69bebb7", "93ac9f3cc9b506760b685b074cb0f66ea69bebb7",
"testharness" "testharness"
@ -550342,6 +550508,10 @@
"e6326b75fe6449f211ad19b98a9c1d7ed8c7c27f", "e6326b75fe6449f211ad19b98a9c1d7ed8c7c27f",
"testharness" "testharness"
], ],
"fetch/api/cors/cors-cookies-redirect.any.js": [
"700c33865dbb6d6dfe63fc08f646d120e7966484",
"testharness"
],
"fetch/api/cors/cors-cookies.any.js": [ "fetch/api/cors/cors-cookies.any.js": [
"246a6e661ef1179330f9109131cfcb2fa9f5bf64", "246a6e661ef1179330f9109131cfcb2fa9f5bf64",
"testharness" "testharness"
@ -550931,7 +551101,7 @@
"support" "support"
], ],
"fetch/api/resources/inspect-headers.py": [ "fetch/api/resources/inspect-headers.py": [
"c9ac2870a45253664da7de1aaf82626fdd1482bb", "c062c905d538cfa96156fd38d98f586b2c4fb3b5",
"support" "support"
], ],
"fetch/api/resources/keepalive-iframe.html": [ "fetch/api/resources/keepalive-iframe.html": [
@ -550951,7 +551121,7 @@
"support" "support"
], ],
"fetch/api/resources/redirect.py": [ "fetch/api/resources/redirect.py": [
"79c8b1bcad05e05a7b628edb22fdaedbdf2c3bc5", "37307bdb30853c2e824cce1fd9a190741e4975ce",
"support" "support"
], ],
"fetch/api/resources/script-with-header.py": [ "fetch/api/resources/script-with-header.py": [
@ -551730,6 +551900,10 @@
"a218eeab3238839be7d0cc8c326e57d59bd51f83", "a218eeab3238839be7d0cc8c326e57d59bd51f83",
"support" "support"
], ],
"fonts/math/largeop-displayoperatorminheight2000-2AFF-italiccorrection3000.woff": [
"8ace2a167d3e3a7f27af99431b5626834dac53a8",
"support"
],
"fonts/math/largeop-displayoperatorminheight5000.woff": [ "fonts/math/largeop-displayoperatorminheight5000.woff": [
"04f15e131b1ae051eeddbfda429ca154d2c6bda0", "04f15e131b1ae051eeddbfda429ca154d2c6bda0",
"support" "support"
@ -552467,7 +552641,7 @@
"testharness" "testharness"
], ],
"hr-time/idlharness.html": [ "hr-time/idlharness.html": [
"f2cdcba041df089206cc9c811167c41a771905df", "579176cad14656ca5cdc616dd1323dc38a5b62ba",
"testharness" "testharness"
], ],
"hr-time/monotonic-clock.any.js": [ "hr-time/monotonic-clock.any.js": [
@ -567187,7 +567361,7 @@
"testharness" "testharness"
], ],
"html/semantics/forms/the-select-element/selected-index.html": [ "html/semantics/forms/the-select-element/selected-index.html": [
"3dbf338e9065f7f4ad2abfbaa55cf50329768cc2", "98b59224f658d97a782623a054e5c3c5611945a2",
"testharness" "testharness"
], ],
"html/semantics/forms/the-textarea-element/.gitkeep": [ "html/semantics/forms/the-textarea-element/.gitkeep": [
@ -572147,7 +572321,11 @@
"support" "support"
], ],
"interfaces/html.idl": [ "interfaces/html.idl": [
"b2b35732b54cbe3406493a6c121363eccceb4f5c", "7b9b8b054ad2848e7c5983e46222fbdf8b3b8da8",
"support"
],
"interfaces/keyboard-lock.idl": [
"7188a9233db3acc741650d46156e16e9e7a132fa",
"support" "support"
], ],
"interfaces/magnetometer.idl": [ "interfaces/magnetometer.idl": [
@ -572210,6 +572388,10 @@
"7d0ee3d60a923bf454e18f9116cded1cc3a16f9b", "7d0ee3d60a923bf454e18f9116cded1cc3a16f9b",
"support" "support"
], ],
"interfaces/web-animations.idl": [
"8d00ee62fafedfd3e24925f48eed6ba26b5aafc7",
"support"
],
"interfaces/web-nfc.idl": [ "interfaces/web-nfc.idl": [
"105e771bdd9587f029091a5ed590187ed6e86e2a", "105e771bdd9587f029091a5ed590187ed6e86e2a",
"support" "support"
@ -572435,23 +572617,23 @@
"testharness" "testharness"
], ],
"keyboard-lock/idlharness.https.html": [ "keyboard-lock/idlharness.https.html": [
"4b41c1c46a8f7d2374d0ff9d796f3f938c1f74d8", "010771094a9dc58e03a2c1ca2d8416866284fc2b",
"testharness" "testharness"
], ],
"keyboard-lock/navigator-keyboardLock-two-parallel-requests.https.html": [ "keyboard-lock/navigator-keyboard-lock-two-parallel-requests.https.html": [
"ee6fe59233abea9325bf7f5e14c1472a72e45a11", "b594f75f5b0c89c2a5f2b934d170b8ff81ad9839",
"testharness" "testharness"
], ],
"keyboard-lock/navigator-keyboardLock-two-sequential-requests.https.html": [ "keyboard-lock/navigator-keyboard-lock-two-sequential-requests.https.html": [
"02ad8f54b7cebed96553bd96bbd7e8fc0227d3b1", "8990cc5772cdba1281c0a05c6a3c2a80b08b810e",
"testharness" "testharness"
], ],
"keyboard-lock/navigator-keyboardLock.https.html": [ "keyboard-lock/navigator-keyboard-lock.https.html": [
"572f4e827bc3807f4c71641e102d7bac9df3e391", "f95f8408986d73501ec7cce09106a8536bd891b4",
"testharness" "testharness"
], ],
"keyboard-lock/navigator-keyboardUnlock.https.html": [ "keyboard-lock/navigator-keyboard-unlock.https.html": [
"c4de12456714a34fb791b070304da31c99da080f", "f5cc2141ea7c74964d308784901d6d2c242f4369",
"testharness" "testharness"
], ],
"longtask-timing/OWNERS": [ "longtask-timing/OWNERS": [
@ -572622,6 +572804,10 @@
"a9198166947a3d181d21d2597d167d3962c67f6e", "a9198166947a3d181d21d2597d167d3962c67f6e",
"testharness" "testharness"
], ],
"mathml/presentation-markup/scripts/subsup-parameters-2.html": [
"3f3d721e1f0eec90d0b173f02f01a5d4ac16a8cc",
"testharness"
],
"mathml/presentation-markup/scripts/underover-1.html": [ "mathml/presentation-markup/scripts/underover-1.html": [
"372c5f1e01a0fe5e3350579985e4f586838c0ed2", "372c5f1e01a0fe5e3350579985e4f586838c0ed2",
"testharness" "testharness"
@ -572975,7 +573161,7 @@
"support" "support"
], ],
"mathml/tools/largeop.py": [ "mathml/tools/largeop.py": [
"46adcf9fce7218942711b6ca3742d74fce096c7f", "cbf53783db1381e6fb0d22296d395104c4b6b545",
"support" "support"
], ],
"mathml/tools/limits.py": [ "mathml/tools/limits.py": [
@ -581930,6 +582116,10 @@
"7bfce9810c1afdc53a99fa0036c472f6cfbe5deb", "7bfce9810c1afdc53a99fa0036c472f6cfbe5deb",
"testharness" "testharness"
], ],
"payment-request/PaymentItem/type_member.https.html": [
"5568f96eac7b0ebf1d91d468bb30b9eaa8b1a9f0",
"testharness"
],
"payment-request/PaymentRequestUpdateEvent/constructor.http.html": [ "payment-request/PaymentRequestUpdateEvent/constructor.http.html": [
"017f1f1aca43171083833ddb27ff66e39902e85d", "017f1f1aca43171083833ddb27ff66e39902e85d",
"testharness" "testharness"
@ -582054,6 +582244,10 @@
"34dd889e8bc906eb9a99c192e547fab831099f7c", "34dd889e8bc906eb9a99c192e547fab831099f7c",
"testharness" "testharness"
], ],
"payment-request/payment-request-insecure.http.html": [
"34452230c20571ef161fa237130faea57240f532",
"testharness"
],
"payment-request/payment-request-not-exposed.https.worker.js": [ "payment-request/payment-request-not-exposed.https.worker.js": [
"b1c3cdc182cb967ec11b1cad826b333511203d77", "b1c3cdc182cb967ec11b1cad826b333511203d77",
"testharness" "testharness"
@ -582151,7 +582345,7 @@
"support" "support"
], ],
"payment-request/show-method-postmessage-manual.https.html": [ "payment-request/show-method-postmessage-manual.https.html": [
"d2be1d2872a473a48df7139ecd3804f33187ec8f", "e9ca854ea9e13e7b662f0fa66890832bb2f13b69",
"manual" "manual"
], ],
"payment-request/updateWith-method-pmi-handling-manual.https.html": [ "payment-request/updateWith-method-pmi-handling-manual.https.html": [
@ -594330,6 +594524,10 @@
"e33e48a3eb754e961f07b7850caff67eee38fe69", "e33e48a3eb754e961f07b7850caff67eee38fe69",
"testharness" "testharness"
], ],
"shadow-dom/Element-interface-attachShadow-custom-element.html": [
"4628a8a6e145713c7e0e9df0960d51e34df2fc53",
"testharness"
],
"shadow-dom/Element-interface-attachShadow.html": [ "shadow-dom/Element-interface-attachShadow.html": [
"e5b4dedaf8f78a6ce771af4509da8acb3aca3441", "e5b4dedaf8f78a6ce771af4509da8acb3aca3441",
"testharness" "testharness"
@ -600963,7 +601161,7 @@
"testharness" "testharness"
], ],
"web-animations/interfaces/Animation/idlharness.html": [ "web-animations/interfaces/Animation/idlharness.html": [
"b049999bb0512bfa0c3eb8b60176eb9213d663f7", "c73f39e1c27f1b04b4c44ac4e1e747ef3d24b287",
"testharness" "testharness"
], ],
"web-animations/interfaces/Animation/oncancel.html": [ "web-animations/interfaces/Animation/oncancel.html": [
@ -601007,7 +601205,7 @@
"testharness" "testharness"
], ],
"web-animations/interfaces/AnimationPlaybackEvent/idlharness.html": [ "web-animations/interfaces/AnimationPlaybackEvent/idlharness.html": [
"bfdfc896fb5fe4451419464e35fe94b5e4938c2c", "d9fc177ebbc3fa0317125912e38a4bfd65f727c8",
"testharness" "testharness"
], ],
"web-animations/interfaces/Document/getAnimations.html": [ "web-animations/interfaces/Document/getAnimations.html": [
@ -601023,7 +601221,7 @@
"testharness" "testharness"
], ],
"web-animations/interfaces/DocumentTimeline/idlharness.html": [ "web-animations/interfaces/DocumentTimeline/idlharness.html": [
"72cb7900f86611e9c2a1b0f4acd0f634555310b9", "b811b4367df7d4f2a43955323f9ddb5b0a60da14",
"testharness" "testharness"
], ],
"web-animations/interfaces/KeyframeEffect/composite.html": [ "web-animations/interfaces/KeyframeEffect/composite.html": [
@ -601039,7 +601237,7 @@
"testharness" "testharness"
], ],
"web-animations/interfaces/KeyframeEffect/idlharness.html": [ "web-animations/interfaces/KeyframeEffect/idlharness.html": [
"ffe493133d4029820f8b27389a15157706b738e8", "c65dd7fd3c76ac1e5d6f22dbd36544f7900cd992",
"testharness" "testharness"
], ],
"web-animations/interfaces/KeyframeEffect/iterationComposite.html": [ "web-animations/interfaces/KeyframeEffect/iterationComposite.html": [
@ -601339,7 +601537,7 @@
"testharness" "testharness"
], ],
"webaudio/idlharness.https.html": [ "webaudio/idlharness.https.html": [
"7876e16ea643f69315e18c3e17af0d7f95769420", "f42681173fdf4cb8dad2049351f55f3a7ff0fcac",
"testharness" "testharness"
], ],
"webaudio/js/buffer-loader.js": [ "webaudio/js/buffer-loader.js": [
@ -602951,7 +603149,7 @@
"testharness" "testharness"
], ],
"webrtc/RTCPeerConnection-setLocalDescription-offer.html": [ "webrtc/RTCPeerConnection-setLocalDescription-offer.html": [
"9f30ee4801fbcd574d90c3f15a733c448f148649", "117fc91599d11b63f2d232a63bace8e367dbb72a",
"testharness" "testharness"
], ],
"webrtc/RTCPeerConnection-setLocalDescription-pranswer.html": [ "webrtc/RTCPeerConnection-setLocalDescription-pranswer.html": [
@ -608030,6 +608228,26 @@
"6bffa3be83d81e2faa93119e710e4fee93fb855e", "6bffa3be83d81e2faa93119e710e4fee93fb855e",
"testharness" "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": [ "workers/name-property.html": [
"1c53fc1fdc2d6c8ed5592d832a18bdbd3bca541b", "1c53fc1fdc2d6c8ed5592d832a18bdbd3bca541b",
"testharness" "testharness"

View file

@ -0,0 +1,2 @@
[vh_not_refreshing_on_chrome.html]
expected: FAIL

View file

@ -921,3 +921,6 @@
[Range interface: existence and properties of interface prototype object] [Range interface: existence and properties of interface prototype object]
expected: FAIL expected: FAIL
[Test driver]
expected: FAIL

View file

@ -0,0 +1,9 @@
[cors-cookies-redirect.any.worker.html]
[Untitled]
expected: FAIL
[cors-cookies-redirect.any.html]
[Untitled]
expected: FAIL

View file

@ -27,3 +27,9 @@
[Performance interface: window.performance must inherit property "toJSON()" with the proper type] [Performance interface: window.performance must inherit property "toJSON()" with the proper type]
expected: FAIL expected: FAIL
[Test driver]
expected: FAIL
[Stringification of window.performance]
expected: FAIL

View file

@ -13992,3 +13992,24 @@
[HTMLMarqueeElement interface: existence and properties of interface prototype object's @@unscopables property] [HTMLMarqueeElement interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL 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

View file

@ -1,5 +1,6 @@
[idlharness.html] [idlharness.html]
type: testharness type: testharness
expected: ERROR
[PerformanceTiming interface: attribute unloadEventStart] [PerformanceTiming interface: attribute unloadEventStart]
expected: FAIL expected: FAIL

View file

@ -12,3 +12,6 @@
[PerformanceObserver interface: operation takeRecords()] [PerformanceObserver interface: operation takeRecords()]
expected: FAIL expected: FAIL
[Test default toJSON operation of PerformanceMark]
expected: FAIL

View file

@ -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

View file

@ -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

View file

@ -4,6 +4,7 @@
_venv/ _venv/
.cache/ .cache/
.pytest_cache/ .pytest_cache/
.tox/
# Node # Node
node_modules/ node_modules/

View file

@ -9,8 +9,7 @@ promise_test(async t => {
].map(url => fetch(url).then(response => response.text()))); ].map(url => fetch(url).then(response => response.text())));
const idl_array = new IdlArray(); const idl_array = new IdlArray();
idl_array.add_untested_idls('interface LinkStyle {};'); // Needed by html idl_array.add_untested_idls(html, { only: ['WindowOrWorkerGlobalScope'] });
idl_array.add_untested_idls(html);
idl_array.add_untested_idls(dom); idl_array.add_untested_idls(dom);
idl_array.add_idls(indexeddb); idl_array.add_idls(indexeddb);
idl_array.add_objects({ idl_array.add_objects({

View file

@ -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/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/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/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-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: Invalid regular expression: \u201c(\u201d: Unterminated group.", "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-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-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.", "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.",

View file

@ -19,6 +19,7 @@ promise_test(async t => {
// Dependencies of HTML // Dependencies of HTML
idl_array.add_untested_idls('interface Document {};'); idl_array.add_untested_idls('interface Document {};');
idl_array.add_untested_idls('interface LinkStyle {};'); 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(html);
idl_array.add_untested_idls('interface Event {};'); idl_array.add_untested_idls('interface Event {};');

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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");

View file

@ -16,6 +16,9 @@ def main(request, response):
headers.append(("Access-Control-Allow-Methods", "GET, POST, HEAD")) headers.append(("Access-Control-Allow-Methods", "GET, POST, HEAD"))
exposed_headers = ["x-request-" + header for header in checked_headers] exposed_headers = ["x-request-" + header for header in checked_headers]
headers.append(("Access-Control-Expose-Headers", ", ".join(exposed_headers))) headers.append(("Access-Control-Expose-Headers", ", ".join(exposed_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(("Access-Control-Allow-Headers", ", ".join(request.headers)))
headers.append(("content-type", "text/plain")) headers.append(("content-type", "text/plain"))

View file

@ -7,10 +7,14 @@ def main(request, response):
status = 302 status = 302
headers = [("Content-Type", "text/plain"), headers = [("Content-Type", "text/plain"),
("Cache-Control", "no-cache"), ("Cache-Control", "no-cache"),
("Pragma", "no-cache"), ("Pragma", "no-cache")]
("Access-Control-Allow-Origin", "*")] if "Origin" in request.headers:
token = None 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: if "token" in request.GET:
token = request.GET.first("token") token = request.GET.first("token")
data = request.server.stash.take(token) data = request.server.stash.take(token)

View file

@ -18,12 +18,7 @@
function doTest([html, hr_time]) { function doTest([html, hr_time]) {
var idl_array = new IdlArray(); var idl_array = new IdlArray();
// HTML is needed for WindowOrWorkerGlobalScope. Provide dummy interfaces for idl_array.add_untested_idls(html, { only: ['WindowOrWorkerGlobalScope'] });
// 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_idls(hr_time); idl_array.add_idls(hr_time);
idl_array.add_objects({ idl_array.add_objects({
Performance: ["window.performance"], Performance: ["window.performance"],

View file

@ -25,6 +25,11 @@
<option></option> <option></option>
<option selected></option> <option selected></option>
</select> </select>
<select id=display-none>
<option style="display:none"></option>
<option></option>
</select>
</form> </form>
<script> <script>
@ -100,4 +105,19 @@ test(function () {
form.reset(); form.reset();
assertSelectedIndex(select, 1); assertSelectedIndex(select, 1);
}, "set and reset (HTMLOptionsCollection)"); }, "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> </script>

View file

@ -97,14 +97,10 @@ interface HTMLElement : Element {
[CEReactions] attribute DOMString lang; [CEReactions] attribute DOMString lang;
[CEReactions] attribute boolean translate; [CEReactions] attribute boolean translate;
[CEReactions] attribute DOMString dir; [CEReactions] attribute DOMString dir;
[SameObject] readonly attribute DOMStringMap dataset;
// user interaction // user interaction
[CEReactions] attribute boolean hidden; [CEReactions] attribute boolean hidden;
void click(); void click();
[CEReactions] attribute long tabIndex;
void focus(optional FocusOptions options);
void blur();
[CEReactions] attribute DOMString accessKey; [CEReactions] attribute DOMString accessKey;
readonly attribute DOMString accessKeyLabel; readonly attribute DOMString accessKeyLabel;
[CEReactions] attribute boolean draggable; [CEReactions] attribute boolean draggable;
@ -124,6 +120,17 @@ HTMLElement includes ElementContentEditable;
// Note: intentionally not [HTMLConstructor] // Note: intentionally not [HTMLConstructor]
interface HTMLUnknownElement : HTMLElement { }; 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, [Exposed=Window,
OverrideBuiltins] OverrideBuiltins]
interface DOMStringMap { interface DOMStringMap {
@ -164,16 +171,11 @@ interface HTMLLinkElement : HTMLElement {
[CEReactions] attribute DOMString as; // (default "") [CEReactions] attribute DOMString as; // (default "")
[SameObject, PutForwards=value] readonly attribute DOMTokenList relList; [SameObject, PutForwards=value] readonly attribute DOMTokenList relList;
[CEReactions] attribute DOMString media; [CEReactions] attribute DOMString media;
[CEReactions] attribute DOMString nonce;
[CEReactions] attribute DOMString integrity; [CEReactions] attribute DOMString integrity;
[CEReactions] attribute DOMString hreflang; [CEReactions] attribute DOMString hreflang;
[CEReactions] attribute DOMString type; [CEReactions] attribute DOMString type;
[SameObject, PutForwards=value] readonly attribute DOMTokenList sizes; [SameObject, PutForwards=value] readonly attribute DOMTokenList sizes;
[CEReactions] attribute DOMString referrerPolicy; [CEReactions] attribute DOMString referrerPolicy;
[CEReactions] attribute DOMString workerType;
[CEReactions] attribute DOMString updateViaCache;
// also has obsolete members
}; };
HTMLLinkElement includes LinkStyle; HTMLLinkElement includes LinkStyle;
@ -191,8 +193,6 @@ interface HTMLMetaElement : HTMLElement {
HTMLConstructor] HTMLConstructor]
interface HTMLStyleElement : HTMLElement { interface HTMLStyleElement : HTMLElement {
[CEReactions] attribute DOMString media; [CEReactions] attribute DOMString media;
[CEReactions] attribute DOMString nonce;
[CEReactions] attribute DOMString type;
}; };
HTMLStyleElement includes LinkStyle; HTMLStyleElement includes LinkStyle;
@ -1108,11 +1108,8 @@ interface HTMLScriptElement : HTMLElement {
[CEReactions] attribute boolean defer; [CEReactions] attribute boolean defer;
[CEReactions] attribute DOMString? crossOrigin; [CEReactions] attribute DOMString? crossOrigin;
[CEReactions] attribute DOMString text; [CEReactions] attribute DOMString text;
[CEReactions] attribute DOMString nonce;
[CEReactions] attribute DOMString integrity; [CEReactions] attribute DOMString integrity;
// also has obsolete members
}; };
[Exposed=Window, [Exposed=Window,
@ -2379,6 +2376,10 @@ partial interface HTMLPreElement {
[CEReactions] attribute long width; [CEReactions] attribute long width;
}; };
partial interface HTMLStyleElement {
[CEReactions] attribute DOMString type;
};
partial interface HTMLScriptElement { partial interface HTMLScriptElement {
[CEReactions] attribute DOMString charset; [CEReactions] attribute DOMString charset;
[CEReactions] attribute DOMString event; [CEReactions] attribute DOMString event;

View file

@ -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();
};

View file

@ -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;
};

View file

@ -1,41 +1,34 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<title>Keyboard Lock IDL tests</title> <title>Keyboard IDL tests</title>
<link rel="help" href="https://github.com/w3c/keyboard-lock"/> <link rel="help" href="https://w3c.github.io/keyboard-lock/"/>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="/resources/WebIDLParser.js"></script> <script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.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> <script>
var idl_array = new IdlArray(); 'use strict';
idl_array.add_untested_idls(
document.getElementById("untested_idl").textContent); function doTest(idls) {
idl_array.add_idls(document.getElementById("idl").textContent); var idl_array = new IdlArray();
idl_array.add_objects({ idl_array.add_untested_idls('interface Navigator {};');
Navigator: ["navigator"] for (let idl of idls) {
}); idl_array.add_idls(idl);
idl_array.test(); }
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> </script>
<div id="log"></div>
</body>
</html>

View file

@ -5,11 +5,11 @@
'use strict'; 'use strict';
promise_test((t) => { promise_test((t) => {
const p1 = navigator.keyboardLock(['a', 'b']); const p1 = navigator.keyboard.lock(['a', 'b']);
const p2 = navigator.keyboardLock(['c', 'd']); const p2 = navigator.keyboard.lock(['c', 'd']);
return promise_rejects(t, null, p2, return promise_rejects(t, null, p2,
'keyboardLock() should only be ' + 'keyboard.lock() should only be ' +
'executed if another request has finished.'); 'executed if another request has finished.');
}, 'Keyboard Lock keyboardLock twice in parallel'); }, '[Keyboard Lock] keyboard.lock twice in parallel');
</script> </script>

View file

@ -5,10 +5,10 @@
'use strict'; 'use strict';
promise_test(() => { promise_test(() => {
return navigator.keyboardLock(['a', 'b']) return navigator.keyboard.lock(['a', 'b'])
.then(() => { .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> </script>

View file

@ -5,9 +5,9 @@
'use strict'; 'use strict';
promise_test(() => { promise_test(() => {
const p = navigator.keyboardLock(['a', 'b']); const p = navigator.keyboard.lock(['a', 'b']);
assert_true(p instanceof Promise); assert_true(p instanceof Promise);
return p; return p;
}, 'Keyboard Lock keyboardLock'); }, '[Keyboard Lock] keyboard.lock');
</script> </script>

View file

@ -5,8 +5,8 @@
'use strict'; 'use strict';
test(() => { test(() => {
assert_equals(navigator.keyboardUnlock(), assert_equals(navigator.keyboard.unlock(),
undefined); undefined);
}, 'Keyboard Lock keyboardUnlock'); }, '[Keyboard Lock] keyboard.unlock');
</script> </script>

View file

@ -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">&#x2AFF;</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">&#x2AFF;</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">&#x2AFF;</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">&#x2AFF;</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">&#x2AFF;</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">&#x2AFF;</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">&#x2AFF;</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">&#x2AFF;</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>

View file

@ -12,3 +12,21 @@ g = f.createChar(-1, "uni2AFF.display")
mathfont.drawRectangleGlyph(g, mathfont.em, v1, 0) mathfont.drawRectangleGlyph(g, mathfont.em, v1, 0)
f[nAryWhiteVerticalBarCodePoint].verticalVariants = "uni2AFF uni2AFF.display" f[nAryWhiteVerticalBarCodePoint].verticalVariants = "uni2AFF uni2AFF.display"
mathfont.save(f) 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)

View file

@ -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>

View file

@ -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>

View file

@ -9,6 +9,35 @@
setup({ setup({
explicit_done: true, explicit_done: true,
explicit_timeout: 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) { async function runUserActivation(button) {
@ -27,6 +56,7 @@ async function runUserActivation(button) {
}, button.textContent.trim()); }, button.textContent.trim());
done(); done();
} }
</script> </script>
<h2>Test PaymentRequest.show() triggered by user activation using postMessage()</h2> <h2>Test PaymentRequest.show() triggered by user activation using postMessage()</h2>
<p> <p>

View file

@ -2270,6 +2270,155 @@
encoder.writeUint32(0); encoder.writeUint32(0);
encoder.encodeStruct(codec.NullableString, val.descriptorId); 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) { function FakeCentral_SetNextReadCharacteristicResponse_Params(values) {
this.initDefaults_(); this.initDefaults_();
this.initFields_(values); this.initFields_(values);
@ -2747,25 +2896,25 @@
encoder.skip(1); encoder.skip(1);
encoder.skip(1); encoder.skip(1);
}; };
function FakeCentral_GetLastWrittenValue_Params(values) { function FakeCentral_GetLastWrittenCharacteristicValue_Params(values) {
this.initDefaults_(); this.initDefaults_();
this.initFields_(values); this.initFields_(values);
} }
FakeCentral_GetLastWrittenValue_Params.prototype.initDefaults_ = function() { FakeCentral_GetLastWrittenCharacteristicValue_Params.prototype.initDefaults_ = function() {
this.characteristicId = null; this.characteristicId = null;
this.serviceId = null; this.serviceId = null;
this.peripheralAddress = null; this.peripheralAddress = null;
}; };
FakeCentral_GetLastWrittenValue_Params.prototype.initFields_ = function(fields) { FakeCentral_GetLastWrittenCharacteristicValue_Params.prototype.initFields_ = function(fields) {
for(var field in fields) { for(var field in fields) {
if (this.hasOwnProperty(field)) if (this.hasOwnProperty(field))
this[field] = fields[field]; this[field] = fields[field];
} }
}; };
FakeCentral_GetLastWrittenValue_Params.validate = function(messageValidator, offset) { FakeCentral_GetLastWrittenCharacteristicValue_Params.validate = function(messageValidator, offset) {
var err; var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE) if (err !== validator.validationError.NONE)
@ -2779,19 +2928,19 @@
return err; return err;
// validate FakeCentral_GetLastWrittenValue_Params.characteristicId // validate FakeCentral_GetLastWrittenCharacteristicValue_Params.characteristicId
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false) err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
if (err !== validator.validationError.NONE) if (err !== validator.validationError.NONE)
return err; return err;
// validate FakeCentral_GetLastWrittenValue_Params.serviceId // validate FakeCentral_GetLastWrittenCharacteristicValue_Params.serviceId
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false)
if (err !== validator.validationError.NONE) if (err !== validator.validationError.NONE)
return err; return err;
// validate FakeCentral_GetLastWrittenValue_Params.peripheralAddress // validate FakeCentral_GetLastWrittenCharacteristicValue_Params.peripheralAddress
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, false) err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, false)
if (err !== validator.validationError.NONE) if (err !== validator.validationError.NONE)
return err; return err;
@ -2799,11 +2948,11 @@
return validator.validationError.NONE; 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 packed;
var val = new FakeCentral_GetLastWrittenValue_Params(); var val = new FakeCentral_GetLastWrittenCharacteristicValue_Params();
var numberOfBytes = decoder.readUint32(); var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32(); var version = decoder.readUint32();
val.characteristicId = decoder.decodeStruct(codec.String); val.characteristicId = decoder.decodeStruct(codec.String);
@ -2812,32 +2961,32 @@
return val; return val;
}; };
FakeCentral_GetLastWrittenValue_Params.encode = function(encoder, val) { FakeCentral_GetLastWrittenCharacteristicValue_Params.encode = function(encoder, val) {
var packed; var packed;
encoder.writeUint32(FakeCentral_GetLastWrittenValue_Params.encodedSize); encoder.writeUint32(FakeCentral_GetLastWrittenCharacteristicValue_Params.encodedSize);
encoder.writeUint32(0); encoder.writeUint32(0);
encoder.encodeStruct(codec.String, val.characteristicId); encoder.encodeStruct(codec.String, val.characteristicId);
encoder.encodeStruct(codec.String, val.serviceId); encoder.encodeStruct(codec.String, val.serviceId);
encoder.encodeStruct(codec.String, val.peripheralAddress); encoder.encodeStruct(codec.String, val.peripheralAddress);
}; };
function FakeCentral_GetLastWrittenValue_ResponseParams(values) { function FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams(values) {
this.initDefaults_(); this.initDefaults_();
this.initFields_(values); this.initFields_(values);
} }
FakeCentral_GetLastWrittenValue_ResponseParams.prototype.initDefaults_ = function() { FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.prototype.initDefaults_ = function() {
this.success = false; this.success = false;
this.value = null; this.value = null;
}; };
FakeCentral_GetLastWrittenValue_ResponseParams.prototype.initFields_ = function(fields) { FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.prototype.initFields_ = function(fields) {
for(var field in fields) { for(var field in fields) {
if (this.hasOwnProperty(field)) if (this.hasOwnProperty(field))
this[field] = fields[field]; this[field] = fields[field];
} }
}; };
FakeCentral_GetLastWrittenValue_ResponseParams.validate = function(messageValidator, offset) { FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.validate = function(messageValidator, offset) {
var err; var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE) 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); err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 1, codec.Uint8, true, [0], 0);
if (err !== validator.validationError.NONE) if (err !== validator.validationError.NONE)
return err; return err;
@ -2860,11 +3009,11 @@
return validator.validationError.NONE; 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 packed;
var val = new FakeCentral_GetLastWrittenValue_ResponseParams(); var val = new FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams();
var numberOfBytes = decoder.readUint32(); var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32(); var version = decoder.readUint32();
packed = decoder.readUint8(); packed = decoder.readUint8();
@ -2880,9 +3029,9 @@
return val; return val;
}; };
FakeCentral_GetLastWrittenValue_ResponseParams.encode = function(encoder, val) { FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.encode = function(encoder, val) {
var packed; var packed;
encoder.writeUint32(FakeCentral_GetLastWrittenValue_ResponseParams.encodedSize); encoder.writeUint32(FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.encodedSize);
encoder.writeUint32(0); encoder.writeUint32(0);
packed = 0; packed = 0;
packed |= (val.success & 1) << 0 packed |= (val.success & 1) << 0
@ -3070,6 +3219,329 @@
encoder.skip(1); encoder.skip(1);
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_SetLESupported_Name = 0;
var kFakeBluetooth_SimulateCentral_Name = 1; var kFakeBluetooth_SimulateCentral_Name = 1;
var kFakeBluetooth_AllResponsesConsumed_Name = 2; var kFakeBluetooth_AllResponsesConsumed_Name = 2;
@ -3310,11 +3782,14 @@
var kFakeCentral_AddFakeCharacteristic_Name = 8; var kFakeCentral_AddFakeCharacteristic_Name = 8;
var kFakeCentral_RemoveFakeCharacteristic_Name = 9; var kFakeCentral_RemoveFakeCharacteristic_Name = 9;
var kFakeCentral_AddFakeDescriptor_Name = 10; var kFakeCentral_AddFakeDescriptor_Name = 10;
var kFakeCentral_SetNextReadCharacteristicResponse_Name = 11; var kFakeCentral_RemoveFakeDescriptor_Name = 11;
var kFakeCentral_SetNextWriteCharacteristicResponse_Name = 12; var kFakeCentral_SetNextReadCharacteristicResponse_Name = 12;
var kFakeCentral_SetNextSubscribeToNotificationsResponse_Name = 13; var kFakeCentral_SetNextWriteCharacteristicResponse_Name = 13;
var kFakeCentral_GetLastWrittenValue_Name = 14; var kFakeCentral_SetNextSubscribeToNotificationsResponse_Name = 14;
var kFakeCentral_SetNextReadDescriptorResponse_Name = 15; var kFakeCentral_GetLastWrittenCharacteristicValue_Name = 15;
var kFakeCentral_SetNextReadDescriptorResponse_Name = 16;
var kFakeCentral_SetNextWriteDescriptorResponse_Name = 17;
var kFakeCentral_GetLastWrittenDescriptorValue_Name = 18;
function FakeCentralPtr(handleOrPtrInfo) { function FakeCentralPtr(handleOrPtrInfo) {
this.ptr = new bindings.InterfacePtrController(FakeCentral, this.ptr = new bindings.InterfacePtrController(FakeCentral,
@ -3623,6 +4098,34 @@
}); });
}.bind(this)); }.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() { FakeCentralPtr.prototype.setNextReadCharacteristicResponse = function() {
return FakeCentralProxy.prototype.setNextReadCharacteristicResponse return FakeCentralProxy.prototype.setNextReadCharacteristicResponse
.apply(this.ptr.getProxy(), arguments); .apply(this.ptr.getProxy(), arguments);
@ -3708,27 +4211,27 @@
}); });
}.bind(this)); }.bind(this));
}; };
FakeCentralPtr.prototype.getLastWrittenValue = function() { FakeCentralPtr.prototype.getLastWrittenCharacteristicValue = function() {
return FakeCentralProxy.prototype.getLastWrittenValue return FakeCentralProxy.prototype.getLastWrittenCharacteristicValue
.apply(this.ptr.getProxy(), arguments); .apply(this.ptr.getProxy(), arguments);
}; };
FakeCentralProxy.prototype.getLastWrittenValue = function(characteristicId, serviceId, peripheralAddress) { FakeCentralProxy.prototype.getLastWrittenCharacteristicValue = function(characteristicId, serviceId, peripheralAddress) {
var params = new FakeCentral_GetLastWrittenValue_Params(); var params = new FakeCentral_GetLastWrittenCharacteristicValue_Params();
params.characteristicId = characteristicId; params.characteristicId = characteristicId;
params.serviceId = serviceId; params.serviceId = serviceId;
params.peripheralAddress = peripheralAddress; params.peripheralAddress = peripheralAddress;
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
var builder = new codec.MessageV1Builder( var builder = new codec.MessageV1Builder(
kFakeCentral_GetLastWrittenValue_Name, kFakeCentral_GetLastWrittenCharacteristicValue_Name,
codec.align(FakeCentral_GetLastWrittenValue_Params.encodedSize), codec.align(FakeCentral_GetLastWrittenCharacteristicValue_Params.encodedSize),
codec.kMessageExpectsResponse, 0); codec.kMessageExpectsResponse, 0);
builder.encodeStruct(FakeCentral_GetLastWrittenValue_Params, params); builder.encodeStruct(FakeCentral_GetLastWrittenCharacteristicValue_Params, params);
var message = builder.finish(); var message = builder.finish();
this.receiver_.acceptAndExpectResponse(message).then(function(message) { this.receiver_.acceptAndExpectResponse(message).then(function(message) {
var reader = new codec.MessageReader(message); var reader = new codec.MessageReader(message);
var responseParams = var responseParams =
reader.decodeStruct(FakeCentral_GetLastWrittenValue_ResponseParams); reader.decodeStruct(FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams);
resolve(responseParams); resolve(responseParams);
}).catch(function(result) { }).catch(function(result) {
reject(Error("Connection error: " + result)); reject(Error("Connection error: " + result));
@ -3765,6 +4268,63 @@
}); });
}.bind(this)); }.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) { function FakeCentralStub(delegate) {
this.delegate_ = delegate; this.delegate_ = delegate;
@ -3802,6 +4362,9 @@
FakeCentralStub.prototype.addFakeDescriptor = function(descriptorUuid, characteristicId, serviceId, peripheralAddress) { FakeCentralStub.prototype.addFakeDescriptor = function(descriptorUuid, characteristicId, serviceId, peripheralAddress) {
return this.delegate_ && this.delegate_.addFakeDescriptor && this.delegate_.addFakeDescriptor(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) { FakeCentralStub.prototype.setNextReadCharacteristicResponse = function(gattCode, value, characteristicId, serviceId, peripheralAddress) {
return this.delegate_ && this.delegate_.setNextReadCharacteristicResponse && this.delegate_.setNextReadCharacteristicResponse(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) { FakeCentralStub.prototype.setNextSubscribeToNotificationsResponse = function(gattCode, characteristicId, serviceId, peripheralAddress) {
return this.delegate_ && this.delegate_.setNextSubscribeToNotificationsResponse && this.delegate_.setNextSubscribeToNotificationsResponse(gattCode, characteristicId, serviceId, peripheralAddress); return this.delegate_ && this.delegate_.setNextSubscribeToNotificationsResponse && this.delegate_.setNextSubscribeToNotificationsResponse(gattCode, characteristicId, serviceId, peripheralAddress);
} }
FakeCentralStub.prototype.getLastWrittenValue = function(characteristicId, serviceId, peripheralAddress) { FakeCentralStub.prototype.getLastWrittenCharacteristicValue = function(characteristicId, serviceId, peripheralAddress) {
return this.delegate_ && this.delegate_.getLastWrittenValue && this.delegate_.getLastWrittenValue(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) { 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); 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) { FakeCentralStub.prototype.accept = function(message) {
var reader = new codec.MessageReader(message); var reader = new codec.MessageReader(message);
@ -4004,6 +4573,22 @@
responder.accept(message); responder.accept(message);
}); });
return true; 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: case kFakeCentral_SetNextReadCharacteristicResponse_Name:
var params = reader.decodeStruct(FakeCentral_SetNextReadCharacteristicResponse_Params); var params = reader.decodeStruct(FakeCentral_SetNextReadCharacteristicResponse_Params);
this.setNextReadCharacteristicResponse(params.gattCode, params.value, params.characteristicId, params.serviceId, params.peripheralAddress).then(function(response) { this.setNextReadCharacteristicResponse(params.gattCode, params.value, params.characteristicId, params.serviceId, params.peripheralAddress).then(function(response) {
@ -4052,18 +4637,18 @@
responder.accept(message); responder.accept(message);
}); });
return true; return true;
case kFakeCentral_GetLastWrittenValue_Name: case kFakeCentral_GetLastWrittenCharacteristicValue_Name:
var params = reader.decodeStruct(FakeCentral_GetLastWrittenValue_Params); var params = reader.decodeStruct(FakeCentral_GetLastWrittenCharacteristicValue_Params);
this.getLastWrittenValue(params.characteristicId, params.serviceId, params.peripheralAddress).then(function(response) { this.getLastWrittenCharacteristicValue(params.characteristicId, params.serviceId, params.peripheralAddress).then(function(response) {
var responseParams = var responseParams =
new FakeCentral_GetLastWrittenValue_ResponseParams(); new FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams();
responseParams.success = response.success; responseParams.success = response.success;
responseParams.value = response.value; responseParams.value = response.value;
var builder = new codec.MessageV1Builder( var builder = new codec.MessageV1Builder(
kFakeCentral_GetLastWrittenValue_Name, kFakeCentral_GetLastWrittenCharacteristicValue_Name,
codec.align(FakeCentral_GetLastWrittenValue_ResponseParams.encodedSize), codec.align(FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams.encodedSize),
codec.kMessageIsResponse, reader.requestID); codec.kMessageIsResponse, reader.requestID);
builder.encodeStruct(FakeCentral_GetLastWrittenValue_ResponseParams, builder.encodeStruct(FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams,
responseParams); responseParams);
var message = builder.finish(); var message = builder.finish();
responder.accept(message); responder.accept(message);
@ -4085,6 +4670,39 @@
responder.accept(message); responder.accept(message);
}); });
return true; 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: default:
return false; return false;
} }
@ -4138,6 +4756,10 @@
if (message.expectsResponse()) if (message.expectsResponse())
paramsClass = FakeCentral_AddFakeDescriptor_Params; paramsClass = FakeCentral_AddFakeDescriptor_Params;
break; break;
case kFakeCentral_RemoveFakeDescriptor_Name:
if (message.expectsResponse())
paramsClass = FakeCentral_RemoveFakeDescriptor_Params;
break;
case kFakeCentral_SetNextReadCharacteristicResponse_Name: case kFakeCentral_SetNextReadCharacteristicResponse_Name:
if (message.expectsResponse()) if (message.expectsResponse())
paramsClass = FakeCentral_SetNextReadCharacteristicResponse_Params; paramsClass = FakeCentral_SetNextReadCharacteristicResponse_Params;
@ -4150,14 +4772,22 @@
if (message.expectsResponse()) if (message.expectsResponse())
paramsClass = FakeCentral_SetNextSubscribeToNotificationsResponse_Params; paramsClass = FakeCentral_SetNextSubscribeToNotificationsResponse_Params;
break; break;
case kFakeCentral_GetLastWrittenValue_Name: case kFakeCentral_GetLastWrittenCharacteristicValue_Name:
if (message.expectsResponse()) if (message.expectsResponse())
paramsClass = FakeCentral_GetLastWrittenValue_Params; paramsClass = FakeCentral_GetLastWrittenCharacteristicValue_Params;
break; break;
case kFakeCentral_SetNextReadDescriptorResponse_Name: case kFakeCentral_SetNextReadDescriptorResponse_Name:
if (message.expectsResponse()) if (message.expectsResponse())
paramsClass = FakeCentral_SetNextReadDescriptorResponse_Params; paramsClass = FakeCentral_SetNextReadDescriptorResponse_Params;
break; 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) if (paramsClass === null)
return validator.validationError.NONE; return validator.validationError.NONE;
@ -4212,6 +4842,10 @@
if (message.isResponse()) if (message.isResponse())
paramsClass = FakeCentral_AddFakeDescriptor_ResponseParams; paramsClass = FakeCentral_AddFakeDescriptor_ResponseParams;
break; break;
case kFakeCentral_RemoveFakeDescriptor_Name:
if (message.isResponse())
paramsClass = FakeCentral_RemoveFakeDescriptor_ResponseParams;
break;
case kFakeCentral_SetNextReadCharacteristicResponse_Name: case kFakeCentral_SetNextReadCharacteristicResponse_Name:
if (message.isResponse()) if (message.isResponse())
paramsClass = FakeCentral_SetNextReadCharacteristicResponse_ResponseParams; paramsClass = FakeCentral_SetNextReadCharacteristicResponse_ResponseParams;
@ -4224,14 +4858,22 @@
if (message.isResponse()) if (message.isResponse())
paramsClass = FakeCentral_SetNextSubscribeToNotificationsResponse_ResponseParams; paramsClass = FakeCentral_SetNextSubscribeToNotificationsResponse_ResponseParams;
break; break;
case kFakeCentral_GetLastWrittenValue_Name: case kFakeCentral_GetLastWrittenCharacteristicValue_Name:
if (message.isResponse()) if (message.isResponse())
paramsClass = FakeCentral_GetLastWrittenValue_ResponseParams; paramsClass = FakeCentral_GetLastWrittenCharacteristicValue_ResponseParams;
break; break;
case kFakeCentral_SetNextReadDescriptorResponse_Name: case kFakeCentral_SetNextReadDescriptorResponse_Name:
if (message.isResponse()) if (message.isResponse())
paramsClass = FakeCentral_SetNextReadDescriptorResponse_ResponseParams; paramsClass = FakeCentral_SetNextReadDescriptorResponse_ResponseParams;
break; 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) if (paramsClass === null)
return validator.validationError.NONE; return validator.validationError.NONE;

View file

@ -377,7 +377,7 @@ class FakeRemoteGATTCharacteristic {
await this.fake_central_ptr_.setNextWriteCharacteristicResponse( await this.fake_central_ptr_.setNextWriteCharacteristicResponse(
gatt_code, ...this.ids_); gatt_code, ...this.ids_);
if (!success) throw 'setNextWriteResponse failed'; if (!success) throw 'setNextWriteCharacteristicResponse failed';
} }
// Sets the next subscribe to notifications response for characteristic with // 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. // Returns null if no value has yet been written to the characteristic.
async getLastWrittenValue() { async getLastWrittenValue() {
let {success, value} = 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; return value;
} }
@ -444,6 +445,39 @@ class FakeRemoteGATTDescriptor {
if (!success) throw 'setNextReadDescriptorResponse failed'; 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 // FakeChooser allows clients to simulate events that a user would trigger when

View file

@ -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. */ /** 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; parsed_idl.array = this;
if (parsed_idl.name in this.members)
{
throw "Duplicate identifier " + parsed_idl.name;
}
if (should_skip(parsed_idl.name)) if (should_skip(parsed_idl.name))
{ {
return; return;
} }
if (parsed_idl.name in this.members)
{
throw "Duplicate identifier " + parsed_idl.name;
}
switch(parsed_idl.type) switch(parsed_idl.type)
{ {
case "interface": case "interface":
@ -2069,6 +2069,7 @@ IdlInterface.prototype.add_iterable_members = function(member)
}; };
IdlInterface.prototype.test_to_json_operation = function(memberHolderObject, member) { IdlInterface.prototype.test_to_json_operation = function(memberHolderObject, member) {
var instanceName = memberHolderObject.constructor.name;
if (member.has_extended_attribute("Default")) { if (member.has_extended_attribute("Default")) {
var map = this.default_to_json_operation(); var map = this.default_to_json_operation();
test(function() { test(function() {
@ -2082,12 +2083,12 @@ IdlInterface.prototype.test_to_json_operation = function(memberHolderObject, mem
this.array.assert_type_is(json[k], type); this.array.assert_type_is(json[k], type);
delete json[k]; delete json[k];
}, this); }, this);
}.bind(this), "Test default toJSON operation of " + this.name); }.bind(this), "Test default toJSON operation of " + instanceName);
} else { } else {
test(function() { 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); this.array.assert_type_is(memberHolderObject.toJSON(), member.idlType);
}.bind(this), "Test toJSON operation of " + this.name); }.bind(this), "Test toJSON operation of " + instanceName);
} }
}; };

View file

@ -24,8 +24,8 @@ def pytest_configure(config):
config.driver = webdriver.Firefox(firefox_binary=config.getoption("--binary")) config.driver = webdriver.Firefox(firefox_binary=config.getoption("--binary"))
config.server = WPTServer(WPT_ROOT) config.server = WPTServer(WPT_ROOT)
config.server.start() config.server.start()
config.add_cleanup(lambda: config.server.stop()) config.add_cleanup(config.server.stop)
config.add_cleanup(lambda: config.driver.quit()) config.add_cleanup(config.driver.quit)
class HTMLItem(pytest.Item, pytest.Collector): class HTMLItem(pytest.Item, pytest.Collector):
def __init__(self, filename, parent): def __init__(self, filename, parent):

View file

@ -12,7 +12,7 @@
<body> <body>
<script> <script>
"use strict"; "use strict";
function wrap(obj) { function wrap(member, obj) {
function F(obj) { function F(obj) {
this._obj = obj; this._obj = obj;
} }
@ -20,25 +20,25 @@
F.prototype.toJSON = function() { F.prototype.toJSON = function() {
return this._obj; return this._obj;
} }
Object.defineProperty(F, 'name', { value: member.name });
return new F(obj); return new F(obj);
} }
var i, obj; var i, obj;
i = interfaceFrom("interface A { [Default] object toJSON(); attribute long foo; };"); 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) // should fail (wrong type)
i = interfaceFrom("interface B { [Default] object toJSON(); attribute long foo; };"); 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) // should handle extraneous attributes (e.g. from an extension specification)
i = interfaceFrom("interface C { [Default] object toJSON(); attribute long foo; };"); 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) // should fail (missing property)
i = interfaceFrom("interface D { [Default] object toJSON(); attribute long foo; };"); 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) // should fail (should be writable)
obj = Object.defineProperties({}, { foo: { obj = Object.defineProperties({}, { foo: {
@ -48,7 +48,7 @@
value: 123 value: 123
}}); }});
i = interfaceFrom("interface F { [Default] object toJSON(); attribute long foo; };"); 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) // should fail (should be enumerable)
obj = Object.defineProperties({}, { foo: { obj = Object.defineProperties({}, { foo: {
@ -58,7 +58,7 @@
value: 123 value: 123
}}); }});
i = interfaceFrom("interface G { [Default] object toJSON(); attribute long foo; };"); 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) // should fail (should be configurable)
obj = Object.defineProperties({}, { foo: { obj = Object.defineProperties({}, { foo: {
@ -68,27 +68,27 @@
value: 123 value: 123
}}); }});
i = interfaceFrom("interface H { [Default] object toJSON(); attribute long foo; };"); 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(); var idl = new IdlArray();
idl.add_idls("interface I : J { [Default] object toJSON(); attribute long foo; };"); idl.add_idls("interface I : J { [Default] object toJSON(); attribute long foo; };");
idl.add_idls("interface J { [Default] object toJSON(); attribute DOMString foo;};"); idl.add_idls("interface J { [Default] object toJSON(); attribute DOMString foo;};");
var i = idl.members.I; 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 = 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 = 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) // should fail (wrong output type)
i = interfaceFrom("interface M { DOMString toJSON(); };"); 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) // should fail (not an IDL type)
i = interfaceFrom("interface N { DOMException toJSON(); };"); 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>
<script type="text/json" id="expected"> <script type="text/json" id="expected">
{ {

View file

@ -1,48 +1,49 @@
import json import json
import os import os
import ssl
import subprocess import subprocess
import time
import urllib2 import urllib2
_CONFIG_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), _CONFIG_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'config.test.json') '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): class WPTServer(object):
base_url = 'https://%s:%s' % (host, port)
def __init__(self, wpt_root): def __init__(self, wpt_root):
self.wpt_root = 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): def start(self):
self.devnull = open(os.devnull, 'w') self.devnull = open(os.devnull, 'w')
self.proc = subprocess.Popen( self.proc = subprocess.Popen(
[os.path.join(self.wpt_root, 'wpt'), 'serve', '--config=' + _CONFIG_FILE], [os.path.join(self.wpt_root, 'wpt'), 'serve', '--config=' + _CONFIG_FILE],
stdout=self.devnull,
stderr=self.devnull, stderr=self.devnull,
cwd=self.wpt_root) 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: if self.proc.poll() != None:
raise Exception('Could not start wptserve.')
try:
urllib2.urlopen(self.base_url, timeout=1, context=context)
break break
except urllib2.URLError as e: try:
urllib2.urlopen(self.base_url, timeout=1)
return
except urllib2.URLError:
pass pass
raise Exception('Could not start wptserve.')
def stop(self): def stop(self):
self.proc.kill() self.proc.terminate()
self.proc.wait() self.proc.wait()
self.devnull.close() self.devnull.close()
def url(self, abs_path): 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)

View file

@ -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>

View file

@ -3,7 +3,6 @@
.coverage.* .coverage.*
htmlcov/ htmlcov/
coverage.xml coverage.xml
.tox/
.cache/ .cache/
.hypothesis/ .hypothesis/
*.py[co] *.py[co]

View file

@ -17,6 +17,12 @@ def fnmatch_translate(pat, path_name=False):
else: else:
any_char = "." any_char = "."
parts.append("^(?:.*/)?") 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): while i < len(pat):
c = pat[i] c = pat[i]
if c == "\\": if c == "\\":
@ -63,7 +69,7 @@ def fnmatch_translate(pat, path_name=False):
if seq: if seq:
raise ValueError raise ValueError
parts.append("$") parts.append(suffix)
try: try:
return re.compile("".join(parts)) return re.compile("".join(parts))
except Exception: except Exception:
@ -84,7 +90,7 @@ def parse_line(line):
if dir_only: if dir_only:
line = line[:-1] line = line[:-1]
return invert, dir_only, fnmatch_translate(line, "/" in line) return invert, dir_only, fnmatch_translate(line, dir_only)
class PathFilter(object): class PathFilter(object):

View file

@ -11,7 +11,8 @@ match_data = [
("/*.c", False, ["a.c", ".c"]), ("/*.c", False, ["a.c", ".c"]),
("**/b", False, ["a/b", "a/c/b"]), ("**/b", False, ["a/b", "a/c/b"]),
("*b", True, ["ab"]), ("*b", True, ["ab"]),
("**/b", True, ["a/b"]) ("**/b", True, ["a/b"]),
("a/", True, ["a", "a/b", "a/b/c"])
] ]
mismatch_data = [ mismatch_data = [
@ -23,6 +24,7 @@ mismatch_data = [
("**b", True, ["a/b"]), ("**b", True, ["a/b"]),
("a[/]b", True, ["a/b"]), ("a[/]b", True, ["a/b"]),
("**/b", True, ["a/c/b"]), ("**/b", True, ["a/c/b"]),
("a", True, ["ab"])
] ]
invalid_data = [ invalid_data = [
@ -40,21 +42,25 @@ filter_data = [
("c/b", True) ("c/b", True)
] ]
def expand_data(compact_data): def expand_data(compact_data):
for pattern, path_name, inputs in compact_data: for pattern, path_name, inputs in compact_data:
for input in inputs: for input in inputs:
yield pattern, input, path_name yield pattern, input, path_name
@pytest.mark.parametrize("pattern, input, path_name", expand_data(match_data)) @pytest.mark.parametrize("pattern, input, path_name", expand_data(match_data))
def tests_match(pattern, input, path_name): def tests_match(pattern, input, path_name):
regexp = fnmatch_translate(pattern, path_name) regexp = fnmatch_translate(pattern, path_name)
assert regexp.match(input) is not None assert regexp.match(input) is not None
@pytest.mark.parametrize("pattern, input, path_name", expand_data(mismatch_data)) @pytest.mark.parametrize("pattern, input, path_name", expand_data(mismatch_data))
def tests_no_match(pattern, input, path_name): def tests_no_match(pattern, input, path_name):
regexp = fnmatch_translate(pattern, path_name) regexp = fnmatch_translate(pattern, path_name)
assert regexp.match(input) is None assert regexp.match(input) is None
@pytest.mark.parametrize("pattern", invalid_data) @pytest.mark.parametrize("pattern", invalid_data)
def tests_invalid(pattern): def tests_invalid(pattern):
with pytest.raises(ValueError): with pytest.raises(ValueError):
@ -62,6 +68,7 @@ def tests_invalid(pattern):
with pytest.raises(ValueError): with pytest.raises(ValueError):
fnmatch_translate(pattern, True) fnmatch_translate(pattern, True)
@pytest.mark.parametrize("path, expected", filter_data) @pytest.mark.parametrize("path, expected", filter_data)
def test_path_filter(path, expected): def test_path_filter(path, expected):
extras = [ extras = [

View file

@ -60,7 +60,7 @@ you could add the following line to the lint.whitelist file.
%s: %s""" %s: %s"""
def all_filesystem_paths(repo_root, subdir=None): def all_filesystem_paths(repo_root, subdir=None):
path_filter = PathFilter(repo_root, extras=[".git/*"]) path_filter = PathFilter(repo_root, extras=[".git/"])
if subdir: if subdir:
expanded_path = subdir expanded_path = subdir
else: else:
@ -72,8 +72,7 @@ def all_filesystem_paths(repo_root, subdir=None):
yield path yield path
dirnames[:] = [item for item in dirnames if dirnames[:] = [item for item in dirnames if
path_filter(os.path.relpath(os.path.join(dirpath, item) + "/", path_filter(os.path.relpath(os.path.join(dirpath, item) + "/",
repo_root))] repo_root)+"/")]
def _all_files_equal(paths): def _all_files_equal(paths):
""" """

View file

@ -7,43 +7,22 @@
<script src="/resources/WebIDLParser.js"></script> <script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script> <script src="/resources/idlharness.js"></script>
<div id="log"></div> <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> <script>
'use strict'; 'use strict';
const idlArray = new IdlArray(); 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.add_untested_idls('interface AnimationTimeline {};'); idlArray.add_untested_idls('interface AnimationTimeline {};');
idlArray.add_untested_idls('interface EventHandler {};'); idlArray.add_untested_idls('interface EventHandler {};');
idlArray.add_untested_idls('interface EventTarget {};'); idlArray.add_untested_idls('interface EventTarget {};');
idlArray.add_idls(document.getElementById('Animation-IDL').textContent); idlArray.add_objects( { Animation: ['new Animation()'] } );
idlArray.add_objects( { Animation: ['new Animation()'] } ); idlArray.test();
done();
idlArray.test(); }, 'Animation interface.');
</script> </script>

View file

@ -8,39 +8,32 @@
<script src="/resources/WebIDLParser.js"></script> <script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script> <script src="/resources/idlharness.js"></script>
<div id="log"></div> <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> <script>
'use strict'; 'use strict';
const idlArray = new IdlArray(); 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.add_untested_idls('interface Event {};'); idlArray.add_untested_idls('interface Event {};');
idlArray.add_idls( idlArray.add_objects({
document.getElementById('AnimationPlaybackEvent-IDL').textContent AnimationPlaybackEvent: ['new AnimationPlaybackEvent(\'cancel\')'],
); });
idlArray.add_objects({
AnimationPlaybackEvent: [ 'new AnimationPlaybackEvent(\'cancel\')' ],
});
idlArray.test();
idlArray.test();
done();
}, 'AnimationPlaybackEvent interface.');
</script> </script>

View file

@ -7,30 +7,24 @@
<script src="/resources/WebIDLParser.js"></script> <script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script> <script src="/resources/idlharness.js"></script>
<div id="log"></div> <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> <script>
'use strict'; 'use strict';
const idlArray = new IdlArray(); promise_test(async () => {
const text = await fetch('/interfaces/web-animations.idl').then(response =>
idlArray.add_idls( response.text(),
document.getElementById('AnimationTimeline-IDL').textContent); );
idlArray.add_idls( const idlArray = new IdlArray();
document.getElementById('DocumentTimeline-IDL').textContent); idlArray.add_idls(text, {
idlArray.add_objects( { DocumentTimeline: ['document.timeline'] } ); only: [
'AnimationTimeline',
idlArray.test(); 'DocumentTimelineOptions',
'DocumentTimeline',
]
});
idlArray.add_objects({ DocumentTimeline: ['document.timeline'] });
idlArray.test();
done();
}, 'DocumentTimeline interface.');
</script> </script>

View file

@ -10,14 +10,6 @@
<script src="/resources/idlharness.js"></script> <script src="/resources/idlharness.js"></script>
<div id="log"></div> <div id="log"></div>
<script type="text/plain" id="AnimationEffect-IDL"> <script type="text/plain" id="AnimationEffect-IDL">
enum FillMode { "none", "forwards", "backwards", "both", "auto" };
enum PlaybackDirection {
"normal",
"reverse",
"alternate",
"alternate-reverse"
};
dictionary EffectTiming { dictionary EffectTiming {
double delay = 0.0; double delay = 0.0;
double endDelay = 0.0; double endDelay = 0.0;
@ -55,46 +47,33 @@ interface AnimationEffect {
void updateTiming(optional OptionalEffectTiming timing); void updateTiming(optional OptionalEffectTiming timing);
}; };
</script> </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> <script>
'use strict'; 'use strict';
const idlArray = new IdlArray(); promise_test(async () => {
const idlArray = new IdlArray();
idlArray.add_untested_idls('interface CSSPseudoElement {};'); idlArray.add_untested_idls(
idlArray.add_untested_idls('interface Element {};');
idlArray.add_untested_idls(
document.getElementById('AnimationEffect-IDL').textContent document.getElementById('AnimationEffect-IDL').textContent
); );
idlArray.add_idls( const text = await fetch('/interfaces/web-animations.idl').then(response =>
document.getElementById('KeyframeEffect-IDL').textContent response.text(),
); );
idlArray.add_objects({ idlArray.add_idls(text, {
only: [
'IterationCompositeOperation',
'CompositeOperation',
'KeyframeEffectOptions',
'KeyframeEffect',
]
});
idlArray.add_untested_idls('interface CSSPseudoElement {};');
idlArray.add_untested_idls('interface Element {};');
idlArray.add_objects({
KeyframeEffect: ['new KeyframeEffect(null, null)'], KeyframeEffect: ['new KeyframeEffect(null, null)'],
}); });
idlArray.test();
idlArray.test();
done();
}, 'KeyframeEffect interface.');
</script> </script>

View file

@ -25,12 +25,15 @@ promise_test(async t => {
const idl_array = new IdlArray(); const idl_array = new IdlArray();
// Dependencies of HTML
idl_array.add_untested_idls('interface LinkStyle {};'); // Dependency 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(html);
idl_array.add_untested_idls(dom); idl_array.add_untested_idls(dom);
idl_array.add_untested_idls(mediacapture); idl_array.add_untested_idls(mediacapture);
idl_array.add_untested_idls('interface Worklet {};'); idl_array.add_untested_idls('interface Worklet {};');
idl_array.add_idls(webaudio); idl_array.add_idls(webaudio);
const sample_rate = 44100; const sample_rate = 44100;

View file

@ -99,11 +99,12 @@
*/ */
promise_test(t => { promise_test(t => {
const pc = new RTCPeerConnection(); const pc = new RTCPeerConnection();
const pc2 = new RTCPeerConnection();
return generateOffer({ pc, data: true }) return generateOffer({ pc, data: true })
.then(offer => .then(offer =>
promise_rejects(t, 'InvalidModificationError', promise_rejects(t, 'InvalidModificationError',
pc.setLocalDescription(offer))); pc2.setLocalDescription(offer)));
}, 'setLocalDescription() with offer not created by own createOffer() should reject with InvalidModificationError'); }, 'setLocalDescription() with offer not created by own createOffer() should reject with InvalidModificationError');
promise_test(t => { promise_test(t => {

View file

@ -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>

View file

@ -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>

View file

@ -0,0 +1 @@
import './static-import-worker.js';

View file

@ -0,0 +1 @@
postMessage('LOADED');

View file

@ -0,0 +1 @@
import './post-message-on-load-worker.js';