Update web-platform-tests to revision 7ec633bbfbc01de4972e65f81f593983d9cdc17d

This commit is contained in:
WPT Sync Bot 2020-01-23 08:22:35 +00:00
parent 24674687ac
commit 36e52003a7
107 changed files with 1452 additions and 646 deletions

View file

@ -2,6 +2,9 @@
[Revoke blob URL after creating Request, will fetch] [Revoke blob URL after creating Request, will fetch]
expected: FAIL expected: FAIL
[Revoke blob URL after calling fetch, fetch should succeed]
expected: FAIL
[url-with-fetch.any.html] [url-with-fetch.any.html]
[Revoke blob URL after creating Request, will fetch] [Revoke blob URL after creating Request, will fetch]

View file

@ -123533,6 +123533,18 @@
{} {}
] ]
], ],
"css/css-flexbox/percentage-heights-010.html": [
[
"css/css-flexbox/percentage-heights-010.html",
[
[
"/css/reference/ref-filled-green-100px-square.xht",
"=="
]
],
{}
]
],
"css/css-flexbox/percentage-size-subitems-001.html": [ "css/css-flexbox/percentage-size-subitems-001.html": [
[ [
"css/css-flexbox/percentage-size-subitems-001.html", "css/css-flexbox/percentage-size-subitems-001.html",
@ -216432,6 +216444,9 @@
"2dcontext/imagebitmap/common.sub.js": [ "2dcontext/imagebitmap/common.sub.js": [
[] []
], ],
"2dcontext/imagebitmap/createImageBitmap-worker.js": [
[]
],
"2dcontext/imagebitmap/transfer-worker.js": [ "2dcontext/imagebitmap/transfer-worker.js": [
[] []
], ],
@ -280488,6 +280503,9 @@
"interfaces/mst-content-hint.idl": [ "interfaces/mst-content-hint.idl": [
[] []
], ],
"interfaces/native-file-system.idl": [
[]
],
"interfaces/navigation-timing.idl": [ "interfaces/navigation-timing.idl": [
[] []
], ],
@ -283089,6 +283107,33 @@
"quirks/unitless-length/support/common.js": [ "quirks/unitless-length/support/common.js": [
[] []
], ],
"referrer-policy/4K+1/generic/spec_json.js": [
[]
],
"referrer-policy/4K+1/generic/test-case.sub.js": [
[]
],
"referrer-policy/4K+1/spec.src.json": [
[]
],
"referrer-policy/4K-1/generic/spec_json.js": [
[]
],
"referrer-policy/4K-1/generic/test-case.sub.js": [
[]
],
"referrer-policy/4K-1/spec.src.json": [
[]
],
"referrer-policy/4K/generic/spec_json.js": [
[]
],
"referrer-policy/4K/generic/test-case.sub.js": [
[]
],
"referrer-policy/4K/spec.src.json": [
[]
],
"referrer-policy/META.yml": [ "referrer-policy/META.yml": [
[] []
], ],
@ -300134,6 +300179,12 @@
{} {}
] ]
], ],
"2dcontext/imagebitmap/createImageBitmap-in-worker-transfer.html": [
[
"2dcontext/imagebitmap/createImageBitmap-in-worker-transfer.html",
{}
]
],
"2dcontext/imagebitmap/createImageBitmap-invalid-args.html": [ "2dcontext/imagebitmap/createImageBitmap-invalid-args.html": [
[ [
"2dcontext/imagebitmap/createImageBitmap-invalid-args.html", "2dcontext/imagebitmap/createImageBitmap-invalid-args.html",
@ -365329,6 +365380,12 @@
{} {}
] ]
], ],
"html/semantics/document-metadata/the-style-element/style_load_event.html": [
[
"html/semantics/document-metadata/the-style-element/style_load_event.html",
{}
]
],
"html/semantics/document-metadata/the-style-element/style_media.html": [ "html/semantics/document-metadata/the-style-element/style_media.html": [
[ [
"html/semantics/document-metadata/the-style-element/style_media.html", "html/semantics/document-metadata/the-style-element/style_media.html",
@ -382425,6 +382482,38 @@
} }
] ]
], ],
"native-file-system/idlharness.https.any.js": [
[
"native-file-system/idlharness.https.any.html",
{
"script_metadata": [
[
"script",
"/resources/WebIDLParser.js"
],
[
"script",
"/resources/idlharness.js"
]
]
}
],
[
"native-file-system/idlharness.https.any.worker.html",
{
"script_metadata": [
[
"script",
"/resources/WebIDLParser.js"
],
[
"script",
"/resources/idlharness.js"
]
]
}
]
],
"native-file-system/opaque-origin.https.window.js": [ "native-file-system/opaque-origin.https.window.js": [
[ [
"native-file-system/opaque-origin.https.window.html", "native-file-system/opaque-origin.https.window.html",
@ -393793,9 +393882,9 @@
{} {}
] ]
], ],
"payment-request/onpaymentmenthodchange-attribute.https.html": [ "payment-request/onpaymentmethodchange-attribute.https.html": [
[ [
"payment-request/onpaymentmenthodchange-attribute.https.html", "payment-request/onpaymentmethodchange-attribute.https.html",
{} {}
] ]
], ],
@ -429413,6 +429502,78 @@
} }
] ]
], ],
"wasm/jsapi/table/grow-reftypes.tentative.any.js": [
[
"wasm/jsapi/table/grow-reftypes.tentative.any.html",
{
"script_metadata": [
[
"global",
"jsshell"
],
[
"script",
"assertions.js"
],
[
"script",
"/wasm/jsapi/wasm-constants.js"
],
[
"script",
"/wasm/jsapi/wasm-module-builder.js"
]
]
}
],
[
"wasm/jsapi/table/grow-reftypes.tentative.any.js",
{
"jsshell": true,
"script_metadata": [
[
"global",
"jsshell"
],
[
"script",
"assertions.js"
],
[
"script",
"/wasm/jsapi/wasm-constants.js"
],
[
"script",
"/wasm/jsapi/wasm-module-builder.js"
]
]
}
],
[
"wasm/jsapi/table/grow-reftypes.tentative.any.worker.html",
{
"script_metadata": [
[
"global",
"jsshell"
],
[
"script",
"assertions.js"
],
[
"script",
"/wasm/jsapi/wasm-constants.js"
],
[
"script",
"/wasm/jsapi/wasm-module-builder.js"
]
]
}
]
],
"wasm/jsapi/table/grow.any.js": [ "wasm/jsapi/table/grow.any.js": [
[ [
"wasm/jsapi/table/grow.any.html", "wasm/jsapi/table/grow.any.html",
@ -434304,6 +434465,12 @@
} }
] ]
], ],
"webrtc-extensions/RTCRtpParameters-maxFramerate.html": [
[
"webrtc-extensions/RTCRtpParameters-maxFramerate.html",
{}
]
],
"webrtc-extensions/RTCRtpReceiver-playoutDelayHint.html": [ "webrtc-extensions/RTCRtpReceiver-playoutDelayHint.html": [
[ [
"webrtc-extensions/RTCRtpReceiver-playoutDelayHint.html", "webrtc-extensions/RTCRtpReceiver-playoutDelayHint.html",
@ -468917,6 +469084,10 @@
"bbc920f1e303ff45e22c4396d098decafffac87b", "bbc920f1e303ff45e22c4396d098decafffac87b",
"testharness" "testharness"
], ],
"2dcontext/imagebitmap/createImageBitmap-in-worker-transfer.html": [
"727a8a4978db6ea62451d8af642a91d57b0aaed6",
"testharness"
],
"2dcontext/imagebitmap/createImageBitmap-invalid-args.html": [ "2dcontext/imagebitmap/createImageBitmap-invalid-args.html": [
"c200ce36f98658ef0dae6f654f892105a7e7aca1", "c200ce36f98658ef0dae6f654f892105a7e7aca1",
"testharness" "testharness"
@ -468937,6 +469108,10 @@
"708f97097c16e9074cc3cbf54dad0ee75df7967c", "708f97097c16e9074cc3cbf54dad0ee75df7967c",
"testharness" "testharness"
], ],
"2dcontext/imagebitmap/createImageBitmap-worker.js": [
"67a0904e479323e4a159937f49919580109fbc61",
"support"
],
"2dcontext/imagebitmap/transfer-worker.js": [ "2dcontext/imagebitmap/transfer-worker.js": [
"55465a899ca27d5202dfa796ec5200bde845892b", "55465a899ca27d5202dfa796ec5200bde845892b",
"support" "support"
@ -471270,7 +471445,7 @@
"testharness" "testharness"
], ],
"IndexedDB/idb-binary-key-detached.htm": [ "IndexedDB/idb-binary-key-detached.htm": [
"26afcfb1cd03c2cfb3e4fcc4a9ce382144225f24", "5a2e1f79f42e5d816870a1f948519317f0fd00fe",
"testharness" "testharness"
], ],
"IndexedDB/idb-binary-key-roundtrip.htm": [ "IndexedDB/idb-binary-key-roundtrip.htm": [
@ -471298,7 +471473,7 @@
"testharness" "testharness"
], ],
"IndexedDB/idbcursor-advance-exception-order.html": [ "IndexedDB/idbcursor-advance-exception-order.html": [
"13f7fdae5a57a716a13ed808fcd3613034f71e2d", "1e05c9074d6b1e5c86c46cc1f91bdbd0ecb26ad9",
"testharness" "testharness"
], ],
"IndexedDB/idbcursor-advance-invalid.htm": [ "IndexedDB/idbcursor-advance-invalid.htm": [
@ -472026,7 +472201,7 @@
"testharness" "testharness"
], ],
"IndexedDB/idbkeyrange-includes.htm": [ "IndexedDB/idbkeyrange-includes.htm": [
"aea588051aeaab63c3855a778b22d1a6932d78ff", "9a408e888a42d2f79eaf2ed2f30311fbaa596625",
"testharness" "testharness"
], ],
"IndexedDB/idbkeyrange.htm": [ "IndexedDB/idbkeyrange.htm": [
@ -476666,7 +476841,7 @@
"testharness" "testharness"
], ],
"bluetooth/idl/idl-BluetoothUUID.html": [ "bluetooth/idl/idl-BluetoothUUID.html": [
"2adf35a419ff9687511884e4294ec72dbb22d347", "14463127e06b422a2830042bb887e5108e200753",
"testharness" "testharness"
], ],
"bluetooth/idl/idl-NavigatorBluetooth.html": [ "bluetooth/idl/idl-NavigatorBluetooth.html": [
@ -477746,7 +477921,7 @@
"support" "support"
], ],
"common/security-features/README.md": [ "common/security-features/README.md": [
"2509d661b4afb68a5bfca0a41270d93586ddbe49", "46cabd2bb3c24dd94f81e78a7799512e7741cd13",
"support" "support"
], ],
"common/security-features/resources/common.sub.js": [ "common/security-features/resources/common.sub.js": [
@ -477866,11 +478041,11 @@
"support" "support"
], ],
"common/security-features/tools/format_spec_src_json.py": [ "common/security-features/tools/format_spec_src_json.py": [
"b4549bb710cd119e87ca4a41d65d7980b6b40406", "d1bf5817ad208f3ae8cc16b3ad11cc0d310d35aa",
"support" "support"
], ],
"common/security-features/tools/generate.py": [ "common/security-features/tools/generate.py": [
"ba997067b3f44640fec79fac9cea10a79ae982af", "3345d6520691de734977a18d73c94f71b446408a",
"support" "support"
], ],
"common/security-features/tools/spec_validator.py": [ "common/security-features/tools/spec_validator.py": [
@ -477886,11 +478061,11 @@
"support" "support"
], ],
"common/security-features/tools/template/test.debug.html.template": [ "common/security-features/tools/template/test.debug.html.template": [
"b4b0fec733e1ce6f6a5cad0f9c9d4391aa244fb1", "f09395cff49a7a4282606a79135b813354e14022",
"support" "support"
], ],
"common/security-features/tools/template/test.release.html.template": [ "common/security-features/tools/template/test.release.html.template": [
"d93506e231a4c6e719b055b1e312bd163eb9519d", "6bf79f77df1a6a3d357b68d1f59f90e04ca0815f",
"support" "support"
], ],
"common/security-features/tools/util.py": [ "common/security-features/tools/util.py": [
@ -477918,7 +478093,7 @@
"support" "support"
], ],
"common/test-setting-immutable-prototype.js": [ "common/test-setting-immutable-prototype.js": [
"92e61c07424166f4fd514ac0cd6d50f1c68b0020", "de619b1d76663d0f41f13b720609bd4cc28747c2",
"support" "support"
], ],
"common/test-setting-immutable-prototype.js.headers": [ "common/test-setting-immutable-prototype.js.headers": [
@ -496446,7 +496621,7 @@
"testharness" "testharness"
], ],
"content-security-policy/generic/eval-typecheck-callout-order.tentative.html": [ "content-security-policy/generic/eval-typecheck-callout-order.tentative.html": [
"7b3c12e396445ff72480a1e9c7cc77550f93f75c", "0be7cf29a284d5f2471c7ada0b5cd643b6f0fb6a",
"testharness" "testharness"
], ],
"content-security-policy/generic/eval-typecheck-callout-order.tentative.html.headers": [ "content-security-policy/generic/eval-typecheck-callout-order.tentative.html.headers": [
@ -498750,7 +498925,7 @@
"testharness" "testharness"
], ],
"cookie-store/cookieStoreManager_getSubscriptions_multiple.tentative.https.any.js": [ "cookie-store/cookieStoreManager_getSubscriptions_multiple.tentative.https.any.js": [
"625f521261507b0c82d5e059f40537f84dfee4c8", "030297e4095efded911308a5de13ae1abad345de",
"testharness" "testharness"
], ],
"cookie-store/cookieStoreManager_getSubscriptions_single.tentative.https.any.js": [ "cookie-store/cookieStoreManager_getSubscriptions_single.tentative.https.any.js": [
@ -500998,11 +501173,11 @@
"testharness" "testharness"
], ],
"cookies/samesite/window-open-reload.https.html": [ "cookies/samesite/window-open-reload.https.html": [
"9c30bd5ca6760c23803fcf951cd772d8a8b39a1d", "ee2091b1373a1da7068722c2557332e3a7f60b05",
"testharness" "testharness"
], ],
"cookies/samesite/window-open.https.html": [ "cookies/samesite/window-open.https.html": [
"fe2318acc43d857e0a7890d77b95a80f5b060863", "d685eb47fd07872116caa22d2b8ca23774f26a81",
"testharness" "testharness"
], ],
"cookies/secure/set-from-dom.https.sub.html": [ "cookies/secure/set-from-dom.https.sub.html": [
@ -574569,6 +574744,10 @@
"b3de59562bc1ff6b78d9c7b29a5836d47bf8a81b", "b3de59562bc1ff6b78d9c7b29a5836d47bf8a81b",
"reftest" "reftest"
], ],
"css/css-flexbox/percentage-heights-010.html": [
"003cc2487ae56d0172c9253be663b5c3dfdf83ff",
"reftest"
],
"css/css-flexbox/percentage-padding-001.html": [ "css/css-flexbox/percentage-padding-001.html": [
"8bba5d60f5cae1b93df70c1973a473f163020a51", "8bba5d60f5cae1b93df70c1973a473f163020a51",
"testharness" "testharness"
@ -627382,7 +627561,7 @@
"support" "support"
], ],
"css/cssom-view/MediaQueryList-addListener-handleEvent.html": [ "css/cssom-view/MediaQueryList-addListener-handleEvent.html": [
"5bdd9dfc9ced8459b459970cf187456c3f82fbe4", "47267d98bbaf66e07ee0e2ef3e37d01231d03f12",
"testharness" "testharness"
], ],
"css/cssom-view/MediaQueryList-addListener-removeListener.html": [ "css/cssom-view/MediaQueryList-addListener-removeListener.html": [
@ -628138,7 +628317,7 @@
"testharness" "testharness"
], ],
"css/cssom/CSSStyleSheet.html": [ "css/cssom/CSSStyleSheet.html": [
"90cfb02751fa540ae29d12357deb41c3671a7567", "d38efc280232c182db8c301714083a0e3d002413",
"testharness" "testharness"
], ],
"css/cssom/HTMLLinkElement-disabled-001.tentative.html": [ "css/cssom/HTMLLinkElement-disabled-001.tentative.html": [
@ -628474,7 +628653,7 @@
"testharness" "testharness"
], ],
"css/cssom/medialist-interfaces-002.html": [ "css/cssom/medialist-interfaces-002.html": [
"9820015f5e02642ea4c544184811f9f243ee83c5", "210ace1393a12c34323983dddf9b11467cb38d94",
"testharness" "testharness"
], ],
"css/cssom/medialist-interfaces-003.html": [ "css/cssom/medialist-interfaces-003.html": [
@ -642298,7 +642477,7 @@
"testharness" "testharness"
], ],
"custom-elements/historical.html": [ "custom-elements/historical.html": [
"70981ce59c41dd352bccf1b70a1cb7c8cecf30ec", "5a961b13ad7f44f64b3df6dafeeb9321e8bf6762",
"testharness" "testharness"
], ],
"custom-elements/htmlconstructor/newtarget.html": [ "custom-elements/htmlconstructor/newtarget.html": [
@ -643174,7 +643353,7 @@
"testharness" "testharness"
], ],
"dom/events/EventListener-handleEvent.html": [ "dom/events/EventListener-handleEvent.html": [
"1eb80ccb15f0bc6fda7d04d4fc01555ea6b8ab04", "27730b20c584dab38b95baecc5c3b8ae459f491c",
"testharness" "testharness"
], ],
"dom/events/EventListener-incumbent-global-1.sub.html": [ "dom/events/EventListener-incumbent-global-1.sub.html": [
@ -647298,7 +647477,7 @@
"testharness" "testharness"
], ],
"encoding/textdecoder-fatal.any.js": [ "encoding/textdecoder-fatal.any.js": [
"5884f11ec3cf145e2d405e30e3ce346abfc97c1b", "ba8aa5d06c3e2dfea532c70f30bb0841f6966a72",
"testharness" "testharness"
], ],
"encoding/textdecoder-ignorebom.any.js": [ "encoding/textdecoder-ignorebom.any.js": [
@ -649514,7 +649693,7 @@
"testharness" "testharness"
], ],
"fetch/api/basic/keepalive.html": [ "fetch/api/basic/keepalive.html": [
"5316410004a7880ff4d24234d4508680c29a6720", "447ef2ddfecd7a62c4bf9f3d19af4e31e9fe68bc",
"testharness" "testharness"
], ],
"fetch/api/basic/mediasource.window.js": [ "fetch/api/basic/mediasource.window.js": [
@ -649718,7 +649897,7 @@
"testharness" "testharness"
], ],
"fetch/api/headers/headers-record.html": [ "fetch/api/headers/headers-record.html": [
"85dfadd269d2c7460865dc5d1b16ae1b9834a5a8", "34acc3b1c557ce7bc1841ad3d785fb1f732f299f",
"testharness" "testharness"
], ],
"fetch/api/headers/headers-structure.html": [ "fetch/api/headers/headers-structure.html": [
@ -650158,7 +650337,7 @@
"support" "support"
], ],
"fetch/api/resources/keepalive-iframe.html": [ "fetch/api/resources/keepalive-iframe.html": [
"742309ab4d238404b3ad66f8160c24fd5d16ef66", "47de0da7790618224f70171c12dc8fd04436c0e3",
"support" "support"
], ],
"fetch/api/resources/method.py": [ "fetch/api/resources/method.py": [
@ -650186,7 +650365,7 @@
"support" "support"
], ],
"fetch/api/resources/stash-put.py": [ "fetch/api/resources/stash-put.py": [
"dd84ff1fc852cfc143231f717366c61b12e3c30c", "36527b98b71785809cd6a490196dd9112fef9181",
"support" "support"
], ],
"fetch/api/resources/stash-take.py": [ "fetch/api/resources/stash-take.py": [
@ -650510,7 +650689,7 @@
"testharness" "testharness"
], ],
"fetch/corb/script-resource-with-nonsniffable-types.tentative.sub.html": [ "fetch/corb/script-resource-with-nonsniffable-types.tentative.sub.html": [
"917e54984f460fc1f5a9c13c9ae4520492e17355", "255ff1da267af5a3fead4ad3f94584d70d9bdf4f",
"testharness" "testharness"
], ],
"fetch/corb/style-css-mislabeled-as-html-nosniff.sub.html": [ "fetch/corb/style-css-mislabeled-as-html-nosniff.sub.html": [
@ -652290,7 +652469,7 @@
"support" "support"
], ],
"generic-sensor/SensorErrorEvent-constructor.https.html": [ "generic-sensor/SensorErrorEvent-constructor.https.html": [
"6e2d1684f57af55a6ca02a982d037250ab4c372a", "2d68dec56d9a9d6982e5ba729e3a201625f368df",
"testharness" "testharness"
], ],
"generic-sensor/generic-sensor-feature-policy-test.sub.js": [ "generic-sensor/generic-sensor-feature-policy-test.sub.js": [
@ -654582,7 +654761,7 @@
"testharness" "testharness"
], ],
"html/browsers/origin/cross-origin-objects/cross-origin-objects.html": [ "html/browsers/origin/cross-origin-objects/cross-origin-objects.html": [
"f16a18d639cc6e528b561d800088fcfebf2c10cf", "2c92d5e51ad8078cec4f6e5e76035a52df93a245",
"testharness" "testharness"
], ],
"html/browsers/origin/cross-origin-objects/frame-with-then.html": [ "html/browsers/origin/cross-origin-objects/frame-with-then.html": [
@ -655570,7 +655749,7 @@
"support" "support"
], ],
"html/cross-origin-embedder-policy/require-corp.https.html": [ "html/cross-origin-embedder-policy/require-corp.https.html": [
"49b2eb123b519dc96314b1db31cc4d6797efae92", "8747d29e9343cdfae1d534a39947783ad26ef29c",
"testharness" "testharness"
], ],
"html/cross-origin-embedder-policy/require-corp.https.html.headers": [ "html/cross-origin-embedder-policy/require-corp.https.html.headers": [
@ -661098,7 +661277,7 @@
"testharness" "testharness"
], ],
"html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html": [ "html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html": [
"e3e0778c97a2a04ded5a151d31b1dc4f82334187", "095931ad785553a9b64d79d96eacebcb021e3171",
"testharness" "testharness"
], ],
"html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html": [ "html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html": [
@ -663393,6 +663572,10 @@
"ef8ac89c4663e970366401bcaa501b774e410c67", "ef8ac89c4663e970366401bcaa501b774e410c67",
"testharness" "testharness"
], ],
"html/semantics/document-metadata/the-style-element/style_load_event.html": [
"911a088c2ab37e0a457c28aa75b477d1af6561df",
"testharness"
],
"html/semantics/document-metadata/the-style-element/style_media.html": [ "html/semantics/document-metadata/the-style-element/style_media.html": [
"5bd189a2635dae4b17348023d70e29614eed7e50", "5bd189a2635dae4b17348023d70e29614eed7e50",
"testharness" "testharness"
@ -664634,7 +664817,7 @@
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/track/track-element/track-cue-mutable.html": [ "html/semantics/embedded-content/media-elements/track/track-element/track-cue-mutable.html": [
"63c3018aa9969e819ca8e0109141534467a4bfeb", "cb28f6591ce9614d6a1aa3e0ea7b753d6cb713df",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/track/track-element/track-cue-negative-duration.html": [ "html/semantics/embedded-content/media-elements/track/track-element/track-cue-negative-duration.html": [
@ -674542,7 +674725,7 @@
"support" "support"
], ],
"interfaces/IndexedDB.idl": [ "interfaces/IndexedDB.idl": [
"33925d614238d6850c196381df0f60ac14bd4e4f", "a66a245466ecb166836df87b50424a5f5c23de35",
"support" "support"
], ],
"interfaces/InputDeviceCapabilities.idl": [ "interfaces/InputDeviceCapabilities.idl": [
@ -674853,6 +675036,10 @@
"f7d3f20e72364a1bf7df019e3115c34c10d811ba", "f7d3f20e72364a1bf7df019e3115c34c10d811ba",
"support" "support"
], ],
"interfaces/native-file-system.idl": [
"f4679175c46ec7831f0c6423b0075d95ab99dbe0",
"support"
],
"interfaces/navigation-timing.idl": [ "interfaces/navigation-timing.idl": [
"57cea306d9e3b50b269587444ecf4c5190e15de4", "57cea306d9e3b50b269587444ecf4c5190e15de4",
"support" "support"
@ -675146,7 +675333,7 @@
"testharness" "testharness"
], ],
"intersection-observer/document-scrolling-element-root.html": [ "intersection-observer/document-scrolling-element-root.html": [
"9996299312c996f3705af12e35c6eab088905047", "443ff2ed85f988c66459952ce468bbcf14fdf2e2",
"testharness" "testharness"
], ],
"intersection-observer/edge-inclusive-intersection.html": [ "intersection-observer/edge-inclusive-intersection.html": [
@ -675382,7 +675569,7 @@
"support" "support"
], ],
"js/behaviours/SetPrototypeOf-window.html": [ "js/behaviours/SetPrototypeOf-window.html": [
"0a6ec249fa3b8a3df2770e111bbde03ce181c833", "f104ca107c5c5a6e868bdf4153406d98f0b40dc4",
"testharness" "testharness"
], ],
"js/builtins/Array.DefineOwnProperty.html": [ "js/builtins/Array.DefineOwnProperty.html": [
@ -677654,7 +677841,7 @@
"testharness" "testharness"
], ],
"media-source/mediasource-duration-boundaryconditions.html": [ "media-source/mediasource-duration-boundaryconditions.html": [
"b95e495cb1dd1a0f119257f35ab514239290e22c", "e5be9f18fc4620250b4cb5ad97b2dce5ae091db1",
"testharness" "testharness"
], ],
"media-source/mediasource-duration.html": [ "media-source/mediasource-duration.html": [
@ -678226,7 +678413,7 @@
"testharness" "testharness"
], ],
"mediacapture-record/BlobEvent-constructor.html": [ "mediacapture-record/BlobEvent-constructor.html": [
"3bcf4296e68aea1a7b167e570c0dcec148cc95e4", "66dc3404d78020108edc823292bff9b83cda42a6",
"testharness" "testharness"
], ],
"mediacapture-record/META.yml": [ "mediacapture-record/META.yml": [
@ -678462,7 +678649,7 @@
"testharness" "testharness"
], ],
"mediacapture-streams/MediaStreamTrackEvent-constructor.https.html": [ "mediacapture-streams/MediaStreamTrackEvent-constructor.https.html": [
"8f5a543d8fbed8b046deab4672729a112842faba", "4946cd71d8125f678af69c87042cc61ddb5b57a5",
"testharness" "testharness"
], ],
"mediacapture-streams/historical.https.html": [ "mediacapture-streams/historical.https.html": [
@ -678498,11 +678685,11 @@
"testharness" "testharness"
], ],
"mediasession/positionstate.html": [ "mediasession/positionstate.html": [
"2eab2986d4583c1a289b7876010193c8d3d44b3f", "9033a7be5ce5909e0de9d73e8e6aa02c84387e4d",
"testharness" "testharness"
], ],
"mediasession/setactionhandler.html": [ "mediasession/setactionhandler.html": [
"6e1bb26c67a828ae847734070024b404138e7932", "8f1330f82899e513f1183452490aa0f25b1a6f74",
"testharness" "testharness"
], ],
"mimesniff/META.yml": [ "mimesniff/META.yml": [
@ -681177,6 +681364,10 @@
"6905a68e7901ce26bc1a363062304e1536604400", "6905a68e7901ce26bc1a363062304e1536604400",
"support" "support"
], ],
"native-file-system/idlharness.https.any.js": [
"567912ddd7788b871b00a2929f17dc47280dd2d7",
"testharness"
],
"native-file-system/native_FileSystemBaseHandle-postMessage-BroadcastChannel-manual.https.tentative.html": [ "native-file-system/native_FileSystemBaseHandle-postMessage-BroadcastChannel-manual.https.tentative.html": [
"322b169985bf40e2bac1dba813e840e951f89414", "322b169985bf40e2bac1dba813e840e951f89414",
"manual" "manual"
@ -689105,7 +689296,7 @@
"d31ac2dd72abcf51a28ecec850400f5f0c6b9bb5", "d31ac2dd72abcf51a28ecec850400f5f0c6b9bb5",
"testharness" "testharness"
], ],
"payment-request/onpaymentmenthodchange-attribute.https.html": [ "payment-request/onpaymentmethodchange-attribute.https.html": [
"f641bec4aa91d8be4f1801869eb699ca4bad03a0", "f641bec4aa91d8be4f1801869eb699ca4bad03a0",
"testharness" "testharness"
], ],
@ -691005,6 +691196,42 @@
"f2f7eab4e33858b571344940c67de9b50e18e119", "f2f7eab4e33858b571344940c67de9b50e18e119",
"support" "support"
], ],
"referrer-policy/4K+1/generic/spec_json.js": [
"39cd997338e4c9e235d30097d970daeff5f1f19b",
"support"
],
"referrer-policy/4K+1/generic/test-case.sub.js": [
"b602d65f4141da242b1a9c47b2544cb3e9abc39c",
"support"
],
"referrer-policy/4K+1/spec.src.json": [
"5dc2085c62fa48787d4c16da422e3551eb844630",
"support"
],
"referrer-policy/4K-1/generic/spec_json.js": [
"39cd997338e4c9e235d30097d970daeff5f1f19b",
"support"
],
"referrer-policy/4K-1/generic/test-case.sub.js": [
"5b6aa4216b74a04a193ce7ece447b890d2ec6469",
"support"
],
"referrer-policy/4K-1/spec.src.json": [
"5dc2085c62fa48787d4c16da422e3551eb844630",
"support"
],
"referrer-policy/4K/generic/spec_json.js": [
"39cd997338e4c9e235d30097d970daeff5f1f19b",
"support"
],
"referrer-policy/4K/generic/test-case.sub.js": [
"912c06e10e7f0917c2cf83bb28f2a0975e103c7c",
"support"
],
"referrer-policy/4K/spec.src.json": [
"5dc2085c62fa48787d4c16da422e3551eb844630",
"support"
],
"referrer-policy/META.yml": [ "referrer-policy/META.yml": [
"8ead043aad0a6aa79dad5c2c9e9b757df5869265", "8ead043aad0a6aa79dad5c2c9e9b757df5869265",
"support" "support"
@ -703210,7 +703437,7 @@
"testharness" "testharness"
], ],
"referrer-policy/generic/test-case.sub.js": [ "referrer-policy/generic/test-case.sub.js": [
"c8a6b139f33fa044ddb644409b1e4437d3df338c", "a8292e57e1fe32efbed35a184fd7461198643dd1",
"support" "support"
], ],
"referrer-policy/generic/unsupported-csp-referrer-directive.html": [ "referrer-policy/generic/unsupported-csp-referrer-directive.html": [
@ -707474,7 +707701,7 @@
"support" "support"
], ],
"service-workers/service-worker/resources/interfaces-worker.sub.js": [ "service-workers/service-worker/resources/interfaces-worker.sub.js": [
"ac79ddc005688affe9acc67b83f43ef304f81c81", "44bd0870b9561eff46eaf1e56aa27912ce0c11a7",
"support" "support"
], ],
"service-workers/service-worker/resources/invalid-blobtype-iframe.https.html": [ "service-workers/service-worker/resources/invalid-blobtype-iframe.https.html": [
@ -720162,7 +720389,7 @@
"support" "support"
], ],
"tools/wptrunner/requirements.txt": [ "tools/wptrunner/requirements.txt": [
"328b43a0737b98503ae0b85dabb35b3a38d958e0", "ccf55d2ca7f15f16d779971ec70c2070dcadf921",
"support" "support"
], ],
"tools/wptrunner/requirements_android_webview.txt": [ "tools/wptrunner/requirements_android_webview.txt": [
@ -720450,7 +720677,7 @@
"support" "support"
], ],
"tools/wptrunner/wptrunner/executors/base.py": [ "tools/wptrunner/wptrunner/executors/base.py": [
"3d8af4de4868e9da86b38d1c9d7b32ed0bfd265b", "603c606e1cde1de879f4fcb2d82f98952de96ce7",
"support" "support"
], ],
"tools/wptrunner/wptrunner/executors/executorchrome.py": [ "tools/wptrunner/wptrunner/executors/executorchrome.py": [
@ -720570,7 +720797,7 @@
"support" "support"
], ],
"tools/wptrunner/wptrunner/manifestexpected.py": [ "tools/wptrunner/wptrunner/manifestexpected.py": [
"65b53f0ab97b581b2b71277bd8f260f79a1afb12", "335b0da5c907f649a4bec803ebc25ed7ff54faf8",
"support" "support"
], ],
"tools/wptrunner/wptrunner/manifestinclude.py": [ "tools/wptrunner/wptrunner/manifestinclude.py": [
@ -720586,7 +720813,7 @@
"support" "support"
], ],
"tools/wptrunner/wptrunner/process.py": [ "tools/wptrunner/wptrunner/process.py": [
"26e11ddfc8758e95d7f5048596ab8cae4f4bb546", "8a2b894cb74d4ec091931bf417c92d5bea071cae",
"support" "support"
], ],
"tools/wptrunner/wptrunner/products.py": [ "tools/wptrunner/wptrunner/products.py": [
@ -721070,7 +721297,7 @@
"support" "support"
], ],
"tools/wptserve/wptserve/handlers.py": [ "tools/wptserve/wptserve/handlers.py": [
"efc1a16a93225d033574a22f7ba81e7d3d50bfd9", "c18fa2d3792597a4c2a850dda233be56590c67ea",
"support" "support"
], ],
"tools/wptserve/wptserve/logger.py": [ "tools/wptserve/wptserve/logger.py": [
@ -721078,7 +721305,7 @@
"support" "support"
], ],
"tools/wptserve/wptserve/pipes.py": [ "tools/wptserve/wptserve/pipes.py": [
"e5d6e1c96db9c18020ed2b8aee23d41dd503509a", "3500948fc8c296daa3baf6ba0965f8262ddf9fb3",
"support" "support"
], ],
"tools/wptserve/wptserve/ranges.py": [ "tools/wptserve/wptserve/ranges.py": [
@ -721246,7 +721473,7 @@
"testharness" "testharness"
], ],
"trusted-types/TrustedTypePolicy-CSP.tentative.html": [ "trusted-types/TrustedTypePolicy-CSP.tentative.html": [
"0b57c3a908a9a6218d45c4692ee6fd901e49328b", "8ae162558f41fe0b8015292fe8be84433469311e",
"testharness" "testharness"
], ],
"trusted-types/TrustedTypePolicy-createXXX.tentative.html": [ "trusted-types/TrustedTypePolicy-createXXX.tentative.html": [
@ -721274,7 +721501,7 @@
"testharness" "testharness"
], ],
"trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests.tentative.html": [ "trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests.tentative.html": [
"0b57c3a908a9a6218d45c4692ee6fd901e49328b", "8ae162558f41fe0b8015292fe8be84433469311e",
"testharness" "testharness"
], ],
"trusted-types/TrustedTypePolicyFactory-createPolicy-nameTests.tentative.html": [ "trusted-types/TrustedTypePolicyFactory-createPolicy-nameTests.tentative.html": [
@ -724846,7 +725073,7 @@
"testharness" "testharness"
], ],
"url/failure.html": [ "url/failure.html": [
"bebdb3dcc4df6ba11a16a1b2a2b450fb610c0f76", "ac16edf8c743af2650b2b78f570c84f2bc75ecda",
"testharness" "testharness"
], ],
"url/historical.any.js": [ "url/historical.any.js": [
@ -724878,7 +725105,7 @@
"support" "support"
], ],
"url/toascii.window.js": [ "url/toascii.window.js": [
"b28c664479a26aafddef076ce73ab448418d91fc", "cdc488ec28526f530031b66b63b3c23ff7dad430",
"testharness" "testharness"
], ],
"url/url-constructor.html": [ "url/url-constructor.html": [
@ -726445,6 +726672,10 @@
"bd053b389c904ed9b2587ad2817650d31fde7504", "bd053b389c904ed9b2587ad2817650d31fde7504",
"testharness" "testharness"
], ],
"wasm/jsapi/table/grow-reftypes.tentative.any.js": [
"807aea991bbc82eaa4702a12f5b1093baaef6d10",
"testharness"
],
"wasm/jsapi/table/grow.any.js": [ "wasm/jsapi/table/grow.any.js": [
"558b49d1c7d3bcba9798370792fa4b6f83332105", "558b49d1c7d3bcba9798370792fa4b6f83332105",
"testharness" "testharness"
@ -726754,7 +726985,7 @@
"testharness" "testharness"
], ],
"web-animations/interfaces/Animatable/animate.html": [ "web-animations/interfaces/Animatable/animate.html": [
"95d7db7bb3ba36fc9a0914ebe0d2c8e910e29cf1", "4d17d2dd00ece70673cdd9ca52a77d540c3eac43",
"testharness" "testharness"
], ],
"web-animations/interfaces/Animatable/getAnimations.html": [ "web-animations/interfaces/Animatable/getAnimations.html": [
@ -726826,7 +727057,7 @@
"testharness" "testharness"
], ],
"web-animations/interfaces/AnimationEffect/updateTiming.html": [ "web-animations/interfaces/AnimationEffect/updateTiming.html": [
"746f0d74f19272b0cb4a63b27102642b5eaba459", "f4f672ab1aac76905e3258144fbf022201df0f53",
"testharness" "testharness"
], ],
"web-animations/interfaces/AnimationPlaybackEvent/constructor.html": [ "web-animations/interfaces/AnimationPlaybackEvent/constructor.html": [
@ -726874,11 +727105,11 @@
"testharness" "testharness"
], ],
"web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html": [ "web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html": [
"8233dc07c5de8d17619489e0d759c75c4d2a059f", "e78e13d69aa5e8004c4ec49de2bc98b6bfb6a54a",
"testharness" "testharness"
], ],
"web-animations/interfaces/KeyframeEffect/setKeyframes.html": [ "web-animations/interfaces/KeyframeEffect/setKeyframes.html": [
"675a705891fa6c75c233179e59cc73cc516ff48c", "a5c81a29bd9d975c93e652edb614f6dbb1570e3b",
"testharness" "testharness"
], ],
"web-animations/interfaces/KeyframeEffect/style-change-events.html": [ "web-animations/interfaces/KeyframeEffect/style-change-events.html": [
@ -727210,7 +727441,7 @@
"support" "support"
], ],
"web-nfc/NDEFMessage_constructor.https.html": [ "web-nfc/NDEFMessage_constructor.https.html": [
"4e53828c310976b5b37657f84a89f03c48e7bc59", "5d6b557e3ccf73d078e9dc0eda63ca31a28551b8",
"testharness" "testharness"
], ],
"web-nfc/NDEFReader-document-hidden-manual.https.html": [ "web-nfc/NDEFReader-document-hidden-manual.https.html": [
@ -727230,11 +727461,11 @@
"testharness" "testharness"
], ],
"web-nfc/NDEFReadingEvent_constructor.https.html": [ "web-nfc/NDEFReadingEvent_constructor.https.html": [
"5427b75ae2b6d0fa6c45b24af51b02a8737ffd0b", "122070f50ed7c4fdb15947cbec68e2a62eea9a06",
"testharness" "testharness"
], ],
"web-nfc/NDEFRecord_constructor.https.html": [ "web-nfc/NDEFRecord_constructor.https.html": [
"a2ea09fa681aff85e0cf69d217a89e9a79a8d96b", "bf4697f8b17ca97de735dc0851a2f48766b1a6b6",
"testharness" "testharness"
], ],
"web-nfc/NDEFWriter-document-hidden-manual.https.html": [ "web-nfc/NDEFWriter-document-hidden-manual.https.html": [
@ -730094,7 +730325,7 @@
"testharness" "testharness"
], ],
"webmessaging/with-options/null-transfer.html": [ "webmessaging/with-options/null-transfer.html": [
"72bebd1e38e8c5538ebaf24fe608048bed61d18d", "2ea09eb7ab4ada86bd4624e222fbdebc026d95e8",
"testharness" "testharness"
], ],
"webmessaging/with-options/one-arg.html": [ "webmessaging/with-options/one-arg.html": [
@ -730190,7 +730421,7 @@
"testharness" "testharness"
], ],
"webmessaging/with-ports/023.html": [ "webmessaging/with-ports/023.html": [
"da6a5c49a448c2ce502fe09a0693ce15abb6e00d", "e2569a8463f51f0691f572de7024cd93936adb20",
"testharness" "testharness"
], ],
"webmessaging/with-ports/024.html": [ "webmessaging/with-ports/024.html": [
@ -730353,6 +730584,10 @@
"4ceee0664cbfb800ac8b410c295dde4c7009b024", "4ceee0664cbfb800ac8b410c295dde4c7009b024",
"support" "support"
], ],
"webrtc-extensions/RTCRtpParameters-maxFramerate.html": [
"7067fbc79980743867c0c497c359e96c736ed400",
"testharness"
],
"webrtc-extensions/RTCRtpReceiver-playoutDelayHint.html": [ "webrtc-extensions/RTCRtpReceiver-playoutDelayHint.html": [
"d8e47bda22174c63094c0918ccabed63513ea9fa", "d8e47bda22174c63094c0918ccabed63513ea9fa",
"testharness" "testharness"
@ -730362,7 +730597,7 @@
"support" "support"
], ],
"webrtc-identity/RTCPeerConnection-constructor.html": [ "webrtc-identity/RTCPeerConnection-constructor.html": [
"8498e6b35c9ff820c86773dd874930c5b012229e", "e7b7016338d8b8865b95098a0ec6f7eb2b65c4fb",
"testharness" "testharness"
], ],
"webrtc-identity/RTCPeerConnection-getIdentityAssertion.sub.https.html": [ "webrtc-identity/RTCPeerConnection-getIdentityAssertion.sub.https.html": [
@ -730574,7 +730809,7 @@
"testharness" "testharness"
], ],
"webrtc/RTCPeerConnection-createDataChannel.html": [ "webrtc/RTCPeerConnection-createDataChannel.html": [
"943e5728775494b8c5be4c521ce9671cd4e1bc4e", "350f71567820f80506fdc6d86452784521f0ff40",
"testharness" "testharness"
], ],
"webrtc/RTCPeerConnection-createOffer.html": [ "webrtc/RTCPeerConnection-createOffer.html": [
@ -730738,7 +730973,7 @@
"testharness" "testharness"
], ],
"webrtc/RTCRtpParameters-encodings.html": [ "webrtc/RTCRtpParameters-encodings.html": [
"c9e14cb374b232b8f9df0472f082b16cc02f9f28", "f71964429ae6bdb055157ead1af990e0e6716c6d",
"testharness" "testharness"
], ],
"webrtc/RTCRtpParameters-headerExtensions.html": [ "webrtc/RTCRtpParameters-headerExtensions.html": [
@ -730746,7 +730981,7 @@
"testharness" "testharness"
], ],
"webrtc/RTCRtpParameters-helper.js": [ "webrtc/RTCRtpParameters-helper.js": [
"d70694930086590ab3616c1cde0fec419c1b63da", "d61d8e14932963e9f17c47b99f2998d7ef0e9ff4",
"support" "support"
], ],
"webrtc/RTCRtpParameters-rtcp.html": [ "webrtc/RTCRtpParameters-rtcp.html": [
@ -732046,11 +732281,11 @@
"support" "support"
], ],
"webstorage/event_constructor.html": [ "webstorage/event_constructor.html": [
"fe7fca77a93c7adec48dc31e7926331e427b969b", "e0bb3f374f4326267e509b4605a7f573a13a627b",
"testharness" "testharness"
], ],
"webstorage/event_initstorageevent.html": [ "webstorage/event_initstorageevent.html": [
"2fe893143614ca6d44becd027f6befba82e18ad1", "b06a01617a832d51941bc5b351bfc1a6a9f07a59",
"testharness" "testharness"
], ],
"webstorage/event_local_key.html": [ "webstorage/event_local_key.html": [
@ -732478,7 +732713,7 @@
"support" "support"
], ],
"webvtt/api/VTTCue/constructor-exceptions.html": [ "webvtt/api/VTTCue/constructor-exceptions.html": [
"4d051fb3e981811961c3491297955542acbe445d", "843cab098456c963912cbe255b23b2f9bef14f67",
"testharness" "testharness"
], ],
"webvtt/api/VTTCue/constructor.html": [ "webvtt/api/VTTCue/constructor.html": [
@ -737110,7 +737345,7 @@
"support" "support"
], ],
"workers/modules/dedicated-worker-import-blob-url.any.js": [ "workers/modules/dedicated-worker-import-blob-url.any.js": [
"f51a821d1813df81187e8c78d6251f9f29cf45eb", "e5d79add73661e6a814fe77ccd783f651c56319c",
"testharness" "testharness"
], ],
"workers/modules/dedicated-worker-import-csp.html": [ "workers/modules/dedicated-worker-import-csp.html": [
@ -737122,11 +737357,11 @@
"testharness" "testharness"
], ],
"workers/modules/dedicated-worker-import-failure.html": [ "workers/modules/dedicated-worker-import-failure.html": [
"439bea888b2bac65f5de50d47c12639fd49168a4", "5e8b152195a354022943ae9404bb4473d3cd0c0d",
"testharness" "testharness"
], ],
"workers/modules/dedicated-worker-import-meta.html": [ "workers/modules/dedicated-worker-import-meta.html": [
"9292b0f6d8ef8f543cbdc060b64cf2826bac1ac4", "4ed56e279f7d558ca5d75c6cbe969ba41b2d52dd",
"testharness" "testharness"
], ],
"workers/modules/dedicated-worker-import-referrer.html": [ "workers/modules/dedicated-worker-import-referrer.html": [
@ -737134,7 +737369,7 @@
"testharness" "testharness"
], ],
"workers/modules/dedicated-worker-import.any.js": [ "workers/modules/dedicated-worker-import.any.js": [
"308c5e74c157da005257fd03fa9bc714c6d0eee7", "d5bb6cccbe21a3050f57dc8b3378e3e04fb7b03c",
"testharness" "testharness"
], ],
"workers/modules/dedicated-worker-options-credentials.html": [ "workers/modules/dedicated-worker-options-credentials.html": [
@ -737146,7 +737381,7 @@
"support" "support"
], ],
"workers/modules/dedicated-worker-options-type.html": [ "workers/modules/dedicated-worker-options-type.html": [
"b7c96b152950dda87ff0a34192008a6e30ec7471", "74523f4478b4209d4de060e98553946896fdecb7",
"testharness" "testharness"
], ],
"workers/modules/resources/credentials.py": [ "workers/modules/resources/credentials.py": [
@ -737282,7 +737517,7 @@
"support" "support"
], ],
"workers/modules/shared-worker-import-blob-url.any.js": [ "workers/modules/shared-worker-import-blob-url.any.js": [
"d9e9e34c394bc171cd497c8527b4806dfc32c595", "f56c1a5525f8c46e5d06f6549b3f355c4ccb4a0a",
"testharness" "testharness"
], ],
"workers/modules/shared-worker-import-failure.html": [ "workers/modules/shared-worker-import-failure.html": [
@ -737290,7 +737525,7 @@
"testharness" "testharness"
], ],
"workers/modules/shared-worker-import.any.js": [ "workers/modules/shared-worker-import.any.js": [
"450d4ad422b8da33d515da9b41557f488aff8bff", "15dfdde067a347b024c078578f24a5c63ae53fdd",
"testharness" "testharness"
], ],
"workers/modules/shared-worker-options-type.html": [ "workers/modules/shared-worker-options-type.html": [

View file

@ -0,0 +1,2 @@
[percentage-heights-010.html]
expected: FAIL

View file

@ -1,4 +0,0 @@
[CaretPosition-001.html]
[Element at (400, 100)]
expected: FAIL

View file

@ -1,11 +1,10 @@
[MediaQueryList-addListener-handleEvent.html] [MediaQueryList-addListener-handleEvent.html]
expected: TIMEOUT
[throws if handleEvent is falsy and not callable] [throws if handleEvent is falsy and not callable]
expected: NOTRUN expected: FAIL
[rethrows errors when getting handleEvent] [rethrows errors when getting handleEvent]
expected: TIMEOUT expected: FAIL
[throws if handleEvent is thruthy and not callable] [throws if handleEvent is thruthy and not callable]
expected: NOTRUN expected: FAIL

View file

@ -2,6 +2,3 @@
[listeners are called when <iframe> is resized] [listeners are called when <iframe> is resized]
expected: FAIL expected: FAIL
[listeners are called correct number of times]
expected: FAIL

View file

@ -0,0 +1,4 @@
[keepalive.html]
[cross-origin redirect with preflight]
expected: FAIL

View file

@ -312,24 +312,12 @@
[fetch(): separate response Content-Type: text/plain ] [fetch(): separate response Content-Type: text/plain ]
expected: NOTRUN expected: NOTRUN
[<iframe>: combined response Content-Type: text/html */*]
expected: FAIL
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: */* text/html]
expected: FAIL
[<iframe>: combined response Content-Type: text/html */*;charset=gbk] [<iframe>: combined response Content-Type: text/html */*;charset=gbk]
expected: FAIL expected: FAIL
[<iframe>: combined response Content-Type: text/html;" \\" text/plain] [<iframe>: separate response Content-Type: text/html;" \\" text/plain]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk] [<iframe>: combined response Content-Type: text/html;x=" text/plain]
expected: FAIL expected: FAIL

View file

@ -11,6 +11,9 @@
[X-Content-Type-Options%3A%20nosniff%0C] [X-Content-Type-Options%3A%20nosniff%0C]
expected: FAIL expected: FAIL
[X-Content-Type-Options%3A%20%2Cnosniff] [X-Content-Type-Options%3A%20%40%23%24%23%25%25%26%5E%26%5E*()()11!%2Cnosniff]
expected: FAIL
[Content-Type-Options%3A%20nosniff]
expected: FAIL expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_1.html]
[Multiple history traversals from the same task]
expected: FAIL

View file

@ -1,4 +1,4 @@
[traverse_the_history_4.html] [traverse_the_history_5.html]
[Multiple history traversals, last would be aborted] [Multiple history traversals, last would be aborted]
expected: FAIL expected: FAIL

View file

@ -1,8 +1,4 @@
[skip-document-with-fragment.html] [skip-document-with-fragment.html]
expected: TIMEOUT
[Autofocus elements in iframed documents with URL fragments should be skipped.] [Autofocus elements in iframed documents with URL fragments should be skipped.]
expected: FAIL expected: FAIL
[Autofocus elements in top-level browsing context's documents with URI fragments should be skipped.]
expected: TIMEOUT

View file

@ -0,0 +1,4 @@
[style_load_event.html]
[style load event should fire when textContent changed]
expected: FAIL

View file

@ -1,2 +0,0 @@
[script-onerror-insertion-point-2.html]
expected: TIMEOUT

View file

@ -1,5 +1,5 @@
[ignore-opens-during-unload.window.html] [ignore-opens-during-unload.window.html]
expected: TIMEOUT expected: CRASH
[ignore-opens-during-unload] [ignore-opens-during-unload]
expected: FAIL expected: FAIL

View file

@ -0,0 +1,7 @@
[grow-reftypes.tentative.any.html]
[Grow with exported-function argument]
expected: FAIL
[grow-reftypes.tentative.any.worker.html]
expected: ERROR

View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>createImageBitmap in worker and transfer</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
promise_test(function(t) {
return new Promise(function(resolve, reject) {
var worker = new Worker("createImageBitmap-worker.js");
worker.addEventListener("message", function(evt) {
var bitmap = evt.data;
assert_equals(bitmap.width, 20);
assert_equals(bitmap.height, 20);
resolve();
});
worker.postMessage('test');
});
}, 'Transfer ImageBitmap created in worker');
</script>

View file

@ -0,0 +1,17 @@
function makeBlob() {
return new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open("GET", '/images/pattern.png');
xhr.responseType = 'blob';
xhr.send();
xhr.onload = function() {
resolve(xhr.response);
};
});
}
addEventListener("message", () => {
makeBlob().then(createImageBitmap).then(bitmap => {
postMessage(bitmap, [bitmap]);
});
});

View file

@ -23,7 +23,7 @@ indexeddb_test(
worker.postMessage('', [buffer]); worker.postMessage('', [buffer]);
assert_equals(array.byteLength, 0); assert_equals(array.byteLength, 0);
assert_throws(new TypeError, () => { store.put('', buffer); }); assert_throws_js(TypeError, () => { store.put('', buffer); });
t.done(); t.done();
}, },
'Detached ArrayBuffer' 'Detached ArrayBuffer'
@ -43,7 +43,7 @@ indexeddb_test(
worker.postMessage('', [array.buffer]); worker.postMessage('', [array.buffer]);
assert_equals(array.length, 0); assert_equals(array.length, 0);
assert_throws(new TypeError, () => { store.put('', array); }); assert_throws_js(TypeError, () => { store.put('', array); });
t.done(); t.done();
}, },
'Detached TypedArray' 'Detached TypedArray'

View file

@ -23,7 +23,7 @@ indexeddb_test(
const cursor = r.result; const cursor = r.result;
setTimeout(t.step_func(() => { setTimeout(t.step_func(() => {
assert_throws(new TypeError, () => { cursor.advance(0); }, assert_throws_js(TypeError, () => { cursor.advance(0); },
'"zero" check (TypeError) should precede ' + '"zero" check (TypeError) should precede ' +
'"not active" check (TransactionInactiveError)'); '"not active" check (TransactionInactiveError)');
t.done(); t.done();

View file

@ -8,7 +8,7 @@
test(function() { test(function() {
var range = IDBKeyRange.bound(12, 34); var range = IDBKeyRange.bound(12, 34);
assert_throws(new TypeError, function() { range.includes(); }, assert_throws_js(TypeError, function() { range.includes(); },
'throws if key is not specified'); 'throws if key is not specified');
assert_throws('DataError', function() { range.includes(undefined); }, assert_throws('DataError', function() { range.includes(undefined); },

View file

@ -142,16 +142,16 @@ test(() => {
let func = () => {}; let func = () => {};
// cannonicalUUID // cannonicalUUID
assert_throws(new TypeError, () => BluetoothUUID.canonicalUUID(object)); assert_throws_js(TypeError, () => BluetoothUUID.canonicalUUID(object));
// [] converts to '', which converts to 0 before the range check. // [] converts to '', which converts to 0 before the range check.
assert_equals(BluetoothUUID.canonicalUUID(array), base_uuid); assert_equals(BluetoothUUID.canonicalUUID(array), base_uuid);
assert_throws(new TypeError, () => BluetoothUUID.canonicalUUID(func)); assert_throws_js(TypeError, () => BluetoothUUID.canonicalUUID(func));
assert_throws(new TypeError, () => BluetoothUUID.canonicalUUID(undefined)); assert_throws_js(TypeError, () => BluetoothUUID.canonicalUUID(undefined));
assert_equals(BluetoothUUID.canonicalUUID(null), base_uuid); assert_equals(BluetoothUUID.canonicalUUID(null), base_uuid);
assert_equals(BluetoothUUID.canonicalUUID(false), base_uuid); assert_equals(BluetoothUUID.canonicalUUID(false), base_uuid);
assert_equals( assert_equals(
BluetoothUUID.canonicalUUID(true), BluetoothUUID.canonicalUUID(1)); BluetoothUUID.canonicalUUID(true), BluetoothUUID.canonicalUUID(1));
assert_throws(new TypeError, () => BluetoothUUID.canonicalUUID(NaN)); assert_throws_js(TypeError, () => BluetoothUUID.canonicalUUID(NaN));
// getService // getService
assert_throws(TypeError(), () => BluetoothUUID.getService(object)); assert_throws(TypeError(), () => BluetoothUUID.getService(object));

View file

@ -81,6 +81,41 @@ The generator script has two targets: ```release``` and ```debug```.
Note that **release** is the default target when invoking ```generate.py```. Note that **release** is the default target when invoking ```generate.py```.
## Sub projects
Projects can be nested, for example to reuse a single `spec.src.json` across similar but slightly different sets of generated tests.
The directory structure would look like:
```
project-directory/ (e.g. referrer-policy/)
├── spec.src.json - Parent project's spec JSON
├── generic/
│ └── test-case.sub.js - Parent project's test helper
├── gen/ - parent project's generated tests
└── sub-project-directory/ (e.g. 4K)
├── spec.src.json - Child project's spec JSON
├── generic/
│ └── test-case.sub.js - Child project's test helper
└── gen/ - child project's generated tests
```
`generate.py --spec project-directory/sub-project-directory` generates test files under `project-directory/sub-project-directory/gen`, based on `project-directory/spec.src.json` and `project-directory/sub-project-directory/spec.src.json`.
- The child project's `spec.src.json` is merged into parent project's `spec.src.json`.
- Two spec JSON objects are merged recursively.
- If a same key exists in both objects, the child's value overwrites the parent's value.
- If both (child's and parent's) values are arrays, then the child's value is concatenated to the parent's value.
- For debugging, `generate.py` dumps the merged spec JSON object as `generic/debug-output.spec.src.json`.
- The child project's generated tests include both of the parent and child project's `test-case.sub.js`:
```html
<script src="project-directory/test-case.sub.js"></script>
<script src="project-directory/sub-project-directory/test-case.sub.js"></script>
<script>
TestCase(...);
</script>
```
## Updating the tests ## Updating the tests
The main test logic lives in ```project-directory/generic/test-case.sub.js``` with helper functions defined in ```/common/security-features/resources/common.js``` so you should probably start there. The main test logic lives in ```project-directory/generic/test-case.sub.js``` with helper functions defined in ```/common/security-features/resources/common.js``` so you should probably start there.

View file

@ -7,7 +7,9 @@ def main():
'''Formats spec.src.json.''' '''Formats spec.src.json.'''
script_directory = os.path.dirname(os.path.abspath(__file__)) script_directory = os.path.dirname(os.path.abspath(__file__))
for dir in [ for dir in [
'mixed-content', 'referrer-policy', 'upgrade-insecure-requests' 'mixed-content', 'referrer-policy', 'referrer-policy/4K-1',
'referrer-policy/4K', 'referrer-policy/4K+1',
'upgrade-insecure-requests'
]: ]:
filename = os.path.join(script_directory, '..', '..', '..', dir, filename = os.path.join(script_directory, '..', '..', '..', dir,
'spec.src.json') 'spec.src.json')

View file

@ -130,8 +130,8 @@ def handle_deliveries(policy_deliveries):
return {"meta": meta, "headers": headers} return {"meta": meta, "headers": headers}
def generate_selection(spec_directory, spec_json, selection, spec, def generate_selection(spec_directory, test_helper_filenames, spec_json,
test_html_template_basename): selection, spec, test_html_template_basename):
test_filename = get_test_filename(spec_directory, spec_json, selection) test_filename = get_test_filename(spec_directory, spec_json, selection)
target_policy_delivery = util.PolicyDelivery(selection['delivery_type'], target_policy_delivery = util.PolicyDelivery(selection['delivery_type'],
@ -184,9 +184,10 @@ def generate_selection(spec_directory, spec_json, selection, spec,
test_directory = os.path.dirname(test_filename) test_directory = os.path.dirname(test_filename)
selection['helper_js'] = os.path.relpath( selection['helper_js'] = ""
os.path.join(spec_directory, 'generic', 'test-case.sub.js'), for test_helper_filename in test_helper_filenames:
test_directory) selection['helper_js'] += ' <script src="%s"></script>\n' % (
os.path.relpath(test_helper_filename, test_directory))
selection['sanity_checker_js'] = os.path.relpath( selection['sanity_checker_js'] = os.path.relpath(
os.path.join(spec_directory, 'generic', 'sanity-checker.js'), os.path.join(spec_directory, 'generic', 'sanity-checker.js'),
test_directory) test_directory)
@ -237,17 +238,20 @@ def generate_selection(spec_directory, spec_json, selection, spec,
util.write_file(test_filename, test_html_template % selection) util.write_file(test_filename, test_html_template % selection)
def generate_test_source_files(spec_directory, spec_json, target): def generate_test_source_files(spec_directory, test_helper_filenames,
spec_json, target):
test_expansion_schema = spec_json['test_expansion_schema'] test_expansion_schema = spec_json['test_expansion_schema']
specification = spec_json['specification'] specification = spec_json['specification']
spec_json_js_template = util.get_template('spec_json.js.template') spec_json_js_template = util.get_template('spec_json.js.template')
generated_spec_json_filename = os.path.join(spec_directory, "generic",
"spec_json.js")
util.write_file( util.write_file(
generated_spec_json_filename, os.path.join(spec_directory, "generic", "spec_json.js"),
spec_json_js_template % {'spec_json': json.dumps(spec_json)}) spec_json_js_template % {'spec_json': json.dumps(spec_json)})
util.write_file(
os.path.join(spec_directory, "generic", "debug-output.spec.src.json"),
json.dumps(spec_json, indent=2, separators=(',', ': ')))
# Choose a debug/release template depending on the target. # Choose a debug/release template depending on the target.
html_template = "test.%s.html.template" % target html_template = "test.%s.html.template" % target
@ -290,12 +294,26 @@ def generate_test_source_files(spec_directory, spec_json, target):
print('Excluding selection:', selection_path) print('Excluding selection:', selection_path)
continue continue
try: try:
generate_selection(spec_directory, spec_json, selection, spec, generate_selection(spec_directory, test_helper_filenames,
html_template) spec_json, selection, spec, html_template)
except util.ShouldSkip: except util.ShouldSkip:
continue continue
def merge_json(base, child):
for key in child:
if key not in base:
base[key] = child[key]
continue
# `base[key]` and `child[key]` both exists.
if isinstance(base[key], list) and isinstance(child[key], list):
base[key].extend(child[key])
elif isinstance(base[key], dict) and isinstance(child[key], dict):
merge_json(base[key], child[key])
else:
base[key] = child[key]
def main(): def main():
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description='Test suite generator utility') description='Test suite generator utility')
@ -317,11 +335,38 @@ def main():
spec_directory = os.path.abspath(args.spec) spec_directory = os.path.abspath(args.spec)
spec_filename = os.path.join(spec_directory, "spec.src.json") # Read `spec.src.json` files, starting from `spec_directory`, and
spec_json = util.load_spec_json(spec_filename) # continuing to parent directories as long as `spec.src.json` exists.
spec_validator.assert_valid_spec_json(spec_json) spec_filenames = []
test_helper_filenames = []
spec_src_directory = spec_directory
while len(spec_src_directory) >= len(util.test_root_directory):
spec_filename = os.path.join(spec_src_directory, "spec.src.json")
if not os.path.exists(spec_filename):
break
spec_filenames.append(spec_filename)
test_filename = os.path.join(spec_src_directory, 'generic',
'test-case.sub.js')
assert (os.path.exists(test_filename))
test_helper_filenames.append(test_filename)
spec_src_directory = os.path.abspath(
os.path.join(spec_src_directory, ".."))
generate_test_source_files(spec_directory, spec_json, args.target) spec_filenames = list(reversed(spec_filenames))
test_helper_filenames = list(reversed(test_helper_filenames))
if len(spec_filenames) == 0:
print('Error: No spec.src.json is found at %s.' % spec_directory)
return
spec_json = util.load_spec_json(spec_filenames[0])
for spec_filename in spec_filenames[1:]:
child_spec_json = util.load_spec_json(spec_filename)
merge_json(spec_json, child_spec_json)
spec_validator.assert_valid_spec_json(spec_json)
generate_test_source_files(spec_directory, test_helper_filenames,
spec_json, args.target)
if __name__ == '__main__': if __name__ == '__main__':

View file

@ -15,8 +15,7 @@
<script src="%(spec_json_js)s"></script> <script src="%(spec_json_js)s"></script>
<!-- Internal checking of the tests --> <!-- Internal checking of the tests -->
<script src="%(sanity_checker_js)s"></script> <script src="%(sanity_checker_js)s"></script>
<script src="%(helper_js)s"></script> %(helper_js)s </head>
</head>
<body> <body>
<script> <script>
TestCase( TestCase(

View file

@ -11,8 +11,7 @@
<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="/common/security-features/resources/common.sub.js"></script> <script src="/common/security-features/resources/common.sub.js"></script>
<script src="%(helper_js)s"></script> %(helper_js)s </head>
</head>
<body> <body>
<script> <script>
TestCase( TestCase(

View file

@ -1,7 +1,7 @@
self.testSettingImmutablePrototypeToNewValueOnly = self.testSettingImmutablePrototypeToNewValueOnly =
(prefix, target, newValue, newValueString, { isSameOriginDomain }) => { (prefix, target, newValue, newValueString, { isSameOriginDomain }) => {
test(() => { test(() => {
assert_throws(new TypeError, () => { assert_throws_js(TypeError, () => {
Object.setPrototypeOf(target, newValue); Object.setPrototypeOf(target, newValue);
}); });
}, `${prefix}: setting the prototype to ${newValueString} via Object.setPrototypeOf should throw a TypeError`); }, `${prefix}: setting the prototype to ${newValueString} via Object.setPrototypeOf should throw a TypeError`);

View file

@ -10,7 +10,7 @@
<script nonce='abc'> <script nonce='abc'>
test(function() { test(function() {
assert_throws(new EvalError, function() { assert_throws_js(EvalError, function() {
eval("0"); eval("0");
}, "eval of a string should reach host callout"); }, "eval of a string should reach host callout");
}, "eval of a string should be checked by CSP"); }, "eval of a string should be checked by CSP");

View file

@ -43,7 +43,13 @@ promise_test(async testCase => {
{ name: 'cookie-name1', matchType: 'equals', url: `${scope}/path1` }, { name: 'cookie-name1', matchType: 'equals', url: `${scope}/path1` },
]; ];
await registration.cookies.subscribe(subscriptions); await registration.cookies.subscribe(subscriptions);
testCase.add_cleanup(() => registration.cookies.unsubscribe(subscriptions)); testCase.add_cleanup(() => {
// For non-ServiceWorker environments, registration.unregister() cleans up
// cookie subscriptions.
if (self.GLOBAL.isWorker()) {
return registration.cookies.unsubscribe(subscriptions);
}
});
} }
{ {
const subscriptions = [ const subscriptions = [
@ -51,7 +57,13 @@ promise_test(async testCase => {
{ name: 'cookie-prefix', matchType: 'starts-with' }, { name: 'cookie-prefix', matchType: 'starts-with' },
]; ];
await registration.cookies.subscribe(subscriptions); await registration.cookies.subscribe(subscriptions);
testCase.add_cleanup(() => registration.cookies.unsubscribe(subscriptions)); testCase.add_cleanup(() => {
// For non-ServiceWorker environments, registration.unregister() cleans up
// cookie subscriptions.
if (self.GLOBAL.isWorker()) {
return registration.cookies.unsubscribe(subscriptions);
}
});
} }
const subscriptions = await registration.cookies.getSubscriptions(); const subscriptions = await registration.cookies.getSubscriptions();

View file

@ -34,7 +34,7 @@
window.addEventListener("message", msgHandler); window.addEventListener("message", msgHandler);
if (!w) if (!w)
reject("Popup could not be opened (did you whitelist the test site in your popup blocker?)."); reject("Popup could not be opened (did you allow the test site in your popup blocker?).");
}); });
}); });
}, title); }, title);

View file

@ -28,7 +28,7 @@
window.addEventListener("message", msgHandler); window.addEventListener("message", msgHandler);
if (!w) if (!w)
reject("Popup could not be opened (did you whitelist the test site in your popup blocker?)."); reject("Popup could not be opened (did you allow the test site in your popup blocker?).");
}); });
}); });
}, title); }, title);

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<title>A height: 100% descendant should trigger a relayout when stretching.</title>
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#definite-sizes" />
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1043071" />
<link rel="match" href="../reference/ref-filled-green-100px-square.xht" />
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="display: flex; width: 100px;">
<div style="display: flex; flex-direction: column; flex: 1; min-height: 100px;">
<div style="flex: 1; background: red;">
<div style="height: 100%; background-color: green;"></div>
</div>
</div>
</div>

View file

@ -71,36 +71,38 @@ promise_test(async t => {
assert_equals(calls, 1); assert_equals(calls, 1);
}, "doesn't look up handleEvent method on callable event listeners"); }, "doesn't look up handleEvent method on callable event listeners");
const uncaught_error_test = async (t, listener) => { const uncaught_error_test = async (t, getHandleEvent) => {
const mql = await createMQL(t); const mql = await createMQL(t);
mql.addListener(listener);
const eventWatcher = new EventWatcher(t, window, "error"); let calls = 0;
mql.addListener({
get handleEvent() {
calls++;
return getHandleEvent();
},
});
const eventWatcher = new EventWatcher(t, window, "error", waitForChangesReported);
const errorPromise = eventWatcher.wait_for("error"); const errorPromise = eventWatcher.wait_for("error");
triggerMQLEvent(mql); triggerMQLEvent(mql);
const event = await errorPromise; const event = await errorPromise;
assert_equals(calls, 1, "handleEvent property was not looked up");
throw event.error; throw event.error;
}; };
promise_test(t => { promise_test(t => {
const error = { name: "test" }; const error = { name: "test" };
const listener = {
get handleEvent() {
throw error;
},
};
return promise_rejects_exactly(t, error, uncaught_error_test(t, listener)); return promise_rejects_exactly(t, error,
uncaught_error_test(t, () => { throw error; }));
}, "rethrows errors when getting handleEvent"); }, "rethrows errors when getting handleEvent");
promise_test(t => { promise_test(t => {
const listener = { handleEvent: null }; return promise_rejects(t, new TypeError(), uncaught_error_test(t, () => false));
return promise_rejects(t, new TypeError(), uncaught_error_test(t, listener));
}, "throws if handleEvent is falsy and not callable"); }, "throws if handleEvent is falsy and not callable");
promise_test(t => { promise_test(t => {
const listener = { handleEvent: "str" }; return promise_rejects(t, new TypeError(), uncaught_error_test(t, () => "str"));
return promise_rejects(t, new TypeError(), uncaught_error_test(t, listener));
}, "throws if handleEvent is thruthy and not callable"); }, "throws if handleEvent is thruthy and not callable");
</script> </script>

View file

@ -45,7 +45,7 @@
}, 'insertRule with #bar selector'); }, 'insertRule with #bar selector');
test(function() { test(function() {
assert_throws(new TypeError, function() { styleSheet.insertRule() }); assert_throws_js(TypeError, function() { styleSheet.insertRule() });
}, 'insertRule with no argument throws'); }, 'insertRule with no argument throws');
test(function() { test(function() {
@ -65,7 +65,7 @@
}, 'deleteRule(1)'); }, 'deleteRule(1)');
test(function() { test(function() {
assert_throws(new TypeError, function() { styleSheet.deleteRule() }); assert_throws_js(TypeError, function() { styleSheet.deleteRule() });
}, 'deleteRule with no argument throws'); }, 'deleteRule with no argument throws');
test(function() { test(function() {

View file

@ -36,7 +36,7 @@
// MediaList.deleteMedium called without argument throws error. // MediaList.deleteMedium called without argument throws error.
test(function() { test(function() {
media_list = setup(); media_list = setup();
assert_throws(new TypeError, function() { media_list.deleteMedium(); }); assert_throws_js(TypeError, function() { media_list.deleteMedium(); });
}, "deleteMedium_called_without_argument"); }, "deleteMedium_called_without_argument");
// MediaList.deleteMedium removes correct medium and updates corresponding properties. // MediaList.deleteMedium removes correct medium and updates corresponding properties.

View file

@ -17,7 +17,7 @@ test(() => {
assert_false(element.hasAttribute('is')) assert_false(element.hasAttribute('is'))
} catch (e) { } catch (e) {
// If v1 is supported, then converting string to dictionary should throw. // If v1 is supported, then converting string to dictionary should throw.
assert_throws(new TypeError, function() { throw e }) assert_throws_js(TypeError, function() { throw e })
} }
}, 'document.createElement(localName, "string") should not work') }, 'document.createElement(localName, "string") should not work')
@ -29,7 +29,7 @@ test(() => {
assert_false(element.hasAttribute('is')) assert_false(element.hasAttribute('is'))
} catch (e) { } catch (e) {
// If v1 is supported, then converting string to dictionary should throw. // If v1 is supported, then converting string to dictionary should throw.
assert_throws(new TypeError, function() { throw e }) assert_throws_js(TypeError, function() { throw e })
} }
}, 'document.createElementNS(namespace, qualifiedName, "string") should not work') }, 'document.createElementNS(namespace, qualifiedName, "string") should not work')
</script> </script>

View file

@ -27,30 +27,6 @@ test(function(t) {
target.dispatchEvent(new Event(type)); target.dispatchEvent(new Event(type));
}, "calls `handleEvent` method of `EventListener`"); }, "calls `handleEvent` method of `EventListener`");
test(function(t) {
var type = "foo";
var target = document.createElement("div");
var thrownError = { name: "test" };
var uncaughtError;
var errorHandler = function(event) {
uncaughtError = event.error;
};
window.addEventListener("error", errorHandler);
t.add_cleanup(function() {
window.removeEventListener("error", errorHandler);
});
target.addEventListener(type, {
get handleEvent() {
throw thrownError;
},
});
target.dispatchEvent(new Event(type));
assert_equals(thrownError, uncaughtError);
}, "rethrows errors when getting `handleEvent`");
test(function(t) { test(function(t) {
var type = "foo"; var type = "foo";
var target = document.createElement("div"); var target = document.createElement("div");
@ -81,45 +57,46 @@ test(function(t) {
assert_equals(calls, 1); assert_equals(calls, 1);
}, "doesn't call `handleEvent` method on callable `EventListener`"); }, "doesn't call `handleEvent` method on callable `EventListener`");
test(function(t) { const uncaught_error_test = async (t, getHandleEvent) => {
var type = "foo"; const type = "foo";
var target = document.createElement("div"); const target = document.createElement("div");
var uncaughtError;
var errorHandler = function(event) { let calls = 0;
uncaughtError = event.error; target.addEventListener(type, {
get handleEvent() {
calls++;
return getHandleEvent();
},
});
const timeout = () => {
return new Promise(resolve => {
t.step_timeout(resolve, 0);
});
}; };
window.addEventListener("error", errorHandler); const eventWatcher = new EventWatcher(t, window, "error", timeout);
t.add_cleanup(function() { const errorPromise = eventWatcher.wait_for("error");
window.removeEventListener("error", errorHandler);
});
target.addEventListener(type, {
handleEvent: null,
});
target.dispatchEvent(new Event(type)); target.dispatchEvent(new Event(type));
assert_true(uncaughtError instanceof TypeError);
const event = await errorPromise;
assert_equals(calls, 1, "handleEvent property was not looked up");
throw event.error;
};
promise_test(t => {
const error = { name: "test" };
return promise_rejects_exactly(t, error,
uncaught_error_test(t, () => { throw error; }));
}, "rethrows errors when getting `handleEvent`");
promise_test(t => {
return promise_rejects(t, new TypeError(), uncaught_error_test(t, () => null));
}, "throws if `handleEvent` is falsy and not callable"); }, "throws if `handleEvent` is falsy and not callable");
test(function(t) { promise_test(t => {
var type = "foo"; return promise_rejects(t, new TypeError(), uncaught_error_test(t, () => 42));
var target = document.createElement("div");
var uncaughtError;
var errorHandler = function(event) {
uncaughtError = event.error;
};
window.addEventListener("error", errorHandler);
t.add_cleanup(function() {
window.removeEventListener("error", errorHandler);
});
target.addEventListener(type, {
handleEvent: 1,
});
target.dispatchEvent(new Event(type));
assert_true(uncaughtError instanceof TypeError);
}, "throws if `handleEvent` is thruthy and not callable"); }, "throws if `handleEvent` is thruthy and not callable");
</script> </script>

View file

@ -71,7 +71,7 @@ test(() => {
assert_equals(decoder.decode(new DataView(bytes.buffer, 0, 3)), assert_equals(decoder.decode(new DataView(bytes.buffer, 0, 3)),
'♥', '♥',
'decode() should decode full sequence'); 'decode() should decode full sequence');
assert_throws(new TypeError, assert_throws_js(TypeError,
() => decoder.decode(new DataView(bytes.buffer, 0, 2)), () => decoder.decode(new DataView(bytes.buffer, 0, 2)),
'decode() should throw on incomplete sequence'); 'decode() should throw on incomplete sequence');
assert_equals(decoder.decode(new DataView(bytes.buffer, 0, 3)), assert_equals(decoder.decode(new DataView(bytes.buffer, 0, 3)),

View file

@ -7,25 +7,85 @@
<script src="/common/get-host-info.sub.js"></script> <script src="/common/get-host-info.sub.js"></script>
<body> <body>
<script> <script>
function getUrl(origin1, origin2, withHeaders) {
const frameOrigin = host_info.HTTP_NOTSAMESITE_ORIGIN;
return `${frameOrigin}/fetch/api/resources/keepalive-iframe.html?` +
`origin1=${origin1}&` +
`origin2=${origin2}&` +
(withHeaders ? `with-headers` : ``);
}
async function getToken() {
return new Promise((resolve) => {
window.addEventListener('message', (event) => {
resolve(event.data);
}, {once: true});
});
}
async function queryToken(token) {
const response = await fetch(`../resources/stash-take.py?key=${token}`);
const json = await response.json();
return json;
}
// In order to parallelize the work, we are going to have an async_test
// for the rest of the work. Note that we want the serialized behavior
// for the steps so far, so we don't want to make the entire test case
// an async_test.
function checkToken(testName, token) {
async_test((test) => {
new Promise((resolve) => test.step_timeout(resolve, 1000)).then(() => {
return queryToken(token);
}).then((result) => {
assert_equals(result, 'on');
}).then(() => {
test.done();
}).catch(test.step_func((e) => {
assert_unreached(e);
}));
}, testName);
}
const host_info = get_host_info(); const host_info = get_host_info();
promise_test(async (test) => { promise_test(async (test) => {
const iframe = document.createElement('iframe'); const iframe = document.createElement('iframe');
iframe.src = host_info.HTTP_REMOTE_ORIGIN + iframe.src = getUrl('', '', false);
'/fetch/api/resources/keepalive-iframe.html';
document.body.appendChild(iframe); document.body.appendChild(iframe);
const uuid_promise = new Promise((resolve) => { const tokenPromise = getToken();
window.addEventListener('message', (event) => {
resolve(event.data);
});
});
await (new Promise((resolve) => iframe.addEventListener('load', resolve))); await (new Promise((resolve) => iframe.addEventListener('load', resolve)));
const uuid = await uuid_promise; const token = await tokenPromise;
iframe.remove(); iframe.remove();
await (new Promise((resolve) => test.step_timeout(resolve, 1000)));
const response = await fetch(`../resources/stash-take.py?key=${uuid}`); checkToken('same-origin', token);
const json = await response.json(); }, 'same-origin; setting up');
assert_equals(json, 'on');
}); promise_test(async (test) => {
const iframe = document.createElement('iframe');
iframe.src = getUrl(host_info.HTTP_REMOTE_ORIGIN,
host_info.HTTP_REMOTE_ORIGIN_WITH_DIFFERENT_PORT, false);
document.body.appendChild(iframe);
const tokenPromise = getToken();
await (new Promise((resolve) => iframe.addEventListener('load', resolve)));
const token = await tokenPromise;
iframe.remove();
checkToken('cross-origin redirect', token);
}, 'cross-origin redirect; setting up');
promise_test(async (test) => {
const iframe = document.createElement('iframe');
iframe.src = getUrl(host_info.HTTP_REMOTE_ORIGIN,
host_info.HTTP_REMOTE_ORIGIN_WITH_DIFFERENT_PORT, true);
document.body.appendChild(iframe);
const tokenPromise = getToken();
await (new Promise((resolve) => iframe.addEventListener('load', resolve)));
const token = await tokenPromise;
iframe.remove();
checkToken('cross-origin redirect with preflight', token);
}, 'cross-origin redirect with preflight; setting up');
</script> </script>
</body> </body>
</html> </html>

View file

@ -35,7 +35,7 @@ test(function() {
}, "Passing undefined to Headers constructor"); }, "Passing undefined to Headers constructor");
test(function() { test(function() {
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
var h = new Headers(null); var h = new Headers(null);
}); });
}, "Passing null to Headers constructor"); }, "Passing null to Headers constructor");
@ -126,7 +126,7 @@ test(function() {
this.add_cleanup(clearLog); this.add_cleanup(clearLog);
var record = { a: "b", "\uFFFF": "d" }; var record = { a: "b", "\uFFFF": "d" };
var proxy = new Proxy(record, loggingHandler); var proxy = new Proxy(record, loggingHandler);
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
var h = new Headers(proxy); var h = new Headers(proxy);
}); });
@ -151,7 +151,7 @@ test(function() {
this.add_cleanup(clearLog); this.add_cleanup(clearLog);
var record = { a: "\uFFFF", c: "d" } var record = { a: "\uFFFF", c: "d" }
var proxy = new Proxy(record, loggingHandler); var proxy = new Proxy(record, loggingHandler);
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
var h = new Headers(proxy); var h = new Headers(proxy);
}); });

View file

@ -2,16 +2,24 @@
<html> <html>
<meta charset="utf-8"> <meta charset="utf-8">
<script src="/common/utils.js"></script> <script src="/common/utils.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script> <script>
const uuid = token(); const SEARCH_PARAMS = new URL(location.href).searchParams;
const URL = const ORIGIN1 = SEARCH_PARAMS.get('origin1') || '';
`../resources/redirect.py?` + const ORIGIN2 = SEARCH_PARAMS.get('origin2') || '';
`delay=100&` + const WITH_HEADERS = !!SEARCH_PARAMS.has('with-headers');
`location=../resources/stash-put.py?key=${uuid}%26value=on`; const TOKEN = token();
const url =
`${ORIGIN1}/fetch/api/resources/redirect.py?` +
`delay=500&` +
`allow_headers=foo&` +
`location=${ORIGIN2}/fetch/api/resources/stash-put.py?key=${TOKEN}%26value=on`;
addEventListener('load', () => { addEventListener('load', () => {
let p = fetch(URL, {keepalive: true}); const headers = WITH_HEADERS ? {'foo': 'bar'} : undefined;
window.parent.postMessage(uuid, '*'); let p = fetch(url, {keepalive: true, headers});
window.parent.postMessage(TOKEN, '*');
}); });
</script> </script>
</html> </html>

View file

@ -1,4 +1,11 @@
def main(request, response): def main(request, response):
if request.method == 'OPTIONS':
# CORS preflight
response.headers.set('Access-Control-Allow-Origin', '*')
response.headers.set('Access-Control-Allow-Methods', '*')
response.headers.set('Access-Control-Allow-Headers', '*')
return 'done'
url_dir = '/'.join(request.url_parts.path.split('/')[:-1]) + '/' url_dir = '/'.join(request.url_parts.path.split('/')[:-1]) + '/'
key = request.GET.first("key") key = request.GET.first("key")
value = request.GET.first("value") value = request.GET.first("value")

View file

@ -63,6 +63,7 @@ protected_mime_types = [
"application/x-protobuf", "application/x-protobuf",
"application/zip", "application/zip",
"multipart/byteranges", "multipart/byteranges",
"multipart/signed",
"text/csv", "text/csv",
"text/event-stream", "text/event-stream",
] ]

View file

@ -6,7 +6,7 @@
<script> <script>
test(() => { test(() => {
assert_equals(SensorErrorEvent.length, 2); assert_equals(SensorErrorEvent.length, 2);
assert_throws(new TypeError, () => new SensorErrorEvent('error')); assert_throws_js(TypeError, () => new SensorErrorEvent('error'));
}, 'SensorErrorEvent constructor without init dict'); }, 'SensorErrorEvent constructor without init dict');
test(() => { test(() => {

View file

@ -135,7 +135,7 @@ function addPromiseThenTest(func, desc) {
} }
/* /*
* Basic sanity testing. * Basic smoke tests for same-origin and cross-origin behaviors.
*/ */
addTest(function(win) { addTest(function(win) {
@ -154,14 +154,14 @@ addTest(function(win) {
}, "Basic sanity-checking"); }, "Basic sanity-checking");
/* /*
* Whitelist behavior. * Tests regarding which properties are allowed cross-origin.
* *
* Also tests for [[GetOwnProperty]] and [[HasOwnProperty]] behavior. * Also tests for [[GetOwnProperty]] and [[HasOwnProperty]] behavior.
*/ */
var whitelistedSymbols = [Symbol.toStringTag, Symbol.hasInstance, var allowedSymbols = [Symbol.toStringTag, Symbol.hasInstance,
Symbol.isConcatSpreadable]; Symbol.isConcatSpreadable];
var windowWhitelists = { var windowAllowlists = {
namedFrames: ['donotleakme'], namedFrames: ['donotleakme'],
indices: ['0', '1'], indices: ['0', '1'],
getters: ['location', 'window', 'frames', 'self', 'top', 'parent', getters: ['location', 'window', 'frames', 'self', 'top', 'parent',
@ -174,22 +174,22 @@ var windowWhitelists = {
// otherwise throw. They are not, however, cross-origin accessible. // otherwise throw. They are not, however, cross-origin accessible.
promiseMethods: ['createImageBitmap', 'fetch'], promiseMethods: ['createImageBitmap', 'fetch'],
} }
windowWhitelists.propNames = Array.from(new Set([...windowWhitelists.indices, windowAllowlists.propNames = Array.from(new Set([...windowAllowlists.indices,
...windowWhitelists.getters, ...windowAllowlists.getters,
...windowWhitelists.setters, ...windowAllowlists.setters,
...windowWhitelists.methods, ...windowAllowlists.methods,
'then'])).sort(); 'then'])).sort();
windowWhitelists.props = windowWhitelists.propNames.concat(whitelistedSymbols); windowAllowlists.props = windowAllowlists.propNames.concat(allowedSymbols);
var locationWhitelists = { var locationAllowlists = {
getters: [], getters: [],
setters: ['href'], setters: ['href'],
methods: ['replace'], methods: ['replace'],
promiseMethods: [], promiseMethods: [],
} }
locationWhitelists.propNames = Array.from(new Set([...locationWhitelists.getters, locationAllowlists.propNames = Array.from(new Set([...locationAllowlists.getters,
...locationWhitelists.setters, ...locationAllowlists.setters,
...locationWhitelists.methods, ...locationAllowlists.methods,
'then'])).sort(); 'then'])).sort();
// Define various sets of arguments to call cross-origin methods with. Arguments // Define various sets of arguments to call cross-origin methods with. Arguments
@ -216,7 +216,7 @@ var methodArgs = new Map(Object.entries({
addTest(function(win) { addTest(function(win) {
for (var prop in window) { for (var prop in window) {
if (windowWhitelists.props.indexOf(prop) != -1) { if (windowAllowlists.props.indexOf(prop) != -1) {
win[prop]; // Shouldn't throw. win[prop]; // Shouldn't throw.
Object.getOwnPropertyDescriptor(win, prop); // Shouldn't throw. Object.getOwnPropertyDescriptor(win, prop); // Shouldn't throw.
assert_true(Object.prototype.hasOwnProperty.call(win, prop), "hasOwnProperty for " + String(prop)); assert_true(Object.prototype.hasOwnProperty.call(win, prop), "hasOwnProperty for " + String(prop));
@ -230,7 +230,7 @@ addTest(function(win) {
if (prop != 'location') if (prop != 'location')
assert_throws("SecurityError", function() { win[prop] = undefined; }, "Should throw when writing to " + prop + " on Window"); assert_throws("SecurityError", function() { win[prop] = undefined; }, "Should throw when writing to " + prop + " on Window");
} }
for (var prop of windowWhitelists.namedFrames) { for (var prop of windowAllowlists.namedFrames) {
win[prop]; // Shouldn't throw. win[prop]; // Shouldn't throw.
Object.getOwnPropertyDescriptor(win, prop); // Shouldn't throw. Object.getOwnPropertyDescriptor(win, prop); // Shouldn't throw.
assert_true(Object.prototype.hasOwnProperty.call(win, prop), "hasOwnProperty for " + String(prop)); assert_true(Object.prototype.hasOwnProperty.call(win, prop), "hasOwnProperty for " + String(prop));
@ -257,10 +257,10 @@ addTest(function(win) {
assert_throws("SecurityError", function() { win.location[prop] = undefined; }, "Should throw when writing to " + prop + " on Location"); assert_throws("SecurityError", function() { win.location[prop] = undefined; }, "Should throw when writing to " + prop + " on Location");
} }
} }
}, "Only whitelisted properties are accessible cross-origin"); }, "Only certain properties are accessible cross-origin");
addPromiseTest(async function(win, test_obj) { addPromiseTest(async function(win, test_obj) {
async function checkProperties(objName, whitelists) { async function checkProperties(objName, allowedlists) {
var localObj = window[objName]; var localObj = window[objName];
var otherObj = win[objName]; var otherObj = win[objName];
@ -273,10 +273,10 @@ addPromiseTest(async function(win, test_obj) {
if ("value" in desc) { if ("value" in desc) {
if (typeof desc.value === "function" && String(desc.value).includes("[native code]")) { if (typeof desc.value === "function" && String(desc.value).includes("[native code]")) {
if (whitelists.promiseMethods.includes(prop)) { if (allowedlists.promiseMethods.includes(prop)) {
await promise_rejects(test_obj, "SecurityError", desc.value.call(otherObj), await promise_rejects(test_obj, "SecurityError", desc.value.call(otherObj),
`Should throw when calling ${objName}.${prop} with cross-origin this object`); `Should throw when calling ${objName}.${prop} with cross-origin this object`);
} else if (!whitelists.methods.includes(prop)) { } else if (!allowedlists.methods.includes(prop)) {
for (let args of methodArgs.get(prop) || [[]]) { for (let args of methodArgs.get(prop) || [[]]) {
assert_throws("SecurityError", desc.value.bind(otherObj, ...args), assert_throws("SecurityError", desc.value.bind(otherObj, ...args),
`Should throw when calling ${objName}.${prop} with cross-origin this object`); `Should throw when calling ${objName}.${prop} with cross-origin this object`);
@ -290,7 +290,7 @@ addPromiseTest(async function(win, test_obj) {
} }
} else { } else {
if (desc.get) { if (desc.get) {
if (whitelists.getters.includes(prop)) { if (allowedlists.getters.includes(prop)) {
desc.get.call(otherObj); // Shouldn't throw. desc.get.call(otherObj); // Shouldn't throw.
} else { } else {
assert_throws("SecurityError", desc.get.bind(otherObj), assert_throws("SecurityError", desc.get.bind(otherObj),
@ -298,7 +298,7 @@ addPromiseTest(async function(win, test_obj) {
} }
} }
if (desc.set) { if (desc.set) {
if (whitelists.setters.includes(prop)) { if (allowedlists.setters.includes(prop)) {
desc.set.call(otherObj, "javascript:undefined"); // Shouldn't throw. desc.set.call(otherObj, "javascript:undefined"); // Shouldn't throw.
} else { } else {
assert_throws("SecurityError", desc.set.bind(otherObj, "foo"), assert_throws("SecurityError", desc.set.bind(otherObj, "foo"),
@ -309,9 +309,9 @@ addPromiseTest(async function(win, test_obj) {
} }
} }
await checkProperties("location", locationWhitelists); await checkProperties("location", locationAllowlists);
await checkProperties("window", windowWhitelists); await checkProperties("window", windowAllowlists);
}, "Only whitelisted properties are usable as cross-origin this objects"); }, "Only certain properties are usable as cross-origin this objects");
/* /*
* ES Internal Methods. * ES Internal Methods.
@ -341,8 +341,8 @@ addTest(function(win) {
if (Object.setPrototypeOf) if (Object.setPrototypeOf)
setters.push(function(p) { Object.setPrototypeOf(this, p); }); setters.push(function(p) { Object.setPrototypeOf(this, p); });
setters.forEach(function(protoSetter) { setters.forEach(function(protoSetter) {
assert_throws(new TypeError, function() { protoSetter.call(win, new Object()); }, "proto setter |call| on cross-origin Window"); assert_throws_js(TypeError, function() { protoSetter.call(win, new Object()); }, "proto setter |call| on cross-origin Window");
assert_throws(new TypeError, function() { protoSetter.call(win.location, new Object()); }, "proto setter |call| on cross-origin Location"); assert_throws_js(TypeError, function() { protoSetter.call(win.location, new Object()); }, "proto setter |call| on cross-origin Location");
}); });
// Hack to avoid "duplicate test name" harness issues. // Hack to avoid "duplicate test name" harness issues.
setters.forEach(function(protoSetter) { setters.forEach(function(protoSetter) {
@ -375,9 +375,9 @@ addTest(function(win) {
* [[PreventExtensions]] * [[PreventExtensions]]
*/ */
addTest(function(win) { addTest(function(win) {
assert_throws(new TypeError, function() { Object.preventExtensions(win) }, assert_throws_js(TypeError, function() { Object.preventExtensions(win) },
"preventExtensions on cross-origin Window should throw"); "preventExtensions on cross-origin Window should throw");
assert_throws(new TypeError, function() { Object.preventExtensions(win.location) }, assert_throws_js(TypeError, function() { Object.preventExtensions(win.location) },
"preventExtensions on cross-origin Location should throw"); "preventExtensions on cross-origin Location should throw");
}, "[[PreventExtensions]] should throw for cross-origin objects"); }, "[[PreventExtensions]] should throw for cross-origin objects");
@ -418,14 +418,14 @@ function checkPropertyDescriptor(desc, propName, expectWritable) {
} }
addTest(function(win) { addTest(function(win) {
windowWhitelists.props.forEach(function(prop) { windowAllowlists.props.forEach(function(prop) {
var desc = Object.getOwnPropertyDescriptor(win, prop); var desc = Object.getOwnPropertyDescriptor(win, prop);
checkPropertyDescriptor(desc, prop, prop == 'location'); checkPropertyDescriptor(desc, prop, prop == 'location');
}); });
checkPropertyDescriptor(Object.getOwnPropertyDescriptor(win.location, 'replace'), 'replace', false); checkPropertyDescriptor(Object.getOwnPropertyDescriptor(win.location, 'replace'), 'replace', false);
checkPropertyDescriptor(Object.getOwnPropertyDescriptor(win.location, 'href'), 'href', true); checkPropertyDescriptor(Object.getOwnPropertyDescriptor(win.location, 'href'), 'href', true);
assert_equals(typeof Object.getOwnPropertyDescriptor(win.location, 'href').get, 'undefined', "Cross-origin location should have no href getter"); assert_equals(typeof Object.getOwnPropertyDescriptor(win.location, 'href').get, 'undefined', "Cross-origin location should have no href getter");
whitelistedSymbols.forEach(function(prop) { allowedSymbols.forEach(function(prop) {
var desc = Object.getOwnPropertyDescriptor(win.location, prop); var desc = Object.getOwnPropertyDescriptor(win.location, prop);
checkPropertyDescriptor(desc, prop, false); checkPropertyDescriptor(desc, prop, false);
}); });
@ -494,9 +494,9 @@ addTest(function(win) {
let i = 0; let i = 0;
for (var prop in win) { for (var prop in win) {
i++; i++;
assert_true(windowWhitelists.indices.includes(prop), prop + " is not safelisted for a cross-origin Window"); assert_true(windowAllowlists.indices.includes(prop), prop + " is not safelisted for a cross-origin Window");
} }
assert_equals(i, windowWhitelists.indices.length, "Enumerate all enumerable safelisted cross-origin Window properties"); assert_equals(i, windowAllowlists.indices.length, "Enumerate all enumerable safelisted cross-origin Window properties");
i = 0; i = 0;
for (var prop in win.location) { for (var prop in win.location) {
i++; i++;
@ -510,48 +510,48 @@ addTest(function(win) {
addTest(function(win) { addTest(function(win) {
assert_array_equals(Object.getOwnPropertyNames(win).sort(), assert_array_equals(Object.getOwnPropertyNames(win).sort(),
windowWhitelists.propNames, windowAllowlists.propNames,
"Object.getOwnPropertyNames() gives the right answer for cross-origin Window"); "Object.getOwnPropertyNames() gives the right answer for cross-origin Window");
assert_array_equals(Object.keys(win).sort(), assert_array_equals(Object.keys(win).sort(),
windowWhitelists.indices, windowAllowlists.indices,
"Object.keys() gives the right answer for cross-origin Window"); "Object.keys() gives the right answer for cross-origin Window");
assert_array_equals(Object.getOwnPropertyNames(win.location).sort(), assert_array_equals(Object.getOwnPropertyNames(win.location).sort(),
locationWhitelists.propNames, locationAllowlists.propNames,
"Object.getOwnPropertyNames() gives the right answer for cross-origin Location"); "Object.getOwnPropertyNames() gives the right answer for cross-origin Location");
assert_equals(Object.keys(win.location).length, 0, assert_equals(Object.keys(win.location).length, 0,
"Object.keys() gives the right answer for cross-origin Location"); "Object.keys() gives the right answer for cross-origin Location");
}, "[[OwnPropertyKeys]] should return all properties from cross-origin objects"); }, "[[OwnPropertyKeys]] should return all properties from cross-origin objects");
addTest(function(win) { addTest(function(win) {
assert_array_equals(Object.getOwnPropertySymbols(win), whitelistedSymbols, assert_array_equals(Object.getOwnPropertySymbols(win), allowedSymbols,
"Object.getOwnPropertySymbols() should return the three symbol-named properties that are exposed on a cross-origin Window"); "Object.getOwnPropertySymbols() should return the three symbol-named properties that are exposed on a cross-origin Window");
assert_array_equals(Object.getOwnPropertySymbols(win.location), assert_array_equals(Object.getOwnPropertySymbols(win.location),
whitelistedSymbols, allowedSymbols,
"Object.getOwnPropertySymbols() should return the three symbol-named properties that are exposed on a cross-origin Location"); "Object.getOwnPropertySymbols() should return the three symbol-named properties that are exposed on a cross-origin Location");
}, "[[OwnPropertyKeys]] should return the right symbol-named properties for cross-origin objects"); }, "[[OwnPropertyKeys]] should return the right symbol-named properties for cross-origin objects");
addTest(function(win) { addTest(function(win) {
var allWindowProps = Reflect.ownKeys(win); var allWindowProps = Reflect.ownKeys(win);
indexedWindowProps = allWindowProps.slice(0, windowWhitelists.indices.length); indexedWindowProps = allWindowProps.slice(0, windowAllowlists.indices.length);
stringWindowProps = allWindowProps.slice(0, -1 * whitelistedSymbols.length); stringWindowProps = allWindowProps.slice(0, -1 * allowedSymbols.length);
symbolWindowProps = allWindowProps.slice(-1 * whitelistedSymbols.length); symbolWindowProps = allWindowProps.slice(-1 * allowedSymbols.length);
// stringWindowProps should have "then" last in this case. Do this // stringWindowProps should have "then" last in this case. Do this
// check before we call stringWindowProps.sort() below. // check before we call stringWindowProps.sort() below.
assert_equals(stringWindowProps[stringWindowProps.length - 1], "then", assert_equals(stringWindowProps[stringWindowProps.length - 1], "then",
"'then' property should be added to the end of the string list if not there"); "'then' property should be added to the end of the string list if not there");
assert_array_equals(indexedWindowProps, windowWhitelists.indices, assert_array_equals(indexedWindowProps, windowAllowlists.indices,
"Reflect.ownKeys should start with the indices exposed on the cross-origin window."); "Reflect.ownKeys should start with the indices exposed on the cross-origin window.");
assert_array_equals(stringWindowProps.sort(), windowWhitelists.propNames, assert_array_equals(stringWindowProps.sort(), windowAllowlists.propNames,
"Reflect.ownKeys should continue with the cross-origin window properties for a cross-origin Window."); "Reflect.ownKeys should continue with the cross-origin window properties for a cross-origin Window.");
assert_array_equals(symbolWindowProps, whitelistedSymbols, assert_array_equals(symbolWindowProps, allowedSymbols,
"Reflect.ownKeys should end with the cross-origin symbols for a cross-origin Window."); "Reflect.ownKeys should end with the cross-origin symbols for a cross-origin Window.");
var allLocationProps = Reflect.ownKeys(win.location); var allLocationProps = Reflect.ownKeys(win.location);
stringLocationProps = allLocationProps.slice(0, -1 * whitelistedSymbols.length); stringLocationProps = allLocationProps.slice(0, -1 * allowedSymbols.length);
symbolLocationProps = allLocationProps.slice(-1 * whitelistedSymbols.length); symbolLocationProps = allLocationProps.slice(-1 * allowedSymbols.length);
assert_array_equals(stringLocationProps.sort(), locationWhitelists.propNames, assert_array_equals(stringLocationProps.sort(), locationAllowlists.propNames,
"Reflect.ownKeys should start with the cross-origin window properties for a cross-origin Location.") "Reflect.ownKeys should start with the cross-origin window properties for a cross-origin Location.")
assert_array_equals(symbolLocationProps, whitelistedSymbols, assert_array_equals(symbolLocationProps, allowedSymbols,
"Reflect.ownKeys should end with the cross-origin symbols for a cross-origin Location.") "Reflect.ownKeys should end with the cross-origin symbols for a cross-origin Location.")
}, "[[OwnPropertyKeys]] should place the symbols after the property names after the subframe indices"); }, "[[OwnPropertyKeys]] should place the symbols after the property names after the subframe indices");

View file

@ -131,4 +131,26 @@ promise_test(async t => {
promise_test(t => { promise_test(t => {
return promise_rejects(t, new TypeError(), fetch(get_host_info().HTTPS_REMOTE_ORIGIN+"/common/blank.html", {mode: "no-cors"})); return promise_rejects(t, new TypeError(), fetch(get_host_info().HTTPS_REMOTE_ORIGIN+"/common/blank.html", {mode: "no-cors"}));
}, `"require-corp" top-level: fetch() to response without CORP should fail`); }, `"require-corp" top-level: fetch() to response without CORP should fail`);
promise_test(t => {
const w = window.open();
return promise_rejects(t, new TypeError(), w.fetch(get_host_info().HTTPS_REMOTE_ORIGIN+"/common/blank.html", {mode: "no-cors"}));
}, `"require-corp" top-level: fetch() to response without CORP through a WindowProxy should fail`);
async_test(t => {
let w = window.open();
const frame = w.document.createElement("iframe");
t.add_cleanup(() => w.close());
t.step_timeout(() => {
// Make sure the iframe didn't load. See
// https://github.com/whatwg/html/issues/125 for why a timeout is
// used here. Long term all network error handling should be similar
// and have a reliable event.
assert_equals(frame.contentDocument, null);
t.done();
}, 500);
frame.src = "/common/blank.html";
document.body.append(frame);
assert_equals(frame.contentDocument.body.localName, "body");
}, `"require-corp" top-level: navigating an iframe to a page without CORP, through a WindowProxy, should fail`);
</script> </script>

View file

@ -160,7 +160,7 @@ test(function() {
test(function() { test(function() {
assert_equals(document.all.namedItem.length, 1); assert_equals(document.all.namedItem.length, 1);
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
document.all.namedItem(); document.all.namedItem();
}); });
}, "namedItem method with no argument"); }, "namedItem method with no argument");

View file

@ -0,0 +1,33 @@
<!DOCTYPE html>
<title>HTML Test: The style load event should fire when textContent is changed</title>
<link rel="author" title="Mason Freed" href="mailto:masonfreed@chromium.org">
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#update-a-style-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style id=target onload="load()">
.box { color:red; }
</style>
<div class='box'></div>
<div id="log"></div>
<script>
var loadCount = 0;
function load() { loadCount++; }
function styleLoad() {
return new Promise((resolve) => {
document.getElementById('target').addEventListener('load', () => {
resolve();
});
});
}
promise_test(async t => {
await styleLoad();
assert_equals(loadCount,1,"Style element should have loaded once by now");
target.textContent = `.box { color: green; }`;
await styleLoad();
assert_equals(loadCount,2,"Style element should fire the load event when textContent changes");
},"style load event should fire when textContent changed");
</script>

View file

@ -52,7 +52,7 @@
// to the new value; if the new value is the string "auto", // to the new value; if the new value is the string "auto",
// then it must be interpreted as the special value auto. // then it must be interpreted as the special value auto.
assert_equals(textCue.line, "auto"); assert_equals(textCue.line, "auto");
assert_throws(new TypeError, function() { textCue.line = "gazonk"; }); assert_throws_js(TypeError, function() { textCue.line = "gazonk"; });
assert_equals(textCue.line, "auto"); assert_equals(textCue.line, "auto");
textCue.line = 42; textCue.line = 42;
assert_equals(textCue.line, 42); assert_equals(textCue.line, 42);

View file

@ -67,7 +67,8 @@ interface IDBDatabase : EventTarget {
readonly attribute DOMStringList objectStoreNames; readonly attribute DOMStringList objectStoreNames;
[NewObject] IDBTransaction transaction((DOMString or sequence<DOMString>) storeNames, [NewObject] IDBTransaction transaction((DOMString or sequence<DOMString>) storeNames,
optional IDBTransactionMode mode = "readonly"); optional IDBTransactionMode mode = "readonly",
optional IDBTransactionOptions options = {});
void close(); void close();
[NewObject] IDBObjectStore createObjectStore( [NewObject] IDBObjectStore createObjectStore(
@ -82,6 +83,12 @@ interface IDBDatabase : EventTarget {
attribute EventHandler onversionchange; attribute EventHandler onversionchange;
}; };
enum IDBTransactionDurability { "default", "strict", "relaxed" };
dictionary IDBTransactionOptions {
IDBTransactionDurability durability = "default";
};
dictionary IDBObjectStoreParameters { dictionary IDBObjectStoreParameters {
(DOMString or sequence<DOMString>)? keyPath = null; (DOMString or sequence<DOMString>)? keyPath = null;
boolean autoIncrement = false; boolean autoIncrement = false;

View file

@ -0,0 +1,92 @@
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into reffy-reports
// (https://github.com/tidoust/reffy-reports)
// Source: Native File System (https://wicg.github.io/native-file-system/)
dictionary FileSystemHandlePermissionDescriptor {
boolean writable = false;
};
[Exposed=(Window,Worker), SecureContext, Serializable]
interface FileSystemHandle {
readonly attribute boolean isFile;
readonly attribute boolean isDirectory;
readonly attribute USVString name;
Promise<PermissionState> queryPermission(optional FileSystemHandlePermissionDescriptor descriptor = {});
Promise<PermissionState> requestPermission(optional FileSystemHandlePermissionDescriptor descriptor = {});
};
dictionary FileSystemCreateWriterOptions {
boolean keepExistingData = false;
};
[Exposed=(Window,Worker), SecureContext, Serializable]
interface FileSystemFileHandle : FileSystemHandle {
Promise<File> getFile();
Promise<FileSystemWriter> createWriter(optional FileSystemCreateWriterOptions options = {});
};
dictionary FileSystemGetFileOptions {
boolean create = false;
};
dictionary FileSystemGetDirectoryOptions {
boolean create = false;
};
dictionary FileSystemRemoveOptions {
boolean recursive = false;
};
[Exposed=(Window,Worker), SecureContext, Serializable]
interface FileSystemDirectoryHandle : FileSystemHandle {
Promise<FileSystemFileHandle> getFile(USVString name, optional FileSystemGetFileOptions options = {});
Promise<FileSystemDirectoryHandle> getDirectory(USVString name, optional FileSystemGetDirectoryOptions options = {});
// This really returns an async iterable, but that is not yet expressable in WebIDL.
object getEntries();
Promise<void> removeEntry(USVString name, optional FileSystemRemoveOptions options = {});
};
[Exposed=(Window,Worker), SecureContext]
interface FileSystemWriter {
Promise<void> write(unsigned long long position, (BufferSource or Blob or USVString) data);
Promise<void> truncate(unsigned long long size);
Promise<void> close();
};
enum ChooseFileSystemEntriesType { "open-file", "save-file", "open-directory" };
dictionary ChooseFileSystemEntriesOptionsAccepts {
USVString description;
sequence<USVString> mimeTypes;
sequence<USVString> extensions;
};
dictionary ChooseFileSystemEntriesOptions {
ChooseFileSystemEntriesType type = "open-file";
boolean multiple = false;
sequence<ChooseFileSystemEntriesOptionsAccepts> accepts;
boolean excludeAcceptAllOption = false;
};
[SecureContext]
partial interface Window {
Promise<(FileSystemHandle or sequence<FileSystemHandle>)>
chooseFileSystemEntries(optional ChooseFileSystemEntriesOptions options = {});
};
enum SystemDirectoryType {
"sandbox"
};
dictionary GetSystemDirectoryOptions {
required SystemDirectoryType type;
};
[SecureContext]
partial interface FileSystemDirectoryHandle {
static Promise<FileSystemDirectoryHandle> getSystemDirectory(GetSystemDirectoryOptions options);
};

View file

@ -28,18 +28,16 @@ iframe.onload = function() {
runTestCycle(function() { runTestCycle(function() {
assert_true(!!iframe, "iframe exists"); assert_true(!!iframe, "iframe exists");
root = iframe.contentDocument.scrollingElement;
assert_true(!!root, "Root element exists.");
target = iframe.contentDocument.getElementById("target"); target = iframe.contentDocument.getElementById("target");
assert_true(!!target, "Target element exists."); assert_true(!!target, "Target element exists.");
var observer = new IntersectionObserver(function(changes) { var observer = new IntersectionObserver(function(changes) {
entries = entries.concat(changes) entries = entries.concat(changes)
}, { root: root }); }, { root: iframe.contentDocument });
observer.observe(target); observer.observe(target);
entries = entries.concat(observer.takeRecords()); entries = entries.concat(observer.takeRecords());
assert_equals(entries.length, 0, "No initial notifications."); assert_equals(entries.length, 0, "No initial notifications.");
runTestCycle(step0, "First rAF."); runTestCycle(step0, "First rAF.");
}, "Observer with explicit root which is the document's scrolling element."); }, "Observer with explicit root which is the document.");
}; };
function step0() { function step0() {

View file

@ -6,26 +6,26 @@
<div id="log"></div> <div id="log"></div>
<script> <script>
test(function() { test(function() {
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
Object.setPrototypeOf(window, window); Object.setPrototypeOf(window, window);
}, "Setting the prototype should throw"); }, "Setting the prototype should throw");
}, "Setting the prototype of a window to itself via setPrototypeOf"); }, "Setting the prototype of a window to itself via setPrototypeOf");
test(function() { test(function() {
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
window.__proto__ = window; window.__proto__ = window;
}, "Setting the prototype should throw"); }, "Setting the prototype should throw");
}, "Setting the prototype of a window to itself via __proto__"); }, "Setting the prototype of a window to itself via __proto__");
test(function() { test(function() {
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
Object.setPrototypeOf(window, Object.create(window)); Object.setPrototypeOf(window, Object.create(window));
}, "Setting the prototype should throw"); }, "Setting the prototype should throw");
}, "Setting the prototype of a window to something that has the window on " + }, "Setting the prototype of a window to something that has the window on " +
"its proto chain via setPrototypeOf"); "its proto chain via setPrototypeOf");
test(function() { test(function() {
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
window.__proto__ = Object.create(window); window.__proto__ = Object.create(window);
}, "Setting the prototype should throw"); }, "Setting the prototype should throw");
}, "Setting the prototype of a window to something that has the window on " + }, "Setting the prototype of a window to something that has the window on " +

View file

@ -21,7 +21,7 @@
test.waitForExpectedEvents(function() test.waitForExpectedEvents(function()
{ {
if (expectedError) { if (expectedError) {
assert_throws(expectedError, assert_throws_js(expectedError,
function() { mediaSource.duration = testDurationValue; }, function() { mediaSource.duration = testDurationValue; },
"mediaSource.duration assignment throws an exception for " + testDurationValue); "mediaSource.duration assignment throws an exception for " + testDurationValue);
test.done(); test.done();
@ -50,14 +50,14 @@
DurationBoundaryConditionTest(Number.MAX_VALUE, null, "Set duration to Number.MAX_VALUE"); DurationBoundaryConditionTest(Number.MAX_VALUE, null, "Set duration to Number.MAX_VALUE");
DurationBoundaryConditionTest(Number.MIN_VALUE, null, "Set duration to Number.MIN_VALUE"); DurationBoundaryConditionTest(Number.MIN_VALUE, null, "Set duration to Number.MIN_VALUE");
DurationBoundaryConditionTest(Number.MAX_VALUE - 1, null, "Set duration to Number.MAX_VALUE - 1"); DurationBoundaryConditionTest(Number.MAX_VALUE - 1, null, "Set duration to Number.MAX_VALUE - 1");
DurationBoundaryConditionTest(Number.MIN_VALUE - 1, new TypeError(), "Set duration to Number.MIN_VALUE - 1"); DurationBoundaryConditionTest(Number.MIN_VALUE - 1, TypeError, "Set duration to Number.MIN_VALUE - 1");
DurationBoundaryConditionTest(Number.POSITIVE_INFINITY, null, "Set duration to Number.POSITIVE_INFINITY"); DurationBoundaryConditionTest(Number.POSITIVE_INFINITY, null, "Set duration to Number.POSITIVE_INFINITY");
DurationBoundaryConditionTest(Number.NEGATIVE_INFINITY, new TypeError(), "Set duration to Number.NEGATIVE_INFINITY"); DurationBoundaryConditionTest(Number.NEGATIVE_INFINITY, TypeError, "Set duration to Number.NEGATIVE_INFINITY");
DurationBoundaryConditionTest(-1 * Number.MAX_VALUE, new TypeError(), "Set duration to lowest value."); DurationBoundaryConditionTest(-1 * Number.MAX_VALUE, TypeError, "Set duration to lowest value.");
DurationBoundaryConditionTest(-101.9, new TypeError(), "Set duration to a negative double."); DurationBoundaryConditionTest(-101.9, TypeError, "Set duration to a negative double.");
DurationBoundaryConditionTest(101.9, null, "Set duration to a positive double."); DurationBoundaryConditionTest(101.9, null, "Set duration to a positive double.");
DurationBoundaryConditionTest(0, null, "Set duration to zero"); DurationBoundaryConditionTest(0, null, "Set duration to zero");
DurationBoundaryConditionTest(NaN, new TypeError(), "Set duration to NaN"); DurationBoundaryConditionTest(NaN, TypeError, "Set duration to NaN");
</script> </script>
</body> </body>
</html> </html>

View file

@ -6,25 +6,25 @@
<script> <script>
test(function() { test(function() {
assert_equals(BlobEvent.length, 2); assert_equals(BlobEvent.length, 2);
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new BlobEvent("type"); new BlobEvent("type");
}); });
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new BlobEvent("type", null); new BlobEvent("type", null);
}); });
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new BlobEvent("type", undefined); new BlobEvent("type", undefined);
}); });
}, "The BlobEventInit dictionary is required"); }, "The BlobEventInit dictionary is required");
test(function() { test(function() {
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new BlobEvent("type", {}); new BlobEvent("type", {});
}); });
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new BlobEvent("type", { data: null }); new BlobEvent("type", { data: null });
}); });
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new BlobEvent("type", { data: undefined }); new BlobEvent("type", { data: undefined });
}); });
}, "The BlobEventInit dictionary's data member is required."); }, "The BlobEventInit dictionary's data member is required.");

View file

@ -6,25 +6,25 @@
<script> <script>
test(function() { test(function() {
assert_equals(MediaStreamTrackEvent.length, 2); assert_equals(MediaStreamTrackEvent.length, 2);
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new MediaStreamTrackEvent("type"); new MediaStreamTrackEvent("type");
}); });
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new MediaStreamTrackEvent("type", null); new MediaStreamTrackEvent("type", null);
}); });
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new MediaStreamTrackEvent("type", undefined); new MediaStreamTrackEvent("type", undefined);
}); });
}, "The eventInitDict argument is required"); }, "The eventInitDict argument is required");
test(function() { test(function() {
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new MediaStreamTrackEvent("type", {}); new MediaStreamTrackEvent("type", {});
}); });
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new MediaStreamTrackEvent("type", { track: null }); new MediaStreamTrackEvent("type", { track: null });
}); });
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new MediaStreamTrackEvent("type", { track: undefined }); new MediaStreamTrackEvent("type", { track: undefined });
}); });
}, "The eventInitDict's track member is required."); }, "The eventInitDict's track member is required.");

View file

@ -42,8 +42,8 @@ test(() => {
}, 'Test setPositionState with zero duration'); }, 'Test setPositionState with zero duration');
test(() => { test(() => {
assert_throws( assert_throws_js(
new TypeError, TypeError,
_ => { _ => {
window.navigator.mediaSession.setPositionState({ window.navigator.mediaSession.setPositionState({
duration: 60.9, duration: 60.9,
@ -54,8 +54,8 @@ test(() => {
}, 'Test setPositionState throws a TypeError if playback rate is negative'); }, 'Test setPositionState throws a TypeError if playback rate is negative');
test(() => { test(() => {
assert_throws( assert_throws_js(
new TypeError, TypeError,
_ => { _ => {
window.navigator.mediaSession.setPositionState({ window.navigator.mediaSession.setPositionState({
duration: -1 duration: -1
@ -64,8 +64,8 @@ test(() => {
}, 'Test setPositionState throws a TypeError if duration is negative'); }, 'Test setPositionState throws a TypeError if duration is negative');
test(() => { test(() => {
assert_throws( assert_throws_js(
new TypeError, TypeError,
_ => { _ => {
window.navigator.mediaSession.setPositionState({ window.navigator.mediaSession.setPositionState({
duration: 10, duration: 10,
@ -75,8 +75,8 @@ test(() => {
}, 'Test setPositionState throws a TypeError if position is negative'); }, 'Test setPositionState throws a TypeError if position is negative');
test(() => { test(() => {
assert_throws( assert_throws_js(
new TypeError, TypeError,
_ => { _ => {
window.navigator.mediaSession.setPositionState({ window.navigator.mediaSession.setPositionState({
duration: 10, duration: 10,
@ -86,8 +86,8 @@ test(() => {
}, 'Test setPositionState throws a TypeError if duration is less than position'); }, 'Test setPositionState throws a TypeError if duration is less than position');
test(() => { test(() => {
assert_throws( assert_throws_js(
new TypeError, TypeError,
_ => { _ => {
window.navigator.mediaSession.setPositionState({ window.navigator.mediaSession.setPositionState({
duration: 60.9, duration: 60.9,
@ -98,8 +98,8 @@ test(() => {
}, 'Test setPositionState throws a TypeError if playback rate is zero'); }, 'Test setPositionState throws a TypeError if playback rate is zero');
test(() => { test(() => {
assert_throws( assert_throws_js(
new TypeError, TypeError,
_ => { _ => {
window.navigator.mediaSession.setPositionState({ window.navigator.mediaSession.setPositionState({
position: 10.1, position: 10.1,

View file

@ -16,8 +16,8 @@ test(function(t) {
}, "Test that setActionHandler() can be executed for supported actions"); }, "Test that setActionHandler() can be executed for supported actions");
test(function(t) { test(function(t) {
assert_throws( assert_throws_js(
new TypeError, TypeError,
_ => { window.navigator.mediaSession.setActionHandler("invalid", null); }); _ => { window.navigator.mediaSession.setActionHandler("invalid", null); });
}, "Test that setActionHandler() throws exception for unsupported actions"); }, "Test that setActionHandler() throws exception for unsupported actions");

View file

@ -0,0 +1,15 @@
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
'use strict';
idl_test(
['native-file-system'],
['html', 'dom'],
idl_array => {
idl_array.add_objects({
// TODO: Add instances of FileSystemHandle, FileSystemFileHandle,
// FileSystemDirectoryHandle and FileSystemWriter.
});
}
);

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,11 @@
function TestCase(scenario, testDescription, sanityChecker) {
// This check is A NOOP in release.
sanityChecker.checkScenario(scenario);
return {
start: () => runLengthTest(
scenario,
4096 + 1,
"origin",
"`Referer` header with length > 4k is stripped to an origin.")
};
}

View file

@ -0,0 +1,40 @@
{
"excluded_tests": [
{
"name": "expectation=stripped-referrer only",
"expansion": "*",
"source_scheme": "*",
"source_context_list": "*",
"redirection": "*",
"delivery_type": "*",
"delivery_value": "*",
"origin": "*",
"subresource": "*",
"expectation": [
"omitted",
"origin"
]
},
{
"name": "Only on the top context",
"expansion": "*",
"source_scheme": "*",
"source_context_list": [
"req",
"srcdoc-inherit",
"srcdoc",
"iframe",
"worker-classic",
"worker-classic-data",
"worker-module",
"worker-module-data"
],
"redirection": "*",
"delivery_type": "*",
"delivery_value": "*",
"origin": "*",
"subresource": "*",
"expectation": "*"
}
]
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,11 @@
function TestCase(scenario, testDescription, sanityChecker) {
// This check is A NOOP in release.
sanityChecker.checkScenario(scenario);
return {
start: () => runLengthTest(
scenario,
4096 - 1,
scenario.expectation,
"`Referer` header with length < 4k is not stripped to an origin.")
};
}

View file

@ -0,0 +1,40 @@
{
"excluded_tests": [
{
"name": "expectation=stripped-referrer only",
"expansion": "*",
"source_scheme": "*",
"source_context_list": "*",
"redirection": "*",
"delivery_type": "*",
"delivery_value": "*",
"origin": "*",
"subresource": "*",
"expectation": [
"omitted",
"origin"
]
},
{
"name": "Only on the top context",
"expansion": "*",
"source_scheme": "*",
"source_context_list": [
"req",
"srcdoc-inherit",
"srcdoc",
"iframe",
"worker-classic",
"worker-classic-data",
"worker-module",
"worker-module-data"
],
"redirection": "*",
"delivery_type": "*",
"delivery_value": "*",
"origin": "*",
"subresource": "*",
"expectation": "*"
}
]
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,11 @@
function TestCase(scenario, testDescription, sanityChecker) {
// This check is A NOOP in release.
sanityChecker.checkScenario(scenario);
return {
start: () => runLengthTest(
scenario,
4096,
scenario.expectation,
"`Referer` header with length == 4k is not stripped to an origin.")
};
}

View file

@ -0,0 +1,40 @@
{
"excluded_tests": [
{
"name": "expectation=stripped-referrer only",
"expansion": "*",
"source_scheme": "*",
"source_context_list": "*",
"redirection": "*",
"delivery_type": "*",
"delivery_value": "*",
"origin": "*",
"subresource": "*",
"expectation": [
"omitted",
"origin"
]
},
{
"name": "Only on the top context",
"expansion": "*",
"source_scheme": "*",
"source_context_list": [
"req",
"srcdoc-inherit",
"srcdoc",
"iframe",
"worker-classic",
"worker-classic-data",
"worker-module",
"worker-module-data"
],
"redirection": "*",
"delivery_type": "*",
"delivery_value": "*",
"origin": "*",
"subresource": "*",
"expectation": "*"
}
]
}

View file

@ -22,10 +22,6 @@ function invokeScenario(scenario) {
return invokeRequest(subresource, scenario.source_context_list); return invokeRequest(subresource, scenario.source_context_list);
} }
function TestCase(scenario, testDescription, sanityChecker) {
// This check is A NOOP in release.
sanityChecker.checkScenario(scenario);
const referrerUrlResolver = { const referrerUrlResolver = {
"omitted": function(sourceUrl) { "omitted": function(sourceUrl) {
return undefined; return undefined;
@ -38,7 +34,7 @@ function TestCase(scenario, testDescription, sanityChecker) {
} }
}; };
const checkResult = (expectation, result) => { function checkResult(scenario, expectation, result) {
// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
let referrerSource = result.sourceContextUrl; let referrerSource = result.sourceContextUrl;
const sentFromSrcdoc = scenario.source_context_list.length > 0 && const sentFromSrcdoc = scenario.source_context_list.length > 0 &&
@ -68,64 +64,35 @@ function TestCase(scenario, testDescription, sanityChecker) {
expectedReferrerUrl, expectedReferrerUrl,
"Reported Referrer URL from HTTP header is '" + "Reported Referrer URL from HTTP header is '" +
expectedReferrerUrl + "'"); expectedReferrerUrl + "'");
};
function runTest() {
function historyBackPromise(t, scenario) {
history.back();
return new Promise(resolve => {
// Wait for completion of `history.back()` by listening the
// popstate events that are fired near the end of
// `history.back()` processing.
window.addEventListener('popstate', resolve, {once: true});
// Workaround for Safari: Waiting for popstate events causes
// timeout in a-tag tests. To avoid timeout, we anyway resolve
// the promise.
if (scenario.subresource === 'a-tag') {
t.step_timeout(resolve, 1000);
}
});
} }
promise_test(_ => { function runLengthTest(scenario, urlLength, expectation, testDescription) {
return invokeScenario(scenario)
.then(result => checkResult(scenario.expectation, result));
}, testDescription);
// `Referer` headers with length over 4k are culled down to an origin, so, // `Referer` headers with length over 4k are culled down to an origin, so,
// let's test around that boundary for tests that would otherwise return // let's test around that boundary for tests that would otherwise return
// the complete URL. // the complete URL.
// The following tests run only on top-level Documents, because they rely
// on navigations using `history`.
// Different subresource URLs are used because getRequestURLs() is called
// for each sub test which returns a unique URL.
if (scenario.expectation == "stripped-referrer" &&
scenario.source_context_list.length == 0) {
promise_test(t => {
history.pushState(null, null, "/"); history.pushState(null, null, "/");
history.replaceState(null, null, "A".repeat(4096 - location.href.length - 1)); history.replaceState(null, null,
return invokeScenario(scenario) "A".repeat(urlLength - location.href.length));
.then(result => checkResult(scenario.expectation, result))
.finally(_ => historyBackPromise(t, scenario));
}, "`Referer` header with length < 4k is not stripped to an origin.");
promise_test(t => { promise_test(t => {
history.pushState(null, null, "/"); assert_equals(scenario.expectation, "stripped-referrer");
history.replaceState(null, null, "A".repeat(4096 - location.href.length)); // Only on top-level Window, due to navigations using `history`.
return invokeScenario(scenario) assert_equals(scenario.source_context_list.length, 0);
.then(result => checkResult(scenario.expectation, result))
.finally(_ => historyBackPromise(t, scenario));
}, "`Referer` header with length == 4k is not stripped to an origin.");
promise_test(t => {
history.pushState(null, null, "/");
history.replaceState(null, null, "A".repeat(4096 - location.href.length + 1));
return invokeScenario(scenario) return invokeScenario(scenario)
.then(result => checkResult("origin", result)) .then(result => checkResult(scenario, expectation, result));
.finally(_ => historyBackPromise(t, scenario)); }, testDescription);
}, "`Referer` header with length > 4k is stripped to an origin.");
} }
function TestCase(scenario, testDescription, sanityChecker) {
// This check is A NOOP in release.
sanityChecker.checkScenario(scenario);
function runTest() {
promise_test(_ => {
return invokeScenario(scenario)
.then(result => checkResult(scenario, scenario.expectation, result));
}, testDescription);
} }
return {start: runTest}; return {start: runTest};

View file

@ -51,13 +51,13 @@ test(function() {
assert_equals( assert_equals(
new ExtendableEvent('ExtendableEvent').type, new ExtendableEvent('ExtendableEvent').type,
'ExtendableEvent', 'Type of ExtendableEvent should be ExtendableEvent'); 'ExtendableEvent', 'Type of ExtendableEvent should be ExtendableEvent');
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new FetchEvent('FetchEvent'); new FetchEvent('FetchEvent');
}, 'FetchEvent constructor with one argument throws'); }, 'FetchEvent constructor with one argument throws');
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new FetchEvent('FetchEvent', {}); new FetchEvent('FetchEvent', {});
}, 'FetchEvent constructor with empty init dict throws'); }, 'FetchEvent constructor with empty init dict throws');
assert_throws(new TypeError, function() { assert_throws_js(TypeError, function() {
new FetchEvent('FetchEvent', {request: null}); new FetchEvent('FetchEvent', {request: null});
}, 'FetchEvent constructor with null request member throws'); }, 'FetchEvent constructor with null request member throws');
assert_equals( assert_equals(

View file

@ -4,6 +4,6 @@ mozlog==5.0
mozdebug==0.1.1 mozdebug==0.1.1
# Pillow 7 requires Python 3 # Pillow 7 requires Python 3
pillow==6.2.1 # pyup: <7.0 pillow==6.2.1 # pyup: <7.0
urllib3[secure]==1.25.7 urllib3[secure]==1.25.8
requests==2.22.0 requests==2.22.0
six==1.14.0 six==1.14.0

View file

@ -1,6 +1,5 @@
import base64 import base64
import hashlib import hashlib
from six.moves.http_client import HTTPConnection
import io import io
import json import json
import os import os
@ -8,8 +7,10 @@ import threading
import traceback import traceback
import socket import socket
import sys import sys
from six.moves.urllib.parse import urljoin, urlsplit, urlunsplit
from abc import ABCMeta, abstractmethod from abc import ABCMeta, abstractmethod
from six import text_type
from six.moves.http_client import HTTPConnection
from six.moves.urllib.parse import urljoin, urlsplit, urlunsplit
from ..testrunner import Stop from ..testrunner import Stop
from .protocol import Protocol, BaseProtocolPart from .protocol import Protocol, BaseProtocolPart
@ -293,7 +294,7 @@ class TestExecutor(object):
status = e.status status = e.status
else: else:
status = "INTERNAL-ERROR" status = "INTERNAL-ERROR"
message = unicode(getattr(e, "message", "")) message = text_type(getattr(e, "message", ""))
if message: if message:
message += "\n" message += "\n"
message += traceback.format_exc(e) message += traceback.format_exc(e)

View file

@ -1,7 +1,8 @@
import os import os
from six.moves.urllib.parse import urljoin
from collections import deque from collections import deque
from six import text_type from six import string_types, text_type
from six.moves.urllib.parse import urljoin
from .wptmanifest.backends import static from .wptmanifest.backends import static
from .wptmanifest.backends.base import ManifestItem from .wptmanifest.backends.base import ManifestItem
@ -47,7 +48,7 @@ def list_prop(name, node):
"""List property""" """List property"""
try: try:
list_prop = node.get(name) list_prop = node.get(name)
if isinstance(list_prop, basestring): if isinstance(list_prop, string_types):
return [list_prop] return [list_prop]
return list(list_prop) return list(list_prop)
except KeyError: except KeyError:

View file

@ -7,5 +7,5 @@ def cast_env(env):
"""Encode all the environment values as the appropriate type for each Python version """Encode all the environment values as the appropriate type for each Python version
This assumes that all the data is or can be represented as UTF8""" This assumes that all the data is or can be represented as UTF8"""
env_type = six.ensure_binary if sys.version_info[0] < 3 else six.ensure_string env_type = six.ensure_binary if sys.version_info[0] < 3 else six.ensure_str
return {env_type(key): env_type(value) for key, value in six.iteritems(env)} return {env_type(key): env_type(value) for key, value in six.iteritems(env)}

View file

@ -95,15 +95,29 @@ class DirectoryHandler(object):
link = urljoin(base_path, "..") link = urljoin(base_path, "..")
yield ("""<li class="dir"><a href="%(link)s">%(name)s</a></li>""" % yield ("""<li class="dir"><a href="%(link)s">%(name)s</a></li>""" %
{"link": link, "name": ".."}) {"link": link, "name": ".."})
items = []
prev_item = None
for item in sorted(os.listdir(path)): for item in sorted(os.listdir(path)):
if prev_item and prev_item + ".headers" == item:
items[-1][1] = item
prev_item = None
continue
items.append([item, None])
prev_item = item
for item, dot_headers in items:
link = html.escape(quote(item)) link = html.escape(quote(item))
dot_headers_markup = ""
if dot_headers is not None:
dot_headers_markup = (""" (<a href="%(link)s">.headers</a>)""" %
{"link": html.escape(quote(dot_headers))})
if os.path.isdir(os.path.join(path, item)): if os.path.isdir(os.path.join(path, item)):
link += "/" link += "/"
class_ = "dir" class_ = "dir"
else: else:
class_ = "file" class_ = "file"
yield ("""<li class="%(class)s"><a href="%(link)s">%(name)s</a></li>""" % yield ("""<li class="%(class)s"><a href="%(link)s">%(name)s</a>%(headers)s</li>""" %
{"link": link, "name": html.escape(item), "class": class_}) {"link": link, "name": html.escape(item), "class": class_,
"headers": dot_headers_markup})
def wrap_pipeline(path, request, response): def wrap_pipeline(path, request, response):

View file

@ -396,8 +396,8 @@ class SubFunctions(object):
def uuid(request): def uuid(request):
return str(uuid.uuid4()) return str(uuid.uuid4())
# Maintain a whitelist of supported algorithms, restricted to those that # Maintain a list of supported algorithms, restricted to those that are
# are available on all platforms [1]. This ensures that test authors do not # available on all platforms [1]. This ensures that test authors do not
# unknowingly introduce platform-specific tests. # unknowingly introduce platform-specific tests.
# #
# [1] https://docs.python.org/2/library/hashlib.html # [1] https://docs.python.org/2/library/hashlib.html

View file

@ -6,22 +6,22 @@
<meta http-equiv="Content-Security-Policy" content="trusted-types SomeName JustOneMoreName"> <meta http-equiv="Content-Security-Policy" content="trusted-types SomeName JustOneMoreName">
<body> <body>
<script> <script>
// Whitelisted name test // Allowed name test
test(t => { test(t => {
let policy = window.trustedTypes.createPolicy('SomeName', { createHTML: s => s } ); let policy = window.trustedTypes.createPolicy('SomeName', { createHTML: s => s } );
assert_equals(policy.name, 'SomeName'); assert_equals(policy.name, 'SomeName');
}, "Whitelisted policy creation works."); }, "Allowed-name policy creation works.");
// Another whitelisted name test // Another allowed name test
test(t => { test(t => {
let policy = window.trustedTypes.createPolicy('JustOneMoreName', { createHTML: s => s } ); let policy = window.trustedTypes.createPolicy('JustOneMoreName', { createHTML: s => s } );
assert_equals(policy.name, 'JustOneMoreName'); assert_equals(policy.name, 'JustOneMoreName');
}, "Another whitelisted policy creation works."); }, "Another allowed-name policy creation works.");
// Non-whitelisted names test // Non-allowed names test
test(t => { test(t => {
assert_throws(new TypeError(), _ => { assert_throws(new TypeError(), _ => {
window.trustedTypes.createPolicy('SomeOtherName', { createURL: s => s } ); window.trustedTypes.createPolicy('SomeOtherName', { createURL: s => s } );
}); });
}, "Non-whitelisted policy creation throws."); }, "Non-allowed name policy creation throws.");
</script> </script>

View file

@ -6,22 +6,22 @@
<meta http-equiv="Content-Security-Policy" content="trusted-types SomeName JustOneMoreName"> <meta http-equiv="Content-Security-Policy" content="trusted-types SomeName JustOneMoreName">
<body> <body>
<script> <script>
// Whitelisted name test // Allowed name test
test(t => { test(t => {
let policy = window.trustedTypes.createPolicy('SomeName', { createHTML: s => s } ); let policy = window.trustedTypes.createPolicy('SomeName', { createHTML: s => s } );
assert_equals(policy.name, 'SomeName'); assert_equals(policy.name, 'SomeName');
}, "Whitelisted policy creation works."); }, "Allowed-name policy creation works.");
// Another whitelisted name test // Another allowed name test
test(t => { test(t => {
let policy = window.trustedTypes.createPolicy('JustOneMoreName', { createHTML: s => s } ); let policy = window.trustedTypes.createPolicy('JustOneMoreName', { createHTML: s => s } );
assert_equals(policy.name, 'JustOneMoreName'); assert_equals(policy.name, 'JustOneMoreName');
}, "Another whitelisted policy creation works."); }, "Another allowed-name policy creation works.");
// Non-whitelisted names test // Non-allowed names test
test(t => { test(t => {
assert_throws(new TypeError(), _ => { assert_throws(new TypeError(), _ => {
window.trustedTypes.createPolicy('SomeOtherName', { createURL: s => s } ); window.trustedTypes.createPolicy('SomeOtherName', { createURL: s => s } );
}); });
}, "Non-whitelisted policy creation throws."); }, "Non-allowed name policy creation throws.");
</script> </script>

View file

@ -25,7 +25,7 @@ function runTests(testData) {
self.test(() => { self.test(() => {
const url = new URL("about:blank") const url = new URL("about:blank")
assert_throws(new TypeError, () => url.href = test.input) assert_throws_js(TypeError, () => url.href = test.input)
}, "URL's href: " + name) }, "URL's href: " + name)
self.test(() => { self.test(() => {
@ -34,11 +34,11 @@ function runTests(testData) {
}, "XHR: " + name) }, "XHR: " + name)
self.test(() => { self.test(() => {
assert_throws(new TypeError, () => self.navigator.sendBeacon(test.input)) assert_throws_js(TypeError, () => self.navigator.sendBeacon(test.input))
}, "sendBeacon(): " + name) }, "sendBeacon(): " + name)
self.test(() => { self.test(() => {
assert_throws(new TypeError, () => self[0].location = test.input) assert_throws_js(self[0].TypeError, () => self[0].location = test.input)
}, "Location's href: " + name) }, "Location's href: " + name)
self.test(() => { self.test(() => {

View file

@ -28,7 +28,7 @@ function runTests(tests) {
assert_equals(url.href, "https://" + hostTest.output + "/x") assert_equals(url.href, "https://" + hostTest.output + "/x")
} else { } else {
if(type === "url") { if(type === "url") {
assert_throws(new TypeError, () => makeURL("url", hostTest.input)) assert_throws_js(TypeError, () => makeURL("url", hostTest.input))
} else { } else {
const url = makeURL(type, hostTest.input) const url = makeURL(type, hostTest.input)
assert_equals(url.host, "") assert_equals(url.host, "")

View file

@ -0,0 +1,42 @@
// META: global=jsshell
// META: script=assertions.js
// META: script=/wasm/jsapi/wasm-constants.js
// META: script=/wasm/jsapi/wasm-module-builder.js
// Test cases for changes to the WebAssembly.Table.prototype.grow() API that
// come in with the reftypes proposal: the API takes a default argument, which
// for tables of anyfunc must be either an exported wasm function or null.
//
// See:
// https://github.com/WebAssembly/reference-types
// https://bugzilla.mozilla.org/show_bug.cgi?id=1507491
// https://github.com/WebAssembly/reference-types/issues/22
test(() => {
const builder = new WasmModuleBuilder();
builder
.addFunction("fn", kSig_v_v)
.addBody([kExprEnd])
.exportFunc();
const bin = builder.toBuffer()
const argument = { "element": "anyfunc", "initial": 1 };
const table = new WebAssembly.Table(argument);
const fn = new WebAssembly.Instance(new WebAssembly.Module(bin)).exports.fn;
const result = table.grow(2, fn);
assert_equals(result, 1);
assert_equals(table.get(0), null);
assert_equals(table.get(1), fn);
assert_equals(table.get(2), fn);
}, "Grow with exported-function argument");
test(() => {
const argument = { "element": "anyfunc", "initial": 1 };
const table = new WebAssembly.Table(argument);
assert_throws(new TypeError(), () => table.grow(2, {}));
}, "Grow with non-function argument");
test(() => {
const argument = { "element": "anyfunc", "initial": 1 };
const table = new WebAssembly.Table(argument);
assert_throws(new TypeError(), () => table.grow(2, () => true));
}, "Grow with JS-function argument");

View file

@ -81,7 +81,7 @@ for (const subtest of gKeyframesTests) {
for (const subtest of gInvalidKeyframesTests) { for (const subtest of gInvalidKeyframesTests) {
test(t => { test(t => {
const div = createDiv(t); const div = createDiv(t);
assert_throws(new TypeError, () => { assert_throws_js(TypeError, () => {
div.animate(subtest.input, 2000); div.animate(subtest.input, 2000);
}); });
}, `Element.animate() does not accept ${subtest.desc}`); }, `Element.animate() does not accept ${subtest.desc}`);
@ -108,7 +108,7 @@ test(t => {
for (const invalid of gBadDelayValues) { for (const invalid of gBadDelayValues) {
test(t => { test(t => {
assert_throws(new TypeError, () => { assert_throws_js(TypeError, () => {
createDiv(t).animate(null, { delay: invalid }); createDiv(t).animate(null, { delay: invalid });
}); });
}, `Element.animate() does not accept invalid delay value: ${invalid}`); }, `Element.animate() does not accept invalid delay value: ${invalid}`);
@ -127,7 +127,7 @@ for (const invalid of gBadDurationValues) {
continue; continue;
} }
test(t => { test(t => {
assert_throws(new TypeError, () => { assert_throws_js(TypeError, () => {
createDiv(t).animate(null, invalid); createDiv(t).animate(null, invalid);
}); });
}, 'Element.animate() does not accept invalid duration value: ' }, 'Element.animate() does not accept invalid duration value: '
@ -136,7 +136,7 @@ for (const invalid of gBadDurationValues) {
for (const invalid of gBadDurationValues) { for (const invalid of gBadDurationValues) {
test(t => { test(t => {
assert_throws(new TypeError, () => { assert_throws_js(TypeError, () => {
createDiv(t).animate(null, { duration: invalid }); createDiv(t).animate(null, { duration: invalid });
}); });
}, 'Element.animate() does not accept invalid duration value: ' }, 'Element.animate() does not accept invalid duration value: '
@ -146,7 +146,7 @@ for (const invalid of gBadDurationValues) {
for (const invalidEasing of gInvalidEasings) { for (const invalidEasing of gInvalidEasings) {
test(t => { test(t => {
assert_throws(new TypeError, () => { assert_throws_js(TypeError, () => {
createDiv(t).animate({ easing: invalidEasing }, 2000); createDiv(t).animate({ easing: invalidEasing }, 2000);
}); });
}, `Element.animate() does not accept invalid easing: '${invalidEasing}'`); }, `Element.animate() does not accept invalid easing: '${invalidEasing}'`);
@ -154,7 +154,7 @@ for (const invalidEasing of gInvalidEasings) {
for (const invalid of gBadIterationStartValues) { for (const invalid of gBadIterationStartValues) {
test(t => { test(t => {
assert_throws(new TypeError, () => { assert_throws_js(TypeError, () => {
createDiv(t).animate(null, { iterationStart: invalid }); createDiv(t).animate(null, { iterationStart: invalid });
}); });
}, 'Element.animate() does not accept invalid iterationStart value: ' + }, 'Element.animate() does not accept invalid iterationStart value: ' +
@ -163,7 +163,7 @@ for (const invalid of gBadIterationStartValues) {
for (const invalid of gBadIterationsValues) { for (const invalid of gBadIterationsValues) {
test(t => { test(t => {
assert_throws(new TypeError, () => { assert_throws_js(TypeError, () => {
createDiv(t).animate(null, { iterations: invalid }); createDiv(t).animate(null, { iterations: invalid });
}); });
}, 'Element.animate() does not accept invalid iterations value: ' + }, 'Element.animate() does not accept invalid iterations value: ' +

View file

@ -258,7 +258,7 @@ for (const duration of gGoodDurationValues) {
for (const invalid of gBadDurationValues) { for (const invalid of gBadDurationValues) {
test(t => { test(t => {
assert_throws(new TypeError, () => { assert_throws_js(TypeError, () => {
createDiv(t).animate(null, { duration: invalid }); createDiv(t).animate(null, { duration: invalid });
}); });
}, 'Throws when setting invalid duration: ' }, 'Throws when setting invalid duration: '

View file

@ -37,7 +37,7 @@ test(() => {
test(() => { test(() => {
for (const invalidEasing of gInvalidEasings) { for (const invalidEasing of gInvalidEasings) {
assert_throws(new TypeError, () => { assert_throws_js(TypeError, () => {
new KeyframeEffect(target, { easing: invalidEasing }); new KeyframeEffect(target, { easing: invalidEasing });
}, `TypeError is thrown for easing '${invalidEasing}'`); }, `TypeError is thrown for easing '${invalidEasing}'`);
} }
@ -46,7 +46,7 @@ test(() => {
test(() => { test(() => {
for (const invalidEasing of gInvalidEasings) { for (const invalidEasing of gInvalidEasings) {
assert_throws(new TypeError, () => { assert_throws_js(TypeError, () => {
new KeyframeEffect(target, [{ easing: invalidEasing }]); new KeyframeEffect(target, [{ easing: invalidEasing }]);
}, `TypeError is thrown for easing '${invalidEasing}'`); }, `TypeError is thrown for easing '${invalidEasing}'`);
} }

View file

@ -34,7 +34,7 @@ for (const subtest of gKeyframesTests) {
for (const subtest of gInvalidKeyframesTests) { for (const subtest of gInvalidKeyframesTests) {
test(t => { test(t => {
const effect = new KeyframeEffect(target, {}); const effect = new KeyframeEffect(target, {});
assert_throws(new TypeError, () => { assert_throws_js(TypeError, () => {
effect.setKeyframes(subtest.input); effect.setKeyframes(subtest.input);
}); });
}, `KeyframeEffect constructor throws with ${subtest.desc}`); }, `KeyframeEffect constructor throws with ${subtest.desc}`);

View file

@ -8,21 +8,21 @@
test(() => { test(() => {
assert_equals(NDEFMessage.length, 1); assert_equals(NDEFMessage.length, 1);
assert_throws(new TypeError, () => new NDEFMessage()); assert_throws_js(TypeError, () => new NDEFMessage());
}, 'NDEFMessage constructor without init dict'); }, 'NDEFMessage constructor without init dict');
test(() => { test(() => {
assert_throws(new TypeError, () => new NDEFMessage(null), assert_throws_js(TypeError, () => new NDEFMessage(null),
'NDEFMessageInit#records is a required field.'); 'NDEFMessageInit#records is a required field.');
}, 'NDEFMessage constructor with null init dict'); }, 'NDEFMessage constructor with null init dict');
test(() => { test(() => {
assert_throws(new TypeError, () => new NDEFMessage({dummy_key: 'dummy_value'}), assert_throws_js(TypeError, () => new NDEFMessage({dummy_key: 'dummy_value'}),
'NDEFMessageInit#records is a required field.'); 'NDEFMessageInit#records is a required field.');
}, 'NDEFMessage constructor without NDEFMessageInit#records field'); }, 'NDEFMessage constructor without NDEFMessageInit#records field');
test(() => { test(() => {
assert_throws(new TypeError, () => new NDEFMessage({records: []}), assert_throws_js(TypeError, () => new NDEFMessage({records: []}),
'NDEFMessageInit#records should not be empty.'); 'NDEFMessageInit#records should not be empty.');
}, 'NDEFMessage constructor with NDEFMessageInit#records being empty'); }, 'NDEFMessage constructor with NDEFMessageInit#records being empty');

View file

@ -8,11 +8,11 @@
test(() => { test(() => {
assert_equals(NDEFReadingEvent.length, 2); assert_equals(NDEFReadingEvent.length, 2);
assert_throws(new TypeError, () => new NDEFReadingEvent('message')); assert_throws_js(TypeError, () => new NDEFReadingEvent('message'));
}, 'NDEFReadingEvent constructor without init dict'); }, 'NDEFReadingEvent constructor without init dict');
test(() => { test(() => {
assert_throws(new TypeError, () => new NDEFReadingEvent('type', assert_throws_js(TypeError, () => new NDEFReadingEvent('type',
{serialNumber: '', message: null}), {serialNumber: '', message: null}),
'NDEFMessageInit#records is a required field.'); 'NDEFMessageInit#records is a required field.');
}, 'NDEFReadingEvent constructor failed to construct its NDEFMessage'); }, 'NDEFReadingEvent constructor failed to construct its NDEFMessage');

View file

@ -8,42 +8,42 @@
test(() => { test(() => {
assert_equals(NDEFRecord.length, 1); assert_equals(NDEFRecord.length, 1);
assert_throws(new TypeError, () => new NDEFRecord()); assert_throws_js(TypeError, () => new NDEFRecord());
}, 'NDEFRecord constructor without init dict'); }, 'NDEFRecord constructor without init dict');
test(() => { test(() => {
assert_throws(new TypeError, () => new NDEFRecord(null), assert_throws_js(TypeError, () => new NDEFRecord(null),
'NDEFRecordInit#recordType is a required field.'); 'NDEFRecordInit#recordType is a required field.');
}, 'NDEFRecord constructor with null init dict'); }, 'NDEFRecord constructor with null init dict');
test(() => { test(() => {
assert_throws(new TypeError, () => new NDEFRecord({id: test_record_id, data: test_text_data}), assert_throws_js(TypeError, () => new NDEFRecord({id: test_record_id, data: test_text_data}),
'NDEFRecordInit#recordType is a required field.'); 'NDEFRecordInit#recordType is a required field.');
}, 'NDEFRecord constructor without NDEFRecordInit#recordType field'); }, 'NDEFRecord constructor without NDEFRecordInit#recordType field');
test(() => { test(() => {
assert_throws(new TypeError, () => new NDEFRecord( assert_throws_js(TypeError, () => new NDEFRecord(
createRecord('empty', test_text_data, test_record_id)), createRecord('empty', test_text_data, test_record_id)),
'id does not apply for empty record type.'); 'id does not apply for empty record type.');
}, 'NDEFRecord constructor with empty record type and id'); }, 'NDEFRecord constructor with empty record type and id');
test(() => { test(() => {
assert_throws(new TypeError, () => new NDEFRecord( assert_throws_js(TypeError, () => new NDEFRecord(
createRecord('empty', test_text_data, test_record_id, 'text/plain')), createRecord('empty', test_text_data, test_record_id, 'text/plain')),
'mediaType does not apply for empty record type.'); 'mediaType does not apply for empty record type.');
assert_throws(new TypeError, () => new NDEFRecord( assert_throws_js(TypeError, () => new NDEFRecord(
createRecord('text', test_text_data, test_record_id, 'text/plain')), createRecord('text', test_text_data, test_record_id, 'text/plain')),
'mediaType does not apply for text record type.'); 'mediaType does not apply for text record type.');
assert_throws(new TypeError, () => new NDEFRecord( assert_throws_js(TypeError, () => new NDEFRecord(
createRecord('url', test_url_data, test_record_id, 'text/plain')), createRecord('url', test_url_data, test_record_id, 'text/plain')),
'mediaType does not apply for url record type.'); 'mediaType does not apply for url record type.');
assert_throws(new TypeError, () => new NDEFRecord( assert_throws_js(TypeError, () => new NDEFRecord(
createRecord('absolute-url', test_url_data, test_record_id, 'text/plain')), createRecord('absolute-url', test_url_data, test_record_id, 'text/plain')),
'mediaType does not apply for absolute-url record type.'); 'mediaType does not apply for absolute-url record type.');
assert_throws(new TypeError, () => new NDEFRecord( assert_throws_js(TypeError, () => new NDEFRecord(
createRecord('unknown', test_buffer_data, test_record_id, 'application/octet-stream')), createRecord('unknown', test_buffer_data, test_record_id, 'application/octet-stream')),
'mediaType does not apply for unknown record type.'); 'mediaType does not apply for unknown record type.');
assert_throws(new TypeError, () => new NDEFRecord( assert_throws_js(TypeError, () => new NDEFRecord(
createRecord('foo.example.com:bar', test_buffer_data, test_record_id, 'application/octet-stream')), createRecord('foo.example.com:bar', test_buffer_data, test_record_id, 'application/octet-stream')),
'mediaType does not apply for external record type.'); 'mediaType does not apply for external record type.');
}, 'NDEFRecord constructor should only accept mediaType for mime record type'); }, 'NDEFRecord constructor should only accept mediaType for mime record type');
@ -207,7 +207,7 @@
}, 'NDEFRecord constructor with absolute-url record type'); }, 'NDEFRecord constructor with absolute-url record type');
test(() => { test(() => {
assert_throws(new TypeError, () => new NDEFRecord( assert_throws_js(TypeError, () => new NDEFRecord(
createMimeRecord("A string is not a BufferSource")), createMimeRecord("A string is not a BufferSource")),
'Only BufferSource is allowed to be the record data.'); 'Only BufferSource is allowed to be the record data.');
@ -250,7 +250,7 @@
}, 'NDEFRecord constructor with mime record type and json data'); }, 'NDEFRecord constructor with mime record type and json data');
test(() => { test(() => {
assert_throws(new TypeError, () => new NDEFRecord( assert_throws_js(TypeError, () => new NDEFRecord(
createUnknownRecord("A string is not a BufferSource")), createUnknownRecord("A string is not a BufferSource")),
'Only BufferSource is allowed to be the record data.'); 'Only BufferSource is allowed to be the record data.');
@ -280,7 +280,7 @@
}, 'NDEFRecord constructor with unknown record type'); }, 'NDEFRecord constructor with unknown record type');
test(() => { test(() => {
assert_throws(new TypeError, () => new NDEFRecord( assert_throws_js(TypeError, () => new NDEFRecord(
createRecord('foo.eXamPle.com:bAr*-', "A string is not a BufferSource or NDEFMessageInit")), createRecord('foo.eXamPle.com:bAr*-', "A string is not a BufferSource or NDEFMessageInit")),
'Only BufferSource and NDEFMessageInit are allowed to be the record data.'); 'Only BufferSource and NDEFMessageInit are allowed to be the record data.');
@ -331,15 +331,15 @@
}, 'NDEFRecord constructor with external record type'); }, 'NDEFRecord constructor with external record type');
test(() => { test(() => {
assert_throws(new TypeError, () => new NDEFRecord(createRecord('EMptY')), assert_throws_js(TypeError, () => new NDEFRecord(createRecord('EMptY')),
'Unknown record type.'); 'Unknown record type.');
assert_throws(new TypeError, () => new NDEFRecord(createRecord('TeXt', test_text_data)), assert_throws_js(TypeError, () => new NDEFRecord(createRecord('TeXt', test_text_data)),
'Unknown record type.'); 'Unknown record type.');
assert_throws(new TypeError, () => new NDEFRecord(createRecord('uRL', test_url_data)), assert_throws_js(TypeError, () => new NDEFRecord(createRecord('uRL', test_url_data)),
'Unknown record type.'); 'Unknown record type.');
assert_throws(new TypeError, () => new NDEFRecord(createRecord('Mime', test_buffer_data)), assert_throws_js(TypeError, () => new NDEFRecord(createRecord('Mime', test_buffer_data)),
'Unknown record type.'); 'Unknown record type.');
assert_throws(new TypeError, () => new NDEFRecord(createRecord('sMart-PosTER', test_url_data)), assert_throws_js(TypeError, () => new NDEFRecord(createRecord('sMart-PosTER', test_url_data)),
'Unknown record type.'); 'Unknown record type.');
}, 'NDEFRecord constructor with record type string being treated as case sensitive'); }, 'NDEFRecord constructor with record type string being treated as case sensitive');
@ -352,21 +352,21 @@
const record = new NDEFRecord(createRecord( const record = new NDEFRecord(createRecord(
[...Array(251)].map(_ => 'a').join('') + ':xyz', test_buffer_data)); [...Array(251)].map(_ => 'a').join('') + ':xyz', test_buffer_data));
// Exceeding 255, Throws. // Exceeding 255, Throws.
assert_throws(new TypeError, () => new NDEFRecord(createRecord( assert_throws_js(TypeError, () => new NDEFRecord(createRecord(
[...Array(252)].map(_ => 'a').join('') + ':xyz', test_buffer_data)), [...Array(252)].map(_ => 'a').join('') + ':xyz', test_buffer_data)),
'The external type should not be longer than 255.'); 'The external type should not be longer than 255.');
assert_throws(new TypeError, () => new NDEFRecord(createRecord( assert_throws_js(TypeError, () => new NDEFRecord(createRecord(
'xyz', test_buffer_data)), 'The external type must have a \':\'.'); 'xyz', test_buffer_data)), 'The external type must have a \':\'.');
assert_throws(new TypeError, () => new NDEFRecord(createRecord( assert_throws_js(TypeError, () => new NDEFRecord(createRecord(
':xyz', test_buffer_data)), 'The domain should not be empty.'); ':xyz', test_buffer_data)), 'The domain should not be empty.');
assert_throws(new TypeError, () => new NDEFRecord(createRecord( assert_throws_js(TypeError, () => new NDEFRecord(createRecord(
'example.com:', test_buffer_data)), 'The type should not be empty.'); 'example.com:', test_buffer_data)), 'The type should not be empty.');
assert_throws(new TypeError, () => new NDEFRecord(createRecord( assert_throws_js(TypeError, () => new NDEFRecord(createRecord(
'example.com:xyz[', test_buffer_data)), 'The type should not contain \'[\'.'); 'example.com:xyz[', test_buffer_data)), 'The type should not contain \'[\'.');
assert_throws(new TypeError, () => new NDEFRecord(createRecord( assert_throws_js(TypeError, () => new NDEFRecord(createRecord(
'example.com:xyz~', test_buffer_data)), 'The type should not contain \'~\'.'); 'example.com:xyz~', test_buffer_data)), 'The type should not contain \'~\'.');
assert_throws(new TypeError, () => new NDEFRecord(createRecord( assert_throws_js(TypeError, () => new NDEFRecord(createRecord(
'example.com:xyz/', test_buffer_data)), 'The type should not contain \'/\'.'); 'example.com:xyz/', test_buffer_data)), 'The type should not contain \'/\'.');
}, 'NDEFRecord constructor with invalid external record type'); }, 'NDEFRecord constructor with invalid external record type');

View file

@ -5,6 +5,6 @@
<div id=log></div> <div id=log></div>
<script> <script>
test(function(t) { test(function(t) {
assert_throws(new TypeError, () => postMessage('', {transfer: null})); assert_throws_js(TypeError, () => postMessage('', {transfer: null}));
}); });
</script> </script>

View file

@ -5,7 +5,7 @@
<div id=log></div> <div id=log></div>
<script> <script>
test(function(t) { test(function(t) {
assert_throws(new TypeError, () => postMessage('', '*', null)); assert_throws_js(TypeError, () => postMessage('', '*', null));
}); });
</script> </script>

View file

@ -0,0 +1,39 @@
<!doctype html>
<meta charset=utf-8>
<title>RTCRtpParameters encodings</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/webrtc/dictionary-helper.js"></script>
<script src="/webrtc/RTCRtpParameters-helper.js"></script>
<script>
'use strict';
test(function(t) {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
assert_throws(new RangeError(), () => pc.addTransceiver('video', {
sendEncodings: [{
maxFramerate: -10
}]
}));
}, `addTransceiver() with sendEncoding.maxFramerate field set to less than 0 should reject with RangeError`);
promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const { sender } = pc.addTransceiver('video');
await doOfferAnswerExchange(t, pc);
const param = sender.getParameters();
validateSenderRtpParameters(param);
const encoding = getFirstEncoding(param);
encoding.maxFramerate = -10;
return promise_rejects(t, new RangeError(),
sender.setParameters(param));
}, `setParameters() with encoding.maxFramerate field set to less than 0 should reject with RangeError`);
test_modified_encoding('video', 'maxFramerate', 24, 16,
'setParameters() with modified encoding.maxFramerate should succeed');
</script>

View file

@ -6,6 +6,6 @@
<script> <script>
test(() => { test(() => {
const toStringThrows = { toString: function() { throw new Error; } }; const toStringThrows = { toString: function() { throw new Error; } };
assert_throws(new Error, () => new RTCPeerConnection({ peerIdentity: toStringThrows })); assert_throws_js(Error, () => new RTCPeerConnection({ peerIdentity: toStringThrows }));
}, "RTCPeerConnection constructor throws if the given peerIdentity getter throws"); }, "RTCPeerConnection constructor throws if the given peerIdentity getter throws");
</script> </script>

View file

@ -34,7 +34,6 @@ const stopTracks = (...streams) => {
readonly attribute USVString protocol; readonly attribute USVString protocol;
readonly attribute boolean negotiated; readonly attribute boolean negotiated;
readonly attribute unsigned short? id; readonly attribute unsigned short? id;
readonly attribute RTCPriorityType priority;
readonly attribute RTCDataChannelState readyState; readonly attribute RTCDataChannelState readyState;
readonly attribute unsigned long bufferedAmount; readonly attribute unsigned long bufferedAmount;
attribute unsigned long bufferedAmountLowThreshold; attribute unsigned long bufferedAmountLowThreshold;
@ -51,16 +50,6 @@ const stopTracks = (...streams) => {
boolean negotiated = false; boolean negotiated = false;
[EnforceRange] [EnforceRange]
unsigned short id; unsigned short id;
RTCPriorityType priority = "low";
};
4.9.1. RTCPriorityType Enum
enum RTCPriorityType {
"very-low",
"low",
"medium",
"high"
}; };
*/ */
@ -102,8 +91,6 @@ test(t => {
member. member.
15. Let channel have an [[DataChannelId]] internal slot initialized to option's id 15. Let channel have an [[DataChannelId]] internal slot initialized to option's id
member, if it is present and [[Negotiated]] is true, otherwise null. member, if it is present and [[Negotiated]] is true, otherwise null.
17. Let channel have an [[DataChannelPriority]] internal slot initialized to option's
priority member.
21. If the [[DataChannelId]] slot is null (due to no ID being passed into 21. If the [[DataChannelId]] slot is null (due to no ID being passed into
createDataChannel, or [[Negotiated]] being false), and the DTLS role of the SCTP createDataChannel, or [[Negotiated]] being false), and the DTLS role of the SCTP
transport has already been negotiated, then initialize [[DataChannelId]] to a value transport has already been negotiated, then initialize [[DataChannelId]] to a value
@ -148,7 +135,6 @@ test(t => {
// Since no offer/answer exchange has occurred yet, the DTLS role is unknown // Since no offer/answer exchange has occurred yet, the DTLS role is unknown
// and so the ID should be null. // and so the ID should be null.
assert_equals(dc.id, null); assert_equals(dc.id, null);
assert_equals(dc.priority, 'low');
assert_equals(dc.readyState, 'connecting'); assert_equals(dc.readyState, 'connecting');
assert_equals(dc.bufferedAmount, 0); assert_equals(dc.bufferedAmount, 0);
assert_equals(dc.bufferedAmountLowThreshold, 0); assert_equals(dc.bufferedAmountLowThreshold, 0);
@ -165,8 +151,7 @@ test(t => {
// Note: maxPacketLifeTime is not set in this test. // Note: maxPacketLifeTime is not set in this test.
protocol: 'custom', protocol: 'custom',
negotiated: true, negotiated: true,
id: 3, id: 3
priority: 'high'
}); });
assert_true(dc instanceof RTCDataChannel, 'is RTCDataChannel'); assert_true(dc instanceof RTCDataChannel, 'is RTCDataChannel');
@ -177,7 +162,6 @@ test(t => {
assert_equals(dc.protocol, 'custom'); assert_equals(dc.protocol, 'custom');
assert_equals(dc.negotiated, true); assert_equals(dc.negotiated, true);
assert_equals(dc.id, 3); assert_equals(dc.id, 3);
assert_equals(dc.priority, 'high');
assert_equals(dc.readyState, 'connecting'); assert_equals(dc.readyState, 'connecting');
assert_equals(dc.bufferedAmount, 0); assert_equals(dc.bufferedAmount, 0);
assert_equals(dc.bufferedAmountLowThreshold, 0); assert_equals(dc.bufferedAmountLowThreshold, 0);
@ -189,7 +173,7 @@ test(t => {
}); });
assert_equals(dc2.label, 'test2'); assert_equals(dc2.label, 'test2');
assert_equals(dc2.maxPacketLifeTime, 42); assert_equals(dc2.maxPacketLifeTime, 42);
assert_equals(dc.maxRetransmits, null); assert_equals(dc2.maxRetransmits, null);
}, 'createDataChannel with provided parameters should initialize attributes to provided values'); }, 'createDataChannel with provided parameters should initialize attributes to provided values');
/* /*
@ -367,28 +351,6 @@ for (const id of [-1, 65535, 65536]) {
}, `createDataChannel with id ${id} should throw TypeError`); }, `createDataChannel with id ${id} should throw TypeError`);
} }
/*
6.2. RTCDataChannel
createDataChannel
17. Let channel have an [[DataChannelPriority]] internal slot initialized to option's
priority member.
*/
test(t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const dc = pc.createDataChannel('', { priority: 'high' });
assert_equals(dc.priority, 'high');
}, 'createDataChannel with priority "high" should succeed');
test(t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
assert_throws(new TypeError(),
() => pc.createDataChannel('', { priority: 'invalid' }));
}, 'createDataChannel with invalid priority should throw TypeError');
/* /*
6.2. createDataChannel 6.2. createDataChannel
5. If [[DataChannelLabel]] is longer than 65535 bytes, throw a TypeError. 5. If [[DataChannelLabel]] is longer than 65535 bytes, throw a TypeError.

View file

@ -49,7 +49,6 @@
RTCPriorityType priority; RTCPriorityType priority;
RTCPriorityType networkPriority; RTCPriorityType networkPriority;
unsigned long maxBitrate; unsigned long maxBitrate;
double maxFramerate;
[readonly] [readonly]
DOMString rid; DOMString rid;
@ -68,14 +67,6 @@
- encodings is set to the value of the [[send encodings]] internal slot. - encodings is set to the value of the [[send encodings]] internal slot.
*/ */
// Get the first encoding in param.encodings.
// Asserts that param.encodings has at least one element.
function getFirstEncoding(param) {
const { encodings } = param;
assert_equals(encodings.length, 1);
return encodings[0];
}
/* /*
5.1. addTransceiver 5.1. addTransceiver
7. Create an RTCRtpSender with track, streams and sendEncodings and let sender 7. Create an RTCRtpSender with track, streams and sendEncodings and let sender
@ -155,7 +146,6 @@
assert_equals(encoding.priority, 'low'); assert_equals(encoding.priority, 'low');
assert_equals(encoding.networkPriority, 'low'); assert_equals(encoding.networkPriority, 'low');
assert_equals(encoding.maxBitrate, 8); assert_equals(encoding.maxBitrate, 8);
assert_equals(encoding.maxFramerate, 25);
assert_not_own_property(encoding, "rid", "rid should be removed with a single encoding"); assert_not_own_property(encoding, "rid", "rid should be removed with a single encoding");
}, `sender.getParameters() should return sendEncodings set by addTransceiver()`); }, `sender.getParameters() should return sendEncodings set by addTransceiver()`);
@ -267,58 +257,6 @@
}); });
}, `setParameters() with encoding.scaleResolutionDownBy field set to greater than 1.0 should succeed`); }, `setParameters() with encoding.scaleResolutionDownBy field set to greater than 1.0 should succeed`);
// Helper function to test that modifying an encoding field should succeed
function test_modified_encoding(kind, field, value1, value2, desc) {
promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const { sender } = pc.addTransceiver(kind, {
sendEncodings: [{
[field]: value1
}]
});
await doOfferAnswerExchange(t, pc);
const param1 = sender.getParameters();
validateSenderRtpParameters(param1);
const encoding1 = getFirstEncoding(param1);
assert_equals(encoding1[field], value1);
encoding1[field] = value2;
await sender.setParameters(param1);
const param2 = sender.getParameters();
validateSenderRtpParameters(param2);
const encoding2 = getFirstEncoding(param2);
assert_equals(encoding2[field], value2);
}, desc + ' with RTCRtpTransceiverInit');
promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const { sender } = pc.addTransceiver(kind);
await doOfferAnswerExchange(t, pc);
const initParam = sender.getParameters();
validateSenderRtpParameters(initParam);
initParam.encodings[0][field] = value1;
await sender.setParameters(initParam);
const param1 = sender.getParameters();
validateSenderRtpParameters(param1);
const encoding1 = getFirstEncoding(param1);
assert_equals(encoding1[field], value1);
encoding1[field] = value2;
await sender.setParameters(param1);
const param2 = sender.getParameters();
validateSenderRtpParameters(param2);
const encoding2 = getFirstEncoding(param2);
assert_equals(encoding2[field], value2);
}, desc + ' without RTCRtpTransceiverInit');
}
test_modified_encoding('audio', 'active', false, true, test_modified_encoding('audio', 'active', false, true,
'setParameters() with modified encoding.active should succeed'); 'setParameters() with modified encoding.active should succeed');
@ -331,9 +269,6 @@
test_modified_encoding('audio', 'maxBitrate', 10000, 20000, test_modified_encoding('audio', 'maxBitrate', 10000, 20000,
'setParameters() with modified encoding.maxBitrate should succeed'); 'setParameters() with modified encoding.maxBitrate should succeed');
test_modified_encoding('video', 'maxFramerate', 24, 16,
'setParameters() with modified encoding.maxFramerate should succeed');
test_modified_encoding('video', 'scaleResolutionDownBy', 2, 4, test_modified_encoding('video', 'scaleResolutionDownBy', 2, 4,
'setParameters() with modified encoding.scaleResolutionDownBy should succeed'); 'setParameters() with modified encoding.scaleResolutionDownBy should succeed');

View file

@ -242,3 +242,69 @@ function validateCodecParameters(codec) {
assert_optional_unsigned_int_field(codec, 'channels'); assert_optional_unsigned_int_field(codec, 'channels');
assert_optional_string_field(codec, 'sdpFmtpLine'); assert_optional_string_field(codec, 'sdpFmtpLine');
} }
// Get the first encoding in param.encodings.
// Asserts that param.encodings has at least one element.
function getFirstEncoding(param) {
const {
encodings
} = param;
assert_equals(encodings.length, 1);
return encodings[0];
}
// Helper function to test that modifying an encoding field should succeed
function test_modified_encoding(kind, field, value1, value2, desc) {
promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const {
sender
} = pc.addTransceiver(kind, {
sendEncodings: [{
[field]: value1
}]
});
await doOfferAnswerExchange(t, pc);
const param1 = sender.getParameters();
validateSenderRtpParameters(param1);
const encoding1 = getFirstEncoding(param1);
assert_equals(encoding1[field], value1);
encoding1[field] = value2;
await sender.setParameters(param1);
const param2 = sender.getParameters();
validateSenderRtpParameters(param2);
const encoding2 = getFirstEncoding(param2);
assert_equals(encoding2[field], value2);
}, desc + ' with RTCRtpTransceiverInit');
promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const {
sender
} = pc.addTransceiver(kind);
await doOfferAnswerExchange(t, pc);
const initParam = sender.getParameters();
validateSenderRtpParameters(initParam);
initParam.encodings[0][field] = value1;
await sender.setParameters(initParam);
const param1 = sender.getParameters();
validateSenderRtpParameters(param1);
const encoding1 = getFirstEncoding(param1);
assert_equals(encoding1[field], value1);
encoding1[field] = value2;
await sender.setParameters(param1);
const param2 = sender.getParameters();
validateSenderRtpParameters(param2);
const encoding2 = getFirstEncoding(param2);
assert_equals(encoding2[field], value2);
}, desc + ' without RTCRtpTransceiverInit');
}

View file

@ -8,7 +8,7 @@
<body> <body>
<script> <script>
test(function() { test(function() {
assert_throws(new TypeError, () => new StorageEvent()); assert_throws_js(TypeError, () => new StorageEvent());
// should be redundant, but .length can be wrong with custom bindings // should be redundant, but .length can be wrong with custom bindings
assert_equals(StorageEvent.length, 1, 'StorageEvent.length'); assert_equals(StorageEvent.length, 1, 'StorageEvent.length');
}, 'constructor with no arguments'); }, 'constructor with no arguments');

View file

@ -9,7 +9,7 @@
<script> <script>
test(() => { test(() => {
const event = new StorageEvent('storage'); const event = new StorageEvent('storage');
assert_throws(new TypeError, () => event.initStorageEvent()); assert_throws_js(TypeError, () => event.initStorageEvent());
// should be redundant, but .length can be wrong with custom bindings // should be redundant, but .length can be wrong with custom bindings
assert_equals(event.initStorageEvent.length, 1, 'event.initStorageEvent.length'); assert_equals(event.initStorageEvent.length, 1, 'event.initStorageEvent.length');
}, 'initStorageEvent with 0 arguments'); }, 'initStorageEvent with 0 arguments');

View file

@ -5,14 +5,14 @@
<div id=log></div> <div id=log></div>
<script> <script>
test(function() { test(function() {
assert_throws(new TypeError, function() { new VTTCue(NaN, 0, 'foo'); }); assert_throws_js(TypeError, function() { new VTTCue(NaN, 0, 'foo'); });
assert_throws(new TypeError, function() { new VTTCue(Infinity, 0, 'foo'); }); assert_throws_js(TypeError, function() { new VTTCue(Infinity, 0, 'foo'); });
assert_throws(new TypeError, function() { new VTTCue('tomorrow', 0, 'foo'); }); assert_throws_js(TypeError, function() { new VTTCue('tomorrow', 0, 'foo'); });
}, document.title+', non-finite start time'); }, document.title+', non-finite start time');
test(function() { test(function() {
assert_throws(new TypeError, function() { new VTTCue(0, NaN, 'foo'); }); assert_throws_js(TypeError, function() { new VTTCue(0, NaN, 'foo'); });
assert_throws(new TypeError, function() { new VTTCue(0, Infinity, 'foo'); }); assert_throws_js(TypeError, function() { new VTTCue(0, Infinity, 'foo'); });
assert_throws(new TypeError, function() { new VTTCue(0, 'tomorrow', 'foo'); }); assert_throws_js(TypeError, function() { new VTTCue(0, 'tomorrow', 'foo'); });
}, document.title+', non-finite end time'); }, document.title+', non-finite end time');
test(function() { test(function() {
var start = { valueOf: function() { return 42; } }; var start = { valueOf: function() { return 42; } };

Some files were not shown because too many files have changed in this diff Show more