diff options
171 files changed, 2438 insertions, 911 deletions
diff --git a/tests/wpt/metadata/2dcontext/scroll/2d.scrollPathIntoView.basic.html.ini b/tests/wpt/metadata/2dcontext/scroll/2d.scrollPathIntoView.basic.html.ini new file mode 100644 index 00000000000..1dfa4dc645b --- /dev/null +++ b/tests/wpt/metadata/2dcontext/scroll/2d.scrollPathIntoView.basic.html.ini @@ -0,0 +1,4 @@ +[2d.scrollPathIntoView.basic.html] + [scrollPathIntoView() works] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/scroll/2d.scrollPathIntoView.path.html.ini b/tests/wpt/metadata/2dcontext/scroll/2d.scrollPathIntoView.path.html.ini new file mode 100644 index 00000000000..9424d8df4f8 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/scroll/2d.scrollPathIntoView.path.html.ini @@ -0,0 +1,4 @@ +[2d.scrollPathIntoView.path.html] + [scrollPathIntoView() with path argument works] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/scroll/2d.scrollPathIntoView.verticalLR.html.ini b/tests/wpt/metadata/2dcontext/scroll/2d.scrollPathIntoView.verticalLR.html.ini new file mode 100644 index 00000000000..f15be9112ad --- /dev/null +++ b/tests/wpt/metadata/2dcontext/scroll/2d.scrollPathIntoView.verticalLR.html.ini @@ -0,0 +1,4 @@ +[2d.scrollPathIntoView.verticalLR.html] + [scrollPathIntoView() works in vertical-lr writing mode] + expected: FAIL + diff --git a/tests/wpt/metadata/2dcontext/scroll/2d.scrollPathIntoView.verticalRL.html.ini b/tests/wpt/metadata/2dcontext/scroll/2d.scrollPathIntoView.verticalRL.html.ini new file mode 100644 index 00000000000..37aa1c76d82 --- /dev/null +++ b/tests/wpt/metadata/2dcontext/scroll/2d.scrollPathIntoView.verticalRL.html.ini @@ -0,0 +1,4 @@ +[2d.scrollPathIntoView.verticalRL.html] + [scrollPathIntoView() works in vertical-rl writing mode] + expected: FAIL + diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index c25721dad54..03ca9b864ab 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -162187,6 +162187,54 @@ {} ] ], + "css/css-writing-modes/three-levels-of-orthogonal-flows.html": [ + [ + "/css/css-writing-modes/three-levels-of-orthogonal-flows.html", + [ + [ + "/css/css-writing-modes/reference/three-levels-of-orthogonal-flows.html", + "==" + ] + ], + {} + ] + ], + "css/css-writing-modes/two-levels-of-orthogonal-flows-fixed.html": [ + [ + "/css/css-writing-modes/two-levels-of-orthogonal-flows-fixed.html", + [ + [ + "/css/css-writing-modes/reference/two-levels-of-orthogonal-flows-fixed.html", + "==" + ] + ], + {} + ] + ], + "css/css-writing-modes/two-levels-of-orthogonal-flows-percentage.html": [ + [ + "/css/css-writing-modes/two-levels-of-orthogonal-flows-percentage.html", + [ + [ + "/css/css-writing-modes/reference/two-levels-of-orthogonal-flows-percentage.html", + "==" + ] + ], + {} + ] + ], + "css/css-writing-modes/two-levels-of-orthogonal-flows.html": [ + [ + "/css/css-writing-modes/two-levels-of-orthogonal-flows.html", + [ + [ + "/css/css-writing-modes/reference/two-levels-of-orthogonal-flows.html", + "==" + ] + ], + {} + ] + ], "css/css-writing-modes/vertical-alignment-002.xht": [ [ "/css/css-writing-modes/vertical-alignment-002.xht", @@ -166476,7 +166524,7 @@ "/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-abspos-child-002.html", [ [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-abspos-child-001-ref.html", + "/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-abspos-child-002-ref.html", "==" ] ], @@ -262123,6 +262171,26 @@ {} ] ], + "css/css-writing-modes/reference/three-levels-of-orthogonal-flows.html": [ + [ + {} + ] + ], + "css/css-writing-modes/reference/two-levels-of-orthogonal-flows-fixed.html": [ + [ + {} + ] + ], + "css/css-writing-modes/reference/two-levels-of-orthogonal-flows-percentage.html": [ + [ + {} + ] + ], + "css/css-writing-modes/reference/two-levels-of-orthogonal-flows.html": [ + [ + {} + ] + ], "css/css-writing-modes/reference/vertical-ahem-1x1-ref.html": [ [ {} @@ -275373,11 +275441,21 @@ {} ] ], + "generic-sensor/generic-sensor-iframe-tests.sub.js": [ + [ + {} + ] + ], "generic-sensor/generic-sensor-tests.js": [ [ {} ] ], + "generic-sensor/resources/iframe_sensor_handler.html": [ + [ + {} + ] + ], "geolocation-API/OWNERS": [ [ {} @@ -275663,6 +275741,11 @@ {} ] ], + "html/browsers/browsing-the-web/history-traversal/support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html": [ + [ + {} + ] + ], "html/browsers/browsing-the-web/history-traversal/support/window-name-navigation.sub.html": [ [ {} @@ -276728,6 +276811,11 @@ {} ] ], + "html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html.headers": [ + [ + {} + ] + ], "html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_frame.html": [ [ {} @@ -306169,6 +306257,30 @@ {} ] ], + "2dcontext/scroll/2d.scrollPathIntoView.basic.html": [ + [ + "/2dcontext/scroll/2d.scrollPathIntoView.basic.html", + {} + ] + ], + "2dcontext/scroll/2d.scrollPathIntoView.path.html": [ + [ + "/2dcontext/scroll/2d.scrollPathIntoView.path.html", + {} + ] + ], + "2dcontext/scroll/2d.scrollPathIntoView.verticalLR.html": [ + [ + "/2dcontext/scroll/2d.scrollPathIntoView.verticalLR.html", + {} + ] + ], + "2dcontext/scroll/2d.scrollPathIntoView.verticalRL.html": [ + [ + "/2dcontext/scroll/2d.scrollPathIntoView.verticalRL.html", + {} + ] + ], "2dcontext/shadows/2d.shadow.alpha.1.html": [ [ "/2dcontext/shadows/2d.shadow.alpha.1.html", @@ -310379,6 +310491,12 @@ {} ] ], + "accelerometer/Accelerometer-iframe-access.https.html": [ + [ + "/accelerometer/Accelerometer-iframe-access.https.html", + {} + ] + ], "accelerometer/Accelerometer.https.html": [ [ "/accelerometer/Accelerometer.https.html", @@ -337705,6 +337823,12 @@ {} ] ], + "gyroscope/Gyroscope-iframe-access.https.html": [ + [ + "/gyroscope/Gyroscope-iframe-access.https.html", + {} + ] + ], "gyroscope/Gyroscope.https.html": [ [ "/gyroscope/Gyroscope.https.html", @@ -338259,6 +338383,24 @@ } ] ], + "html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-lr.html": [ + [ + "/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-lr.html", + {} + ] + ], + "html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-rl.html": [ + [ + "/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-rl.html", + {} + ] + ], + "html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html": [ + [ + "/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html", + {} + ] + ], "html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html": [ [ "/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html", @@ -339111,6 +339253,12 @@ {} ] ], + "html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html": [ + [ + "/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html", + {} + ] + ], "html/browsers/sandboxing/sandbox-allow-same-origin.html": [ [ "/html/browsers/sandboxing/sandbox-allow-same-origin.html", @@ -350893,6 +351041,12 @@ {} ] ], + "magnetometer/Magnetometer-iframe-access.https.html": [ + [ + "/magnetometer/Magnetometer-iframe-access.https.html", + {} + ] + ], "magnetometer/Magnetometer.https.html": [ [ "/magnetometer/Magnetometer.https.html", @@ -362365,6 +362519,12 @@ {} ] ], + "orientation-sensor/AbsoluteOrientationSensor-iframe-access.https.html": [ + [ + "/orientation-sensor/AbsoluteOrientationSensor-iframe-access.https.html", + {} + ] + ], "orientation-sensor/AbsoluteOrientationSensor.https.html": [ [ "/orientation-sensor/AbsoluteOrientationSensor.https.html", @@ -362407,6 +362567,12 @@ {} ] ], + "orientation-sensor/RelativeOrientationSensor-iframe-access.https.html": [ + [ + "/orientation-sensor/RelativeOrientationSensor-iframe-access.https.html", + {} + ] + ], "orientation-sensor/RelativeOrientationSensor.https.html": [ [ "/orientation-sensor/RelativeOrientationSensor.https.html", @@ -405551,7 +405717,7 @@ "support" ], "./lint.whitelist": [ - "808677b142f2245d3127428fb75caea24db8bc00", + "7f96383c023ae0602813a441202c3be6bc44e624", "support" ], "./serve.py": [ @@ -409014,6 +409180,22 @@ "48c1c689c14bc9b046a95f6a0fb5749dabbb9ab2", "testharness" ], + "2dcontext/scroll/2d.scrollPathIntoView.basic.html": [ + "b465b768ac051ccb2443253d8b955b2bb0460946", + "testharness" + ], + "2dcontext/scroll/2d.scrollPathIntoView.path.html": [ + "80961f3c19515735086d012b6c4422312ccea9ca", + "testharness" + ], + "2dcontext/scroll/2d.scrollPathIntoView.verticalLR.html": [ + "4b2722ff418dd4bee3fd61c1461af7cadb5f0777", + "testharness" + ], + "2dcontext/scroll/2d.scrollPathIntoView.verticalRL.html": [ + "3ed43652df13d239c8cf261a94101b82d9e97e3b", + "testharness" + ], "2dcontext/shadows/.gitkeep": [ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" @@ -409539,11 +409721,11 @@ "support" ], "2dcontext/tools/name2dir.yaml": [ - "3a852f1cc85eae2a17e67d56ce0c9bb5e4e69b41", + "668427f8916940ff274f36e6385eaafc718aae7d", "support" ], "2dcontext/tools/spec.yaml": [ - "232dbb047756e3cef85089de215e492c3550f927", + "5bf3d546a6e5689bd8f7c9ba90ea26a53c734b14", "support" ], "2dcontext/tools/specextract.py": [ @@ -409559,7 +409741,7 @@ "support" ], "2dcontext/tools/tests2d.yaml": [ - "b25e82429ec7963e85a760247906839f9e631b24", + "6c90385b4c8a08b0ae1c49caf6a63f02a9db22c8", "support" ], "2dcontext/tools/tests2dtext.yaml": [ @@ -412350,6 +412532,10 @@ "c1723ad9944cf2393a5519a91e4e47a0255bcaf4", "support" ], + "accelerometer/Accelerometer-iframe-access.https.html": [ + "2dbc55431708bd20c92252ab330648ca4a37d47e", + "testharness" + ], "accelerometer/Accelerometer.https.html": [ "bef928057d49b59c2ede3916e49abdd730dc9582", "testharness" @@ -416211,7 +416397,7 @@ "support" ], "budget-api/interfaces.any.js": [ - "7532e03a56725728052d4b5a973630e2b86686da", + "36404f7f6ec3674ae74cd2ea1969b6260dc8f47c", "testharness" ], "clear-site-data/OWNERS": [ @@ -545174,6 +545360,22 @@ "63c8138947a0fecc134d04797d383f7974acc79c", "support" ], + "css/css-writing-modes/reference/three-levels-of-orthogonal-flows.html": [ + "7033482677726f890c27fa874df37ece0fc1749b", + "support" + ], + "css/css-writing-modes/reference/two-levels-of-orthogonal-flows-fixed.html": [ + "2684e3f55cb6212e4faea21efe97dea5270f3f6f", + "support" + ], + "css/css-writing-modes/reference/two-levels-of-orthogonal-flows-percentage.html": [ + "0f13b9fce43596cff43f7d53c44f4b24e3332392", + "support" + ], + "css/css-writing-modes/reference/two-levels-of-orthogonal-flows.html": [ + "0e0c5ff7f2441575f4faca99fc853c46ea656a89", + "support" + ], "css/css-writing-modes/reference/vertical-ahem-1x1-ref.html": [ "109ecb842ebdb0c4a515d0942b0b78ab631d8e59", "support" @@ -547462,6 +547664,10 @@ "47a4aeecb4971b3ddd9589465c868fa71096ce93", "visual" ], + "css/css-writing-modes/three-levels-of-orthogonal-flows.html": [ + "816df1a7e476da22dadb8afb381a188e458f66ff", + "reftest" + ], "css/css-writing-modes/tools/generators/.gitignore": [ "8b894ec0b3bbc33011392ad9bafeb1df2634db45", "support" @@ -547510,6 +547716,18 @@ "4d0d0734df208147f8cbf1fd3714bdb28a1a9ff5", "support" ], + "css/css-writing-modes/two-levels-of-orthogonal-flows-fixed.html": [ + "69aacc3dd5e1ac08b06bbc7864eb7e17d4654814", + "reftest" + ], + "css/css-writing-modes/two-levels-of-orthogonal-flows-percentage.html": [ + "4eec4534650ef7d9d432f2d8973daa580c28bf04", + "reftest" + ], + "css/css-writing-modes/two-levels-of-orthogonal-flows.html": [ + "f21ac2df2a7b2d90efd8c555382ccb474592d370", + "reftest" + ], "css/css-writing-modes/underline-font-size-vlr-003.xht": [ "6ebc3c3fc822319472f93b736aca59eaf6e9d95d", "visual" @@ -551951,7 +552169,7 @@ "support" ], "css/tools/w3ctestlib/templates/index.content.tmpl": [ - "44523077ae83bbed046402999ab32dd27d4809b6", + "76c4e8dc39e02476c8fbd170d4fb01ea2e3be002", "support" ], "css/tools/w3ctestlib/templates/index.htm.tmpl": [ @@ -553859,7 +554077,7 @@ "support" ], "css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-abspos-child-002.html": [ - "5ba69f0e2b5d2308c553a5a6e1c6a6eeb19528a4", + "ac812f07458547b987957fe51fec9c7358cd66db", "reftest" ], "css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-align-content-horiz-001-ref.xhtml": [ @@ -568159,17 +568377,25 @@ "testharness" ], "generic-sensor/generic-sensor-feature-policy-test.sub.js": [ - "f90a08bd96c729c5c166fd628e69f01c3413a78c", + "1bb8b40762176defe501485bd5243a315d79f2e5", + "support" + ], + "generic-sensor/generic-sensor-iframe-tests.sub.js": [ + "5da31d59d88db106abe5d22646c1426241ff404d", "support" ], "generic-sensor/generic-sensor-tests.js": [ - "3a427e0ebd3191c2a6b982b74d139250d8fb085a", + "b950811d99ac923c300a45967889a57ec8bf2204", "support" ], "generic-sensor/idlharness.https.html": [ "02c734b907075c8abb7504fc7e2b93730ac80a0c", "testharness" ], + "generic-sensor/resources/iframe_sensor_handler.html": [ + "b1bbac30ddcbe7d94ee33922df368ec28eec7029", + "support" + ], "geolocation-API/OWNERS": [ "c9da2c9b0b48dc8049b2e17bcbcc289fe6af800a", "support" @@ -568346,6 +568572,10 @@ "59acbd3ef447d2197c4a9af2837dbacdf1e31885", "support" ], + "gyroscope/Gyroscope-iframe-access.https.html": [ + "1c82cb09f995361bcd3144ca57d4ecc1c69d4508", + "testharness" + ], "gyroscope/Gyroscope.https.html": [ "e2b1919195d0af74bb7733a6d8a299adf43f4ee4", "testharness" @@ -568814,12 +569044,16 @@ "d049bc03734690b94017819ed70b1104378cc9b4", "testharness" ], + "html/browsers/browsing-the-web/history-traversal/support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html": [ + "5de9d9490705da8195853355ccb79a61bde26ffc", + "support" + ], "html/browsers/browsing-the-web/history-traversal/support/window-name-navigation.sub.html": [ "79ba1608590fae1fae8aacdf809b00741e101066", "support" ], "html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html": [ - "841e6ebed7f83a59b4942be07452ad5c9b8f6519", + "8b521df2cfb326622e871b1823fce5beade4a973", "support" ], "html/browsers/browsing-the-web/history-traversal/unset_context_name-1.html": [ @@ -568835,7 +569069,7 @@ "testharness" ], "html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html": [ - "74c59d584d8523ce523a26452767d6212d010234", + "0484b0af760bdb7896ec47554c78767e8e0ccdeb", "testharness" ], "html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-sub-frame-navigation.sub.html": [ @@ -569234,6 +569468,18 @@ "ac172eb5c05ee24b8e3059cbc68851729f1be943", "testharness" ], + "html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-lr.html": [ + "3b90310d446c577e2dcf0b6e0bea4a13c9b08b7d", + "testharness" + ], + "html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-rl.html": [ + "9a47642ec55caf4228728e28d37324cc9220b2bf", + "testharness" + ], + "html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html": [ + "f9704751dbef4f8c9ebd83eb54971b72aa78642d", + "testharness" + ], "html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html": [ "9bc91bc9bb368e8bf42810ed8aed936a6c9d581a", "testharness" @@ -569867,7 +570113,7 @@ "support" ], "html/browsers/history/the-history-interface/traverse_the_history_1.html": [ - "1b48bb6c67f00a5b387479f9c1ac21a2de702dd9", + "73fa8d1b4660315ab5e0d130377eb5252d87bb03", "testharness" ], "html/browsers/history/the-history-interface/traverse_the_history_2-1.html": [ @@ -570539,11 +570785,11 @@ "testharness" ], "html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html": [ - "9839a9c24ce78ec42da8a60d2175df06e19983c1", + "ecf33d6811deb94a89046b0ba6a82773f23ec44e", "testharness" ], "html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter.html": [ - "13210ebcc5093d24f7072e1dc43769ad6cb71048", + "dc537c0b9ac283297de91070195fc7f9a6f62c1b", "testharness" ], "html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter_null.tentative.html": [ @@ -570554,6 +570800,14 @@ "f707d1f40216d35afd04f4cd68cce66feaadddfd", "testharness" ], + "html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html": [ + "a001d3c2e5215d1a33a336318d569322f5d159ab", + "testharness" + ], + "html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html.headers": [ + "cb54f8c0ec6302182e257592a0dd933a316dfd08", + "support" + ], "html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_frame.html": [ "80d3d94c22642b2c07dae8f9cd8a50b563d36ef3", "support" @@ -582179,7 +582433,7 @@ "testharness" ], "html/semantics/embedded-content/the-img-element/invalid-src.html": [ - "fb713f6068016a6315220716a858397a241eb7c3", + "8c42235fb4feb557f8ce8fa0eda7f1c08d532425", "testharness" ], "html/semantics/embedded-content/the-img-element/ismap/img-ismap-coordinates-iframe-after.html": [ @@ -588335,7 +588589,7 @@ "manual" ], "interfaces/BackgroundSync.idl": [ - "f4812cb04b153d5f39e12e373b184c04d29b00fd", + "3f9bbca50917a8a3e27d4983fa792b6d2686552e", "support" ], "interfaces/DOM-Parsing.idl": [ @@ -588371,11 +588625,11 @@ "support" ], "interfaces/accelerometer.idl": [ - "a834258dac3ad510dec10425b9f79648547e0b42", + "07fc457b582a7abb689f923522c65fcce10d27a4", "support" ], "interfaces/ambient-light.idl": [ - "bdede54deab80b5465f904a9726ee86f1260858d", + "623852530c2645b51347c82cea8fa72c0cb22f18", "support" ], "interfaces/background-fetch.idl": [ @@ -588387,15 +588641,15 @@ "support" ], "interfaces/budget-api.idl": [ - "99f4eacad964a3ca3bcc034b48a2f4c4a2bd6f72", + "caba22c23688d761adef48dae1b58cc13a3e90ea", "support" ], "interfaces/clipboard-apis.idl": [ - "66b014c6a2ba5cd8e0fbc83081d4c16ac4d46d39", + "f117178bf9731a8f33da624f48530b84f1ca90f4", "support" ], "interfaces/compat.idl": [ - "5169148beaeb622da36a824a892421e86bf36c15", + "e674e142d1348afd587b566d86b9390ad8bc56a0", "support" ], "interfaces/console.idl": [ @@ -588407,7 +588661,7 @@ "support" ], "interfaces/css-font-loading.idl": [ - "a0d53cc4e88f38cce9fd45759963e5da9a6f3dc3", + "9f2f252c5b63c159d9680de46a932bfa4335bf11", "support" ], "interfaces/css-fonts.idl": [ @@ -588447,15 +588701,15 @@ "support" ], "interfaces/entries-api.idl": [ - "6bb93df3e14e49931f54eead37a009649e035bd1", + "894cdcbceaa9834b8c90db155e1220482dfcc015", "support" ], "interfaces/feature-policy.idl": [ - "cba4a18b5a6b69c467067dc4a7ac7449f39be6a1", + "ace338bf245dde3b21d3c65da64a5d0f6ad40fb2", "support" ], "interfaces/fetch.idl": [ - "dd0830114bbed129ffd6af96b76ad0b1ec6ee5b5", + "e65b90887799ac8ea3d3e9cbde053d76466bd704", "support" ], "interfaces/filter-effects.idl": [ @@ -588463,7 +588717,7 @@ "support" ], "interfaces/fullscreen.idl": [ - "fda57b55aabdc54d674851851451c6c69c514ed1", + "7b193c37494543f8b0db4d9aea9e8e3b7c7b6212", "support" ], "interfaces/gamepad.idl": [ @@ -588471,15 +588725,15 @@ "support" ], "interfaces/geolocation-sensor.idl": [ - "7f5defe8969fd21ed1b8eeaedc9a766cb4b695c1", + "28bc4d15ea571290fe9e48e7c136bc3684e08660", "support" ], "interfaces/geometry.idl": [ - "c757c625c0f5df3d677b5646bef04ac7075dbb64", + "8e057047db53832d0976414190a73eebb0b23f47", "support" ], "interfaces/gyroscope.idl": [ - "7c37c98eb39d994a89314c45c216bcb27b51f2d1", + "cbc81fd6697557a4fe06090ec6351385539d2d36", "support" ], "interfaces/hr-time.idl": [ @@ -588495,7 +588749,7 @@ "support" ], "interfaces/keyboard-lock.idl": [ - "7188a9233db3acc741650d46156e16e9e7a132fa", + "de86b3ca38839202b4b31e055cfb6e18591b7857", "support" ], "interfaces/keyboard-map.idl": [ @@ -588503,7 +588757,7 @@ "support" ], "interfaces/magnetometer.idl": [ - "ffac480912edba82886fef6d5368092d237a0c7f", + "5839955446fafc91d9bd63d1549d7bc2e7afe499", "support" ], "interfaces/media-capabilities.idl": [ @@ -588527,7 +588781,7 @@ "support" ], "interfaces/payment-request.idl": [ - "594179265efe3f056059ba834da5e1873c3e6174", + "669b8faf18cb5c12f135e991279b90a48d71ee97", "support" ], "interfaces/performance-timeline.idl": [ @@ -588547,7 +588801,7 @@ "support" ], "interfaces/proximity.idl": [ - "74f2bf81a497589e7b3ed323368df218a70925a3", + "5416752c31de2d0f7a3b72941e24a0030d98599c", "support" ], "interfaces/remote-playback.idl": [ @@ -588567,7 +588821,7 @@ "support" ], "interfaces/storage.idl": [ - "7c3221be9fdf6be4965cf5aeca2063f93c2110d6", + "a1ad440d60e04902f494ecaced1fceb8560adc5c", "support" ], "interfaces/touchevents.idl": [ @@ -588575,11 +588829,11 @@ "support" ], "interfaces/uievents.idl": [ - "9e107e1ac2ed7195f802291f1d3827c53468a002", + "872f7b943e89660d3491bcb176dd1976ce21dc0f", "support" ], "interfaces/url.idl": [ - "416ee65b3ba9e438a3178c6c04a414f42d759fc8", + "642e1ec46c8e57b579900f7cd10e99a8f80d552e", "support" ], "interfaces/user-timing.idl": [ @@ -588595,7 +588849,7 @@ "support" ], "interfaces/web-animations.idl": [ - "8d00ee62fafedfd3e24925f48eed6ba26b5aafc7", + "a68224b17684bd43309bef57e7ad835f5f324a3a", "support" ], "interfaces/web-audio-api.idl": [ @@ -588631,7 +588885,7 @@ "support" ], "interfaces/webvtt.idl": [ - "3e7ab31795b8339de3d6904f0d68dab68ca24148", + "c48af511eb0260e34f3530457257d5eaaf879f57", "support" ], "interfaces/webxr.idl": [ @@ -589018,6 +589272,10 @@ "2099d254fa4bb019404df56ec1a99e84459c77e2", "support" ], + "magnetometer/Magnetometer-iframe-access.https.html": [ + "3982e0b2fd93c36e4463b5c73975c5b6c3ed14d9", + "testharness" + ], "magnetometer/Magnetometer.https.html": [ "85b033df53fcaec4a55175f6a9438bd2abf5e6ff", "testharness" @@ -592875,7 +593133,7 @@ "testharness" ], "offscreen-canvas/convert-to-blob/offscreencanvas.convert.to.blob.w.html": [ - "8466fb824c584d343ca20a52fd8d316fc2cd0d1c", + "7c890d601704fafead715be193f1028d3cccb746", "testharness" ], "offscreen-canvas/drawing-images-to-the-canvas/2d.drawImage.3arg.html": [ @@ -597567,7 +597825,7 @@ "testharness" ], "offscreen-canvas/the-offscreen-canvas/offscreencanvas.commit.w.html": [ - "6462aca7d799136064e86fe71d7adda4aed68127", + "c42204b37998d48d21067903fc4d044971b2b9f2", "testharness" ], "offscreen-canvas/the-offscreen-canvas/offscreencanvas.constructor.html": [ @@ -597595,7 +597853,7 @@ "testharness" ], "offscreen-canvas/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.w.html": [ - "4a3bf1482540e266ef8d079b53ae441a479e41f1", + "fc63d87cc477e43d966f0698824798728863a3fb", "testharness" ], "offscreen-canvas/the-offscreen-canvas/offscreencanvas.transfercontrol.to.offscreen.html": [ @@ -597611,7 +597869,7 @@ "testharness" ], "offscreen-canvas/the-offscreen-canvas/offscreencanvas.transferrable.w.html": [ - "7ca5d6531fc2c747f12f45ea5d550e2094248af4", + "39cd1a430a1406b9e99f2853fae1c4ad3b320a45", "testharness" ], "offscreen-canvas/the-offscreen-canvas/size.attributes.default.html": [ @@ -598174,6 +598432,10 @@ "cb27e0f09caa38fc80b29580be4b0c06c1024a18", "support" ], + "orientation-sensor/AbsoluteOrientationSensor-iframe-access.https.html": [ + "fd5dc9438ba3e81e9c8b69dcc814aaf5716f6c2f", + "testharness" + ], "orientation-sensor/AbsoluteOrientationSensor.https.html": [ "c482c21d4336decf5d4c47b4e6911dc2b03a19e9", "testharness" @@ -598222,6 +598484,10 @@ "e6e93a77c618e8477d79f6cf1ff05d0f5865821c", "support" ], + "orientation-sensor/RelativeOrientationSensor-iframe-access.https.html": [ + "3e8344b5b3647bac67411facfefe766b9525c5ef", + "testharness" + ], "orientation-sensor/RelativeOrientationSensor.https.html": [ "9bf83c64eb5dcf284eb6c45db8ac278ab3c637a2", "testharness" @@ -608111,27 +608377,27 @@ "testharness" ], "screen-orientation/lock-bad-argument.html": [ - "89abd7337374b1cd4b1b33133e2f55d737f94d7c", + "6c41d0657e252633cd524967319ccc9aed6a7f0f", "testharness" ], "screen-orientation/lock-basic.html": [ - "b3753cf6efb7e9c209c27760f6fe59b343097b54", + "02d1e3604be6dc83b8f0e72109bf10219df6cc03", "testharness" ], "screen-orientation/lock-sandboxed-iframe.html": [ - "43f1e8564c938303f4391bccda21924ea7bbeaf2", + "226fb16ec13d9e7b51e9d3b27d2e5310bb4dcf8d", "testharness" ], "screen-orientation/onchange-event-subframe.html": [ - "64985ece6b231259f38b3ab88652b498facfa079", + "6d8df074167a93ae2914e39885b44c9bceb51b98", "testharness" ], "screen-orientation/onchange-event.html": [ - "b2c9679f11ebae5968c063bfb2449edfae46fc08", + "086d5e0ccf98f20e485785d6a984709168806fc3", "testharness" ], "screen-orientation/orientation-reading.html": [ - "863ce2783be30b5482733cb8cc31201d7f272128", + "8fff908b0e4e69129feb0e5c8e4d5b1e515b6dc6", "testharness" ], "screen-orientation/page-visibility-manual.html": [ @@ -608139,11 +608405,11 @@ "manual" ], "screen-orientation/resources/iframe-listen-orientation-change.html": [ - "4ec6b6431003d68af74539357243e4267038f68e", + "3cd2862940009cd8747f2861ae32067305197891", "support" ], "screen-orientation/resources/sandboxed-iframe-locking.html": [ - "27c3eb23f9931697d65c64a2c7a46be77f8961ee", + "9984a22d62b08da1aa2102936b0c5375fe237548", "support" ], "secure-contexts/OWNERS": [ @@ -619259,7 +619525,7 @@ "testharness" ], "webaudio/the-audio-api/the-biquadfilternode-interface/biquad-getFrequencyResponse.html": [ - "68a2545839beaacebaf65286829174375435a83f", + "f0d4f919dda492e8472337b0e2c54d7cd54bd291", "testharness" ], "webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highpass.html": [ @@ -620739,7 +621005,7 @@ "support" ], "webrtc/RTCDTMFSender-insertDTMF.https.html": [ - "a5fc15d44fe572744c07d933b9204d9319c968cd", + "efe15e018bbfe29b6c79e88d3380300844ec4189", "testharness" ], "webrtc/RTCDTMFSender-ontonechange-long.https.html": [ @@ -620747,7 +621013,7 @@ "testharness" ], "webrtc/RTCDTMFSender-ontonechange.https.html": [ - "ecc1e77f083cb91af78b1bcb7311fe4b5b96313e", + "9b5635c4757c983ec7ee7b6e0b62b267e89b28b0", "testharness" ], "webrtc/RTCDataChannel-bufferedAmount.html": [ @@ -620755,7 +621021,7 @@ "testharness" ], "webrtc/RTCDataChannel-id.html": [ - "28ce3983bf04db02c62ed29b332a4a4b612affd2", + "492cf27f7b8565ba6b2c4d1a9c8ea603a5dfdf96", "testharness" ], "webrtc/RTCDataChannel-send.html": [ @@ -620767,7 +621033,7 @@ "testharness" ], "webrtc/RTCDtlsTransport-getRemoteCertificates.html": [ - "7d6ea59253879cac114e2a7b162fa67926a39635", + "a419f71efed644f79bb198b9f410818bb85fa8d5", "testharness" ], "webrtc/RTCIceCandidate-constructor.html": [ @@ -620775,7 +621041,7 @@ "testharness" ], "webrtc/RTCIceTransport.html": [ - "db758cc2a744c049c291575e408dbb5f280cdf19", + "1b593c8ed167fd998195a2e2051bc489473f1bf4", "testharness" ], "webrtc/RTCPeerConnection-add-track-no-deadlock.https.html": [ @@ -620783,11 +621049,11 @@ "testharness" ], "webrtc/RTCPeerConnection-addIceCandidate.html": [ - "dd19f1d7a8d12ee85101e53bb30c553e94d67b6a", + "6d6351d16a2ce4f3e5b91757498c1a7c4caa3289", "testharness" ], "webrtc/RTCPeerConnection-addTrack.https.html": [ - "c434d2cdcb134f28b203df07cecca04e11195700", + "0255e15f335741d135647679fc0366a5c89df2a4", "testharness" ], "webrtc/RTCPeerConnection-addTransceiver.html": [ @@ -620795,11 +621061,11 @@ "testharness" ], "webrtc/RTCPeerConnection-canTrickleIceCandidates.html": [ - "8401fdc22f8f8867aa361f6a83834cdeb7a2a9d1", + "b19badd054a12905d636e1c125293b5c9157906f", "testharness" ], "webrtc/RTCPeerConnection-connectionState.html": [ - "a733cd1ae59aace10832a7b5f98913967afb87f1", + "4cbc2ec967d13623df2ff2dd87e35cc984cabe78", "testharness" ], "webrtc/RTCPeerConnection-constructor.html": [ @@ -620807,19 +621073,19 @@ "testharness" ], "webrtc/RTCPeerConnection-createAnswer.html": [ - "d70701dac44c536f793b124c0b1f86e7a08b2fd5", + "6fc00f6ac52190a82f11097ab1b80c66abcabe36", "testharness" ], "webrtc/RTCPeerConnection-createDataChannel.html": [ - "102de47ea13e20fe6d196077e47a525911957a00", + "19cb6b495cbeb8bbd9d721fc508f2f9709ea75d3", "testharness" ], "webrtc/RTCPeerConnection-createOffer-offerToReceive.html": [ - "91905d7efc95500ebba085ca4b1fc682a496e228", + "978387f8ca0cf6bfc9e5147ee01e870f3f2b4223", "testharness" ], "webrtc/RTCPeerConnection-createOffer.html": [ - "5b3d38072afd9bbb3e95925c3959ff3f4268a347", + "fb66c7d17d237b3a1752ce67ab7963a6f8c719d0", "testharness" ], "webrtc/RTCPeerConnection-generateCertificate.html": [ @@ -620835,7 +621101,7 @@ "testharness" ], "webrtc/RTCPeerConnection-getStats.https.html": [ - "913cbc3d2aaf724e70108e7854f56ad5bb9b2283", + "a8a0f98c9ebf3510cf4def16e569dbbeadd558d5", "testharness" ], "webrtc/RTCPeerConnection-getTransceivers.html": [ @@ -620843,83 +621109,83 @@ "testharness" ], "webrtc/RTCPeerConnection-helper.js": [ - "40f17015da70851164337b2a8b1c020a95b95679", + "481c2c11f030f30fdc5c919c72e971e8bae48228", "support" ], "webrtc/RTCPeerConnection-iceConnectionState.html": [ - "dad0787100a817c05dd871bf892a94464916a74a", + "718973199ab2bbdba519500e0e508ab51e2d8ddb", "testharness" ], "webrtc/RTCPeerConnection-iceGatheringState.html": [ - "ed3226f9673bc0b69c2a9f9ec6e1ccfa8e83e2e2", + "cfa693af6b6fb3a4ba6ff04e9e2fa1845016f6da", "testharness" ], "webrtc/RTCPeerConnection-ondatachannel.html": [ - "6096ee14d729894e39eb2217828e8b0a5abc7f19", + "37eeb67a20c600c92ef3fe9634fdcf44ab796703", "testharness" ], "webrtc/RTCPeerConnection-onnegotiationneeded.html": [ - "ca1cbd230de7aec4844879ae43f822941f566620", + "fb890b5e4175672627122fb9d5efdcd062b8f47d", "testharness" ], "webrtc/RTCPeerConnection-ontrack.https.html": [ - "3db4d8b29f4e1372055a50a279cae525f52cbb40", + "7c5857534be80343928cacbe89a01d34ed3f0972", "testharness" ], "webrtc/RTCPeerConnection-peerIdentity.html": [ - "d821c1516578820206ecc4a9f36dc4f28f2e52dd", + "d1e2441af750d0c698ecdfc1423d32d37dbb5f5f", "testharness" ], "webrtc/RTCPeerConnection-removeTrack.https.html": [ - "561575bea206ec1c9572e1e5e6f97d1e0bebe2d1", + "15f5c03bdc9e4b3479594c302eecf4403b86c4e7", "testharness" ], "webrtc/RTCPeerConnection-setDescription-transceiver.html": [ - "a21fe04592ad6941aa4277535d6482519b67ae74", + "47d2f81b1e5f0c81eb249261829fded2f4b00a95", "testharness" ], "webrtc/RTCPeerConnection-setLocalDescription-answer.html": [ - "e215aa042c67a23ae776b83d662a035a22e03810", + "35f5d5f3da4914fb5f42cd77d122fb3cf88ba790", "testharness" ], "webrtc/RTCPeerConnection-setLocalDescription-offer.html": [ - "117fc91599d11b63f2d232a63bace8e367dbb72a", + "ce7f1e2fc7adb243a840587a1d011b683ecfbfbd", "testharness" ], "webrtc/RTCPeerConnection-setLocalDescription-pranswer.html": [ - "9653d2176c51b638b0c03dec363d2a2fb8386281", + "acc815368303f8d79d2d8f504f675092581f6724", "testharness" ], "webrtc/RTCPeerConnection-setLocalDescription-rollback.html": [ - "293081a9ebd031cc4919a01ec323630394d401a8", + "45f66d3133c760a8be7e6667df089df5e890ba08", "testharness" ], "webrtc/RTCPeerConnection-setLocalDescription.html": [ - "b4cac26716f01ff80c902d3536dc0d2de6d85388", + "460de818ecbd5cb476c27a38c5f39f567060bda2", "testharness" ], "webrtc/RTCPeerConnection-setRemoteDescription-answer.html": [ - "3f85858a7afe6a5346b2d47f5505d25caef2668b", + "c4a942e907e8d0506cd6a6dce4f45c59e12a12e6", "testharness" ], "webrtc/RTCPeerConnection-setRemoteDescription-offer.html": [ - "34337ef2126bfe276675db8884cd2a9aaa2d4432", + "ec31150549acbd27a3c510eefd6bc40dc0fd31eb", "testharness" ], "webrtc/RTCPeerConnection-setRemoteDescription-pranswer.html": [ - "6ddea8760cbacc775ee99aa700fd71883cfb9bd7", + "d61781c76e6e831c9a513b9a91f709761bf425f7", "testharness" ], "webrtc/RTCPeerConnection-setRemoteDescription-replaceTrack.https.html": [ - "38f2588fadab58203a7f22d25e0d828b1373fbd3", + "f898128a0de6b757bc48f93707e13663e72c2410", "testharness" ], "webrtc/RTCPeerConnection-setRemoteDescription-rollback.html": [ - "6142a9b3b95bb26634af5300bc24981f2b4cb2a4", + "af10b6542e99a190bb62c8375a1896c6681a8022", "testharness" ], "webrtc/RTCPeerConnection-setRemoteDescription-tracks.https.html": [ - "16fe3b155e55d1b66181788c93e570b36e5cc67d", + "b40a9d3d52fd846f695482671877634359e86ab3", "testharness" ], "webrtc/RTCPeerConnection-setRemoteDescription.html": [ @@ -620927,7 +621193,7 @@ "testharness" ], "webrtc/RTCPeerConnection-track-stats.https.html": [ - "401279780028dc08d5d9315748d83e29665685f1", + "d40ed4a64f9e769c21060b0ba9b593938d8f8403", "testharness" ], "webrtc/RTCPeerConnectionIceEvent-constructor.html": [ @@ -620939,19 +621205,19 @@ "support" ], "webrtc/RTCRtpParameters-codecs.html": [ - "b9ba3d410e50400b7f8a41956439c4e19b14daf0", + "56f7ca6bd03087b3858c6decde1387cd4017fd3b", "testharness" ], "webrtc/RTCRtpParameters-degradationPreference.html": [ - "8f03fb8300b92360e907f567d35660dec84d6343", + "8da53caafd7b98c462f75ef45ed0488a74c378c7", "testharness" ], "webrtc/RTCRtpParameters-encodings.html": [ - "e7ff72c2ef0066bc05842ebbb3c991bc9320c102", + "76d4a6dccec508ea25d8c0bc3037a25a7db3f3ac", "testharness" ], "webrtc/RTCRtpParameters-headerExtensions.html": [ - "8bc6b13b74eb1026240822672b0267381a7b984a", + "11af81bd75e189e541468a7766b4af77034914f4", "testharness" ], "webrtc/RTCRtpParameters-helper.js": [ @@ -620959,11 +621225,11 @@ "support" ], "webrtc/RTCRtpParameters-rtcp.html": [ - "275b24f5688c7eeca316afa3fccda8533e1e0eda", + "1fa435f3f9be15799f4d45de4dc0995dcc01b156", "testharness" ], "webrtc/RTCRtpParameters-transactionId.html": [ - "7d94448a9767caafd0f0b341b4d61e0c586942ed", + "acb3d37db30fb2d436cc130c4a47601aa38625c8", "testharness" ], "webrtc/RTCRtpReceiver-getCapabilities.html": [ @@ -620971,7 +621237,7 @@ "testharness" ], "webrtc/RTCRtpReceiver-getContributingSources.https.html": [ - "11a63da6218738b5d67f0a7f15e57a077e76ba89", + "ce5367315aad59d4e0c847643b05318cea1cd31c", "testharness" ], "webrtc/RTCRtpReceiver-getParameters.html": [ @@ -620979,11 +621245,11 @@ "testharness" ], "webrtc/RTCRtpReceiver-getStats.https.html": [ - "ac5c0244fe64a5c07a7d255003c783e27a699728", + "0ead17ad0504866cac28dbb9be20376b55e60a1a", "testharness" ], "webrtc/RTCRtpReceiver-getSynchronizationSources.https.html": [ - "11aa1d9f6833dd019ae7ade7b9ec14780f271650", + "621d3a3fc636d4c4a065998333405977c38f87b1", "testharness" ], "webrtc/RTCRtpSender-getCapabilities.html": [ @@ -620991,15 +621257,15 @@ "testharness" ], "webrtc/RTCRtpSender-getStats.https.html": [ - "ee215306e1d9d1fdcb65bd5244da09fb2005e799", + "ba31d1217805d647f5efc31e6d4cadc09a8ae426", "testharness" ], "webrtc/RTCRtpSender-replaceTrack.html": [ - "f7b8caa578c9c818e8ca11777daf664ccb9457ec", + "ea6ff719d0939e22fd5af2c72af009a1c9602c93", "testharness" ], "webrtc/RTCRtpSender-setParameters.html": [ - "615bd9591e0f9c873827c9ae8e787b12d2efaf0f", + "b01436d8c7b71b84b4bdc1b58ea329967889bc32", "testharness" ], "webrtc/RTCRtpTransceiver-setCodecPreferences.html": [ @@ -621007,15 +621273,15 @@ "testharness" ], "webrtc/RTCRtpTransceiver-setDirection.html": [ - "539eaba516eef7419c5e543d7218a41f850f5e7b", + "98e0693d3a142f44bdff04137e68e8f3050fe187", "testharness" ], "webrtc/RTCSctpTransport-constructor.html": [ - "b92f3acf5113a475b58892f48406aafc9634be07", + "1d2b261ccea3ed00f2c91e877838ca5866023877", "testharness" ], "webrtc/RTCSctpTransport-maxMessageSize.html": [ - "4534a810f47cdca106f5300939acc36275222637", + "d9d9712b2be76d3d43d7a7199e2d44ddef757261", "testharness" ], "webrtc/RTCStats-helper.js": [ diff --git a/tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html.ini b/tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html.ini index 605731aa123..f8a10f8f098 100644 --- a/tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html.ini +++ b/tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html.ini @@ -1,3 +1,6 @@ [window-name-after-cross-origin-main-frame-navigation.sub.html] type: testharness expected: ERROR + [window.name should equal "" after a cross-origin main frame navigation] + expected: TIMEOUT + diff --git a/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-rl.html.ini b/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-rl.html.ini new file mode 100644 index 00000000000..97ae838a5a5 --- /dev/null +++ b/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-rl.html.ini @@ -0,0 +1,4 @@ +[scroll-position-vertical-rl.html] + [Fragment Navigation: Scroll to block start position in vertical-rl writing mode] + expected: FAIL + diff --git a/tests/wpt/metadata/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html.ini b/tests/wpt/metadata/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html.ini new file mode 100644 index 00000000000..b31d10e4b22 --- /dev/null +++ b/tests/wpt/metadata/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html.ini @@ -0,0 +1,7 @@ +[document_domain.html] + [new Document()] + expected: FAIL + + [XMLHttpRequest's response document] + expected: FAIL + diff --git a/tests/wpt/metadata/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html.ini b/tests/wpt/metadata/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html.ini new file mode 100644 index 00000000000..668406b2893 --- /dev/null +++ b/tests/wpt/metadata/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html.ini @@ -0,0 +1,4 @@ +[sandboxed-document_domain.html] + [Sandboxed document.domain] + expected: FAIL + diff --git a/tests/wpt/metadata/html/dom/usvstring-reflection.html.ini b/tests/wpt/metadata/html/dom/usvstring-reflection.html.ini index 22d65b148f1..4106ed36649 100644 --- a/tests/wpt/metadata/html/dom/usvstring-reflection.html.ini +++ b/tests/wpt/metadata/html/dom/usvstring-reflection.html.ini @@ -32,3 +32,6 @@ [RegisterPtotocolHandler URL: unpaired surrogate codepoint should not make any exceptions.] expected: FAIL + [USVString test relate to url] + expected: FAIL + diff --git a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/rapid-resizing.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/rapid-resizing.html.ini new file mode 100644 index 00000000000..1e2567027d8 --- /dev/null +++ b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/rapid-resizing.html.ini @@ -0,0 +1,5 @@ +[rapid-resizing.html] + expected: TIMEOUT + [Overall test] + expected: NOTRUN + diff --git a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/glsl/misc/shader-with-non-reserved-words.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/glsl/misc/shader-with-non-reserved-words.html.ini new file mode 100644 index 00000000000..fb8852c9e7a --- /dev/null +++ b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/glsl/misc/shader-with-non-reserved-words.html.ini @@ -0,0 +1,5 @@ +[shader-with-non-reserved-words.html] + expected: TIMEOUT + [Overall test] + expected: NOTRUN + diff --git a/tests/wpt/web-platform-tests/2dcontext/scroll/2d.scrollPathIntoView.basic.html b/tests/wpt/web-platform-tests/2dcontext/scroll/2d.scrollPathIntoView.basic.html new file mode 100644 index 00000000000..458b9ec6fd6 --- /dev/null +++ b/tests/wpt/web-platform-tests/2dcontext/scroll/2d.scrollPathIntoView.basic.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.scrollPathIntoView.basic</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.scrollPathIntoView.basic</h1> +<p class="desc">scrollPathIntoView() works</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test("scrollPathIntoView() works"); +_addTest(function(canvas, ctx) { + +var div = document.createElement('div'); +div.style.cssText = 'width: 200vw; height: 200vh'; +document.body.appendChild(div); +canvas.style.cssText = 'position: absolute; top: 100px; left: 200px; border: none;'; +window.scrollTo(0, 0); + +ctx.beginPath(); +ctx.rect(4, 8, 16, 32); +ctx.scrollPathIntoView(); +var rect = canvas.getBoundingClientRect(); +_assertSame(Math.round(rect.top), -8, "Math.round(rect.top)", "-8"); +_assertSame(Math.round(rect.left), 200, "Math.round(rect.left)", "200"); + + +}); +</script> + diff --git a/tests/wpt/web-platform-tests/2dcontext/scroll/2d.scrollPathIntoView.path.html b/tests/wpt/web-platform-tests/2dcontext/scroll/2d.scrollPathIntoView.path.html new file mode 100644 index 00000000000..4f1bb37c320 --- /dev/null +++ b/tests/wpt/web-platform-tests/2dcontext/scroll/2d.scrollPathIntoView.path.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.scrollPathIntoView.path</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.scrollPathIntoView.path</h1> +<p class="desc">scrollPathIntoView() with path argument works</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test("scrollPathIntoView() with path argument works"); +_addTest(function(canvas, ctx) { + +var div = document.createElement('div'); +div.style.cssText = 'width: 200vw; height: 200vh'; +document.body.appendChild(div); +canvas.style.cssText = 'position: absolute; top: 100px; left: 200px; border: none;'; +window.scrollTo(0, 0); + +var path = new Path2D(); +path.rect(4, 8, 16, 32); +ctx.scrollPathIntoView(path); +var rect = canvas.getBoundingClientRect(); +_assertSame(Math.round(rect.top), -8, "Math.round(rect.top)", "-8"); +_assertSame(Math.round(rect.left), 200, "Math.round(rect.left)", "200"); + + +}); +</script> + diff --git a/tests/wpt/web-platform-tests/2dcontext/scroll/2d.scrollPathIntoView.verticalLR.html b/tests/wpt/web-platform-tests/2dcontext/scroll/2d.scrollPathIntoView.verticalLR.html new file mode 100644 index 00000000000..fb16433aeab --- /dev/null +++ b/tests/wpt/web-platform-tests/2dcontext/scroll/2d.scrollPathIntoView.verticalLR.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.scrollPathIntoView.verticalLR</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.scrollPathIntoView.verticalLR</h1> +<p class="desc">scrollPathIntoView() works in vertical-lr writing mode</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test("scrollPathIntoView() works in vertical-lr writing mode"); +_addTest(function(canvas, ctx) { + +document.documentElement.style.cssText = 'writing-mode: vertical-lr'; +var div = document.createElement('div'); +div.style.cssText = 'width: 200vw; height: 200vh'; +document.body.appendChild(div); +canvas.style.cssText = 'position: absolute; top: 100px; left: 200px; border: none;'; +window.scrollTo(0, 0); + +ctx.beginPath(); +ctx.rect(4, 8, 16, 32); +ctx.scrollPathIntoView(); +var rect = canvas.getBoundingClientRect(); +_assertSame(Math.round(rect.top), 100, "Math.round(rect.top)", "100"); +_assertSame(Math.round(rect.left), -4, "Math.round(rect.left)", "-4"); + + +}); +</script> + diff --git a/tests/wpt/web-platform-tests/2dcontext/scroll/2d.scrollPathIntoView.verticalRL.html b/tests/wpt/web-platform-tests/2dcontext/scroll/2d.scrollPathIntoView.verticalRL.html new file mode 100644 index 00000000000..a5ac8c2d16d --- /dev/null +++ b/tests/wpt/web-platform-tests/2dcontext/scroll/2d.scrollPathIntoView.verticalRL.html @@ -0,0 +1,41 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.scrollPathIntoView.verticalRL</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.scrollPathIntoView.verticalRL</h1> +<p class="desc">scrollPathIntoView() works in vertical-rl writing mode</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test("scrollPathIntoView() works in vertical-rl writing mode"); +_addTest(function(canvas, ctx) { + +document.documentElement.style.cssText = 'writing-mode: vertical-rl'; +var div = document.createElement('div'); +div.style.cssText = 'width: 200vw; height: 200vh'; +document.body.appendChild(div); +canvas.style.cssText = 'position: absolute; top: 100px; right: 200px; border: none;'; +window.scrollTo(0, 0); + +ctx.beginPath(); +ctx.rect(4, 8, 16, 32); +ctx.scrollPathIntoView(); +var rect = canvas.getBoundingClientRect(); +var viewportWidth = document.scrollingElement.clientWidth; +var canvasWidth = canvas.width; +_assertSame(Math.round(rect.top), 100, "Math.round(rect.top)", "100"); +_assertSame(Math.round(rect.right), viewportWidth + (canvasWidth - 4 - 16), "Math.round(rect.right)", "viewportWidth + (canvasWidth - 4 - 16)"); + + +}); +</script> + diff --git a/tests/wpt/web-platform-tests/2dcontext/tools/name2dir.yaml b/tests/wpt/web-platform-tests/2dcontext/tools/name2dir.yaml index 2c2eecdba3d..479c171810c 100644 --- a/tests/wpt/web-platform-tests/2dcontext/tools/name2dir.yaml +++ b/tests/wpt/web-platform-tests/2dcontext/tools/name2dir.yaml @@ -32,6 +32,7 @@ 2d.text.draw.space.collapse.space: "text-styles" 2d.text.draw.space.collapse.start: "text-styles" 2d.state: "the-canvas-state" +2d.scrollPathIntoView: "scroll" 2d.canvas: "../html/semantics/embedded-content/the-canvas-element" 2d.getcontext: "../html/semantics/embedded-content/the-canvas-element" 2d.scaled: "../html/semantics/embedded-content/the-canvas-element" diff --git a/tests/wpt/web-platform-tests/2dcontext/tools/spec.yaml b/tests/wpt/web-platform-tests/2dcontext/tools/spec.yaml index e57bbc866bc..be86c7fb6e1 100644 --- a/tests/wpt/web-platform-tests/2dcontext/tools/spec.yaml +++ b/tests/wpt/web-platform-tests/2dcontext/tools/spec.yaml @@ -687,6 +687,9 @@ assertions: - id: 2d.colorspace.img.noinfo text: "Furthermore, the rendering of images that have no color correction information (such as those returned by the toDataURL() method) *must* be rendered with no color correction<^>." + - id: 2d.scrollPathIntoView.basic + text: "The scrollPathIntoView() method, when invoked, *must* run these steps<^>:" + - id: security.start text: "All canvas elements *must* start with their origin-clean set to true<^>." - id: security.drawImage.image diff --git a/tests/wpt/web-platform-tests/2dcontext/tools/tests2d.yaml b/tests/wpt/web-platform-tests/2dcontext/tools/tests2d.yaml index f7b858a6df9..7feebd0c0e0 100644 --- a/tests/wpt/web-platform-tests/2dcontext/tools/tests2d.yaml +++ b/tests/wpt/web-platform-tests/2dcontext/tools/tests2d.yaml @@ -10153,3 +10153,79 @@ ctx.fill(); @assert pixel 50,25 ==~ 0,255,0,255; expected: green + +- name: 2d.scrollPathIntoView.basic + desc: scrollPathIntoView() works + testing: + - 2d.scrollPathIntoView.basic + code: | + var div = document.createElement('div'); + div.style.cssText = 'width: 200vw; height: 200vh'; + document.body.appendChild(div); + canvas.style.cssText = 'position: absolute; top: 100px; left: 200px; border: none;'; + window.scrollTo(0, 0); + + ctx.beginPath(); + ctx.rect(4, 8, 16, 32); + ctx.scrollPathIntoView(); + var rect = canvas.getBoundingClientRect(); + @assert Math.round(rect.top) === -8; + @assert Math.round(rect.left) === 200; + +- name: 2d.scrollPathIntoView.verticalLR + desc: scrollPathIntoView() works in vertical-lr writing mode + testing: + - 2d.scrollPathIntoView.basic + code: | + document.documentElement.style.cssText = 'writing-mode: vertical-lr'; + var div = document.createElement('div'); + div.style.cssText = 'width: 200vw; height: 200vh'; + document.body.appendChild(div); + canvas.style.cssText = 'position: absolute; top: 100px; left: 200px; border: none;'; + window.scrollTo(0, 0); + + ctx.beginPath(); + ctx.rect(4, 8, 16, 32); + ctx.scrollPathIntoView(); + var rect = canvas.getBoundingClientRect(); + @assert Math.round(rect.top) === 100; + @assert Math.round(rect.left) === -4; + +- name: 2d.scrollPathIntoView.verticalRL + desc: scrollPathIntoView() works in vertical-rl writing mode + testing: + - 2d.scrollPathIntoView.basic + code: | + document.documentElement.style.cssText = 'writing-mode: vertical-rl'; + var div = document.createElement('div'); + div.style.cssText = 'width: 200vw; height: 200vh'; + document.body.appendChild(div); + canvas.style.cssText = 'position: absolute; top: 100px; right: 200px; border: none;'; + window.scrollTo(0, 0); + + ctx.beginPath(); + ctx.rect(4, 8, 16, 32); + ctx.scrollPathIntoView(); + var rect = canvas.getBoundingClientRect(); + var viewportWidth = document.scrollingElement.clientWidth; + var canvasWidth = canvas.width; + @assert Math.round(rect.top) === 100; + @assert Math.round(rect.right) === viewportWidth + (canvasWidth - 4 - 16); + +- name: 2d.scrollPathIntoView.path + desc: scrollPathIntoView() with path argument works + testing: + - 2d.scrollPathIntoView.basic + code: | + var div = document.createElement('div'); + div.style.cssText = 'width: 200vw; height: 200vh'; + document.body.appendChild(div); + canvas.style.cssText = 'position: absolute; top: 100px; left: 200px; border: none;'; + window.scrollTo(0, 0); + + var path = new Path2D(); + path.rect(4, 8, 16, 32); + ctx.scrollPathIntoView(path); + var rect = canvas.getBoundingClientRect(); + @assert Math.round(rect.top) === -8; + @assert Math.round(rect.left) === 200; diff --git a/tests/wpt/web-platform-tests/accelerometer/Accelerometer-iframe-access.https.html b/tests/wpt/web-platform-tests/accelerometer/Accelerometer-iframe-access.https.html new file mode 100644 index 00000000000..6a8c9bcb7fc --- /dev/null +++ b/tests/wpt/web-platform-tests/accelerometer/Accelerometer-iframe-access.https.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Accelerometer iframe test</title> +<link rel="author" title="Intel" href="http://www.intel.com"> +<link rel="help" href="https://www.w3.org/TR/accelerometer/"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/generic-sensor/generic-sensor-tests.js"></script> +<script src="/generic-sensor/generic-sensor-iframe-tests.sub.js"></script> +<script src="/generic-sensor/generic-sensor-feature-policy-test.sub.js"></script> +<div id="log"></div> +<script> +run_generic_sensor_iframe_tests('Accelerometer'); +run_generic_sensor_iframe_tests('LinearAccelerationSensor'); +run_generic_sensor_iframe_tests('GravitySensor'); +</script> diff --git a/tests/wpt/web-platform-tests/budget-api/interfaces.any.js b/tests/wpt/web-platform-tests/budget-api/interfaces.any.js index 84e8874182a..5a87b3f8a2f 100644 --- a/tests/wpt/web-platform-tests/budget-api/interfaces.any.js +++ b/tests/wpt/web-platform-tests/budget-api/interfaces.any.js @@ -11,14 +11,9 @@ promise_test(async () => { const idl = await fetch('/interfaces/budget-api.idl').then(r => r.text()); const idlArray = new IdlArray(); - idlArray.add_untested_idls(html, { only: [ - 'Navigator', - 'NavigatorContentUtils', - 'NavigatorCookies', - 'NavigatorPlugins', - ] }); - idlArray.add_untested_idls(workers); idlArray.add_idls(idl); + idlArray.add_dependency_idls(html); + idlArray.add_dependency_idls(workers); idlArray.test(); done(); }, 'budget-api interfaces.'); diff --git a/tests/wpt/web-platform-tests/css/css-writing-modes/reference/three-levels-of-orthogonal-flows.html b/tests/wpt/web-platform-tests/css/css-writing-modes/reference/three-levels-of-orthogonal-flows.html new file mode 100644 index 00000000000..65a1618560e --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-writing-modes/reference/three-levels-of-orthogonal-flows.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org"> +<p>The yellow box should be in the top right corner of the hotpink box.</p> +<div style="width:30em; height:30em; background:hotpink;"> + <div style="float:right; writing-mode:vertical-rl; background:yellow;"> + <div style="visibility:hidden;"> + Roses are red,<br> + violets are blue.<br> + All my base<br> + are belong to you.<br> + </div> + </div> + </div> +</div> diff --git a/tests/wpt/web-platform-tests/css/css-writing-modes/reference/two-levels-of-orthogonal-flows-fixed.html b/tests/wpt/web-platform-tests/css/css-writing-modes/reference/two-levels-of-orthogonal-flows-fixed.html new file mode 100644 index 00000000000..93b1627a22f --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-writing-modes/reference/two-levels-of-orthogonal-flows-fixed.html @@ -0,0 +1,8 @@ +<!DOCTYPE html> +<title>Two levels of writing mode roots with text inside, fixed available inline size for inner on outer</title> +<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org"> +<div style="width:10em; border:solid; background:yellow;"> + <div style="padding:3px;"> + This text should be inside a box with a yellow background and a black border. There should be no red. + </div> +</div> diff --git a/tests/wpt/web-platform-tests/css/css-writing-modes/reference/two-levels-of-orthogonal-flows-percentage.html b/tests/wpt/web-platform-tests/css/css-writing-modes/reference/two-levels-of-orthogonal-flows-percentage.html new file mode 100644 index 00000000000..2f00515d2c9 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-writing-modes/reference/two-levels-of-orthogonal-flows-percentage.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<title>Two levels of writing mode roots with text inside, percentage inline size on inner</title> +<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org"> +<p>There should be three lines below. The middle line should have a yellow + background that takes up about 50% of the viewport width (but otherwise be + exactly like the two others, i.e. no extra height or anything like that).</p> +A B C D E F G +<div style="width:50vw; background:yellow;"> + A B C D E F G +</div> +A B C D E F G diff --git a/tests/wpt/web-platform-tests/css/css-writing-modes/reference/two-levels-of-orthogonal-flows.html b/tests/wpt/web-platform-tests/css/css-writing-modes/reference/two-levels-of-orthogonal-flows.html new file mode 100644 index 00000000000..c29f6d94fb0 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-writing-modes/reference/two-levels-of-orthogonal-flows.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<title>Two levels of writing mode roots with text inside, no constraints</title> +<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org"> +<link rel="help" href="https://www.w3.org/TR/css-sizing-3/#intrinsic" title="4. Intrinsic Size Determination"> +<link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#orthogonal-auto" title="7.3.1. Available Space in Orthogonal Flows"> +<p>There should be three lines below. The middle line should have a + yellow background (but otherwise be exactly like the two others, + i.e. no extra height or anything like that)</p> +A B C D E F G +<div style="width:fit-content; background:yellow;"> + A B C D E F G +</div> +A B C D E F G diff --git a/tests/wpt/web-platform-tests/css/css-writing-modes/three-levels-of-orthogonal-flows.html b/tests/wpt/web-platform-tests/css/css-writing-modes/three-levels-of-orthogonal-flows.html new file mode 100644 index 00000000000..d69a328e8b5 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-writing-modes/three-levels-of-orthogonal-flows.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<title>Three levels of writing mode roots with text inside, no constraints</title> +<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org"> +<link rel="help" href="https://www.w3.org/TR/css-sizing-3/#intrinsic" title="4. Intrinsic Size Determination"> +<link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#orthogonal-auto" title="7.3.1. Available Space in Orthogonal Flows"> +<link rel="match" href="reference/three-levels-of-orthogonal-flows.html"> +<p>The yellow box should be in the top right corner of the hotpink box.</p> +<div style="writing-mode:vertical-rl; width:30em; height:30em; background:hotpink;"> + <div style="writing-mode:horizontal-tb;"> + <div style="writing-mode:vertical-rl; background:yellow;"> + <div style="visibility:hidden;"> + Roses are red,<br> + violets are blue.<br> + All my base<br> + are belong to you.<br> + </div> + </div> + </div> +</div> diff --git a/tests/wpt/web-platform-tests/css/css-writing-modes/two-levels-of-orthogonal-flows-fixed.html b/tests/wpt/web-platform-tests/css/css-writing-modes/two-levels-of-orthogonal-flows-fixed.html new file mode 100644 index 00000000000..d9e7d749841 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-writing-modes/two-levels-of-orthogonal-flows-fixed.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<title>Two levels of writing mode roots with text inside, fixed available inline size for inner on outer</title> +<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org"> +<link rel="help" href="https://www.w3.org/TR/css-sizing-3/#intrinsic" title="4. Intrinsic Size Determination"> +<link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#orthogonal-auto" title="7.3.1. Available Space in Orthogonal Flows"> +<link rel="match" href="reference/two-levels-of-orthogonal-flows-fixed.html"> +<div style="writing-mode:vertical-rl; width:10em; border:solid; background:red;"> + <div style="writing-mode:horizontal-tb; padding:3px; background:yellow;"> + This text should be inside a box with a yellow background and a black border. There should be no red. + </div> +</div> diff --git a/tests/wpt/web-platform-tests/css/css-writing-modes/two-levels-of-orthogonal-flows-percentage.html b/tests/wpt/web-platform-tests/css/css-writing-modes/two-levels-of-orthogonal-flows-percentage.html new file mode 100644 index 00000000000..ff65534e78d --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-writing-modes/two-levels-of-orthogonal-flows-percentage.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<title>Two levels of writing mode roots with text inside, percentage inline size on inner</title> +<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org"> +<link rel="help" href="https://www.w3.org/TR/css-sizing-3/#intrinsic" title="4. Intrinsic Size Determination"> +<link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#orthogonal-auto" title="7.3.1. Available Space in Orthogonal Flows"> +<link rel="match" href="reference/two-levels-of-orthogonal-flows-percentage.html"> +<p>There should be three lines below. The middle line should have a yellow + background that takes up about 50% of the viewport width (but otherwise be + exactly like the two others, i.e. no extra height or anything like that).</p> +A B C D E F G +<div style="writing-mode:vertical-rl; background:yellow;"> + <div style="writing-mode:horizontal-tb; width:50%;"> + A B C D E F G + </div> +</div> +A B C D E F G diff --git a/tests/wpt/web-platform-tests/css/css-writing-modes/two-levels-of-orthogonal-flows.html b/tests/wpt/web-platform-tests/css/css-writing-modes/two-levels-of-orthogonal-flows.html new file mode 100644 index 00000000000..da7df0481d8 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-writing-modes/two-levels-of-orthogonal-flows.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<title>Two levels of writing mode roots with text inside, no constraints</title> +<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org"> +<link rel="help" href="https://www.w3.org/TR/css-sizing-3/#intrinsic" title="4. Intrinsic Size Determination"> +<link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#orthogonal-auto" title="7.3.1. Available Space in Orthogonal Flows"> +<link rel="match" href="reference/two-levels-of-orthogonal-flows.html"> +<p>There should be three lines below. The middle line should have a + yellow background (but otherwise be exactly like the two others, + i.e. no extra height or anything like that)</p> +A B C D E F G +<div style="writing-mode:vertical-rl; background:yellow;"> + <div style="writing-mode:horizontal-tb;"> + A B C D E F G + </div> +</div> +A B C D E F G diff --git a/tests/wpt/web-platform-tests/css/tools/w3ctestlib/templates/index.content.tmpl b/tests/wpt/web-platform-tests/css/tools/w3ctestlib/templates/index.content.tmpl index e3bee8aa85b..e32d8fe5672 100644 --- a/tests/wpt/web-platform-tests/css/tools/w3ctestlib/templates/index.content.tmpl +++ b/tests/wpt/web-platform-tests/css/tools/w3ctestlib/templates/index.content.tmpl @@ -6,7 +6,7 @@ [% END %] <dt>Test Coordinator:</dt> <dd>[% suites.$suite.owner %]</dd> - + <p>This is a <strong>[% statusNames.${suites.$suite.status}.title or "ERROR: $suite" %]</strong> version of the [% suites.$suite.title %].</p> @@ -15,7 +15,7 @@ <dt><a href="http://test.csswg.org/harness/suite/[% suites.$suite.harness %]">Enter Data</a></dt> <dt><a href="http://test.csswg.org/harness/review/[% suites.$suite.harness %]">Review Results</a></dt> [% END %] - + [% IF devel %] <p>This build exists to aid in test suite development and contains unreviewed @@ -42,9 +42,9 @@ The appropriate mailing list for submitting tests and bug reports is <a href="http://lists.w3.org/Archives/Public/public-css-testsuite/">public-css-testsuite@w3.org</a>.</p> <p> - To report bugs or feedback about a specific test file, - search for the filename (without extension) in - <a href="https://github.com/w3c/web-platform-tests/issues">Web Platform Tests Issues</a>, + To report bugs or feedback about a specific test file, + search for the filename (without extension) in + <a href="https://github.com/web-platform-tests/wpt/issues">web-platform-tests issues</a>, and file a new issue if necessary with suggested label "wg-css". More information on the contribution process and test guidelines is available on the <a href="http://wiki.csswg.org/test">wiki @@ -88,7 +88,7 @@ features and/or error recovery.</dd> </dl> [% END %] - + <p>Unless the test instructions explicitly indicate otherwise, any occurrence of red in a test indicates test failure.</p> diff --git a/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-abspos-child-002.html b/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-abspos-child-002.html index 2bbb5f0474f..8234085681d 100644 --- a/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-abspos-child-002.html +++ b/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-abspos-child-002.html @@ -11,7 +11,7 @@ </title> <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"> <link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#abspos-items"> - <link rel="match" href="flexbox-abspos-child-001-ref.html"> + <link rel="match" href="flexbox-abspos-child-002-ref.html"> <style> .flex { display: flex; diff --git a/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-feature-policy-test.sub.js b/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-feature-policy-test.sub.js index 94e5347a880..fabd4a7ded3 100644 --- a/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-feature-policy-test.sub.js +++ b/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-feature-policy-test.sub.js @@ -17,6 +17,10 @@ const cross_origin_src = "https://{{domains[www]}}:{{ports[https][0]}}" + same_origin_src; const base_src = "/feature-policy/resources/redirect-on-load.html#"; +function get_feature_policies_for_sensor(sensorType) { + return feature_policies[sensorType]; +} + function run_fp_tests_disabled(sensorName) { const sensorType = self[sensorName]; const featureNameList = feature_policies[sensorName]; diff --git a/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-iframe-tests.sub.js b/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-iframe-tests.sub.js new file mode 100644 index 00000000000..5ad1abf5621 --- /dev/null +++ b/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-iframe-tests.sub.js @@ -0,0 +1,122 @@ +async function send_message_to_iframe(iframe, message, reply) { + if (reply === undefined) { + reply = 'success'; + } + + return new Promise((resolve, reject) => { + let messageHandler = e => { + + if (e.data.command !== message.command) { + return; + } + window.removeEventListener('message', messageHandler); + if (e.data.result === reply) { + resolve(); + } else { + reject(); + } + } + window.addEventListener('message', messageHandler); + iframe.contentWindow.postMessage(message, '*'); + }); +} + +function run_generic_sensor_iframe_tests(sensorName) { + const sensorType = self[sensorName]; + const featurePolicies = get_feature_policies_for_sensor(sensorName); + + sensor_test(async t => { + assert_true(sensorName in self); + const iframe = document.createElement('iframe'); + iframe.allow = featurePolicies.join(';') + ';'; + iframe.src = 'https://{{domains[www1]}}:{{ports[https][0]}}/generic-sensor/resources/iframe_sensor_handler.html'; + + // Create sensor inside cross-origin nested browsing context. + const iframeLoadWatcher = new EventWatcher(t, iframe, 'load'); + document.body.appendChild(iframe); + await iframeLoadWatcher.wait_for('load'); + await send_message_to_iframe(iframe, {command: 'create_sensor', + type: sensorName}); + + // Focus on the main frame and test that sensor recieves readings. + window.focus(); + const sensor = new sensorType(); + const sensorWatcher = new EventWatcher(t, sensor, ['reading']); + sensor.start(); + + await sensorWatcher.wait_for('reading'); + const cachedTimeStamp = sensor.timestamp; + + // Focus on the cross-origin frame and verify that sensor reading updates in + // the top level browsing context are suspended. + iframe.contentWindow.focus(); + await send_message_to_iframe(iframe, {command: 'start_sensor'}); + assert_equals(cachedTimeStamp, sensor.timestamp); + + // Focus on the main frame, verify that sensor reading updates are resumed. + window.focus(); + await sensorWatcher.wait_for('reading'); + assert_greater_than(sensor.timestamp, cachedTimeStamp); + sensor.stop(); + + // Verify that sensor in cross-origin frame is suspended. + await send_message_to_iframe(iframe, {command: 'is_sensor_suspended'}, true); + await send_message_to_iframe(iframe, {command: 'reset_sensor_backend'}); + + // Remove iframe from main document. + iframe.parentNode.removeChild(iframe); + }, `${sensorName}: sensor is suspended and resumed when focus traverses from\ + to cross-origin frame`); + + sensor_test(async t => { + assert_true(sensorName in self); + const iframe = document.createElement('iframe'); + iframe.allow = featurePolicies.join(';') + ';'; + iframe.src = 'https://{{host}}:{{ports[https][0]}}/generic-sensor/resources/iframe_sensor_handler.html'; + + // Create sensor inside same-origin nested browsing context. + const iframeLoadWatcher = new EventWatcher(t, iframe, 'load'); + document.body.appendChild(iframe); + await iframeLoadWatcher.wait_for('load'); + await send_message_to_iframe(iframe, {command: 'create_sensor', + type: sensorName}); + + // Focus on main frame and test that sensor recieves readings. + window.focus(); + const sensor = new sensorType(); + const sensorWatcher = new EventWatcher(t, sensor, ['reading']); + sensor.start(); + await sensorWatcher.wait_for('reading'); + let cachedTimeStamp = sensor.timestamp; + + // Stop sensor in main frame, so that sensorWatcher would not receive + // readings while sensor in iframe is started. Sensors that are active + // and belong to the same-origin context are not suspended, therefore, + // we might get unexpeted 'reading' event, thus, failing the test. + sensor.stop(); + iframe.contentWindow.focus(); + await send_message_to_iframe(iframe, {command: 'start_sensor'}); + + // Start sensor on main frame, verify that readings are updated. + window.focus(); + sensor.start(); + await sensorWatcher.wait_for('reading'); + assert_greater_than(sensor.timestamp, cachedTimeStamp); + cachedTimeStamp = sensor.timestamp; + + // Verify that sensor in nested browsing context is not suspended. + await send_message_to_iframe(iframe, {command: 'is_sensor_suspended'}, false); + + // Verify that sensor in top level browsing context is receiving readings. + iframe.contentWindow.focus(); + sensor.start(); + await sensorWatcher.wait_for('reading'); + assert_greater_than(sensor.timestamp, cachedTimeStamp); + sensor.stop(); + await send_message_to_iframe(iframe, {command: 'reset_sensor_backend'}); + + // Remove iframe from main document. + iframe.parentNode.removeChild(iframe); + }, `${sensorName}: sensor is not suspended when focus traverses from\ + to same-origin frame`); +}
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-tests.js b/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-tests.js index a3896e7b6a1..73135508f91 100644 --- a/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-tests.js +++ b/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-tests.js @@ -33,14 +33,19 @@ let loadChromiumResources = Promise.resolve().then(() => { return chain; }); +async function initialize_generic_sensor_tests() { + if (typeof GenericSensorTest === 'undefined') { + await loadChromiumResources; + } + assert_true(typeof GenericSensorTest !== 'undefined'); + let sensorTest = new GenericSensorTest(); + await sensorTest.initialize(); + return sensorTest; +} + function sensor_test(func, name, properties) { promise_test(async (t) => { - if (typeof GenericSensorTest === 'undefined') { - await loadChromiumResources; - } - assert_true(typeof GenericSensorTest !== 'undefined'); - let sensorTest = new GenericSensorTest(); - await sensorTest.initialize(); + let sensorTest = await initialize_generic_sensor_tests(); try { await func(t); } finally { diff --git a/tests/wpt/web-platform-tests/generic-sensor/resources/iframe_sensor_handler.html b/tests/wpt/web-platform-tests/generic-sensor/resources/iframe_sensor_handler.html new file mode 100644 index 00000000000..12ab1d47b99 --- /dev/null +++ b/tests/wpt/web-platform-tests/generic-sensor/resources/iframe_sensor_handler.html @@ -0,0 +1,63 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>iframe sensor tester</title> +<script src="/resources/testharness.js"></script> +<script src="/generic-sensor/generic-sensor-tests.js"></script> +<script> + let mockBackend = null; + // Minimum frequency supported by the mock backend is 5Hz. Using 200ms + // update period + 50ms threshold. + const maxUpdatePeriod = 250; + let sensor = null; + let lastTimestamp = null; + + window.onmessage = (e) => { + if (e.data.command === 'create_sensor') { + assert_equals(sensor, null); + initialize_generic_sensor_tests().then((backend) => { + mockBackend = backend; + try { + sensor = new self[e.data.type](); + e.source.postMessage({command: e.data.command, + result: 'success'}, '*'); + } catch (e) { + e.source.postMessage({command: e.data.command, result: ''}, '*'); + } + }); + } else if (e.data.command === 'start_sensor') { + assert_not_equals(sensor, null); + try { + sensor.start(); + sensor.onreading = () => lastTimestamp = sensor.timestamp; + let onReadingListener = () => { + e.source.postMessage({command: e.data.command, + result: 'success'}, '*'); + } + sensor.addEventListener('reading', onReadingListener, {once: true}); + } catch (e) { + e.source.postMessage({command: e.data.command, result: ''}, '*'); + } + } else if (e.data.command === 'is_sensor_suspended') { + let cachedTimestamp = lastTimestamp; + let timeoutId = setTimeout(() => { + e.source.postMessage({command: e.data.command, + result: cachedTimestamp === lastTimestamp}, '*'); + }, maxUpdatePeriod); + + let suspendListener = () => { + clearTimeout(timeoutId); + e.source.postMessage({command: e.data.command, + result: cachedTimestamp === lastTimestamp}, '*'); + } + sensor.addEventListener('reading', suspendListener, {once: true}); + } else if (e.data.command === 'reset_sensor_backend') { + if (sensor) { + sensor.stop(); + } + mockBackend.reset().then(() => { + e.source.postMessage({command: e.data.command, + result: 'success'}, '*'); + }); + } + } +</script>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/gyroscope/Gyroscope-iframe-access.https.html b/tests/wpt/web-platform-tests/gyroscope/Gyroscope-iframe-access.https.html new file mode 100644 index 00000000000..02edf4bd232 --- /dev/null +++ b/tests/wpt/web-platform-tests/gyroscope/Gyroscope-iframe-access.https.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Gyroscope iframe test</title> +<link rel="author" title="Intel" href="http://www.intel.com"> +<link rel="help" href="https://www.w3.org/TR/gyroscope/"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/generic-sensor/generic-sensor-tests.js"></script> +<script src="/generic-sensor/generic-sensor-iframe-tests.sub.js"></script> +<script src="/generic-sensor/generic-sensor-feature-policy-test.sub.js"></script> +<div id="log"></div> +<script> + +run_generic_sensor_iframe_tests('Gyroscope'); +</script> diff --git a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html new file mode 100644 index 00000000000..e13d1916580 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html @@ -0,0 +1,10 @@ +<!DOCTYPE HTML> +<html> +<head> +</head> +<body> + <script> + document.location = "window-name-navigation.sub.html?hostname={{domains[www1]}}&shouldhavename=false&sendmessage=true"; + </script> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html index 65662031a04..15a3db91304 100644 --- a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html +++ b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html @@ -1,6 +1,7 @@ <script src='/resources/testharness.js'></script> <script src='/resources/testharnessreport.js'></script> <script> + setup({explicit_done: true}) function process_test_result(passed, test_name) { if ({{GET[sendmessage]}}) { if (window.opener) { @@ -12,6 +13,7 @@ test(function(t) { assert_equals(passed, true); }, test_name); + done(); } } diff --git a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html index 3f26c05fb6e..fb0bb1883f3 100644 --- a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html +++ b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html @@ -1,13 +1,24 @@ <!DOCTYPE HTML> <html> <head> - <!-- window.name should equal "" after a cross-origin main frame navigation. --> <script src='/resources/testharness.js'></script> <script src='/resources/testharnessreport.js'></script> </head> <body> + <button id="button" onclick="popup();">open popup</button> <script> - document.location = "support/window-name-navigation.sub.html?hostname={{domains[www1]}}&shouldhavename=false&sendmessage=false"; + function popup() { + window.popupWin = window.open('support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html', '_blank'); + } + async_test(t => { + t.add_cleanup(() => { + popupWin.close(); + }) + document.getElementById('button').click(); + onmessage = t.step_func(e => { + assert_true(e.data); + }); + }, 'window.name should equal "" after a cross-origin main frame navigation'); </script> </body> </html> diff --git a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-lr.html b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-lr.html new file mode 100644 index 00000000000..57d99440e11 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-lr.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html style="writing-mode: vertical-lr;"> +<head> +<meta charset="UTF-8"> +<title>Fragment Navigation: Scroll to block start position in vertical-lr writing mode</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<div id="test" style="position: absolute; top: 5px; left: 7px; margin: 5px 7px; border-style: solid; border-width: 5px 7px; padding: 5px 7px; height: 5px; width: 7px;"></div> +<div style="width: 200vw;"></div> +<script> +async_test(function (t) { + on_event(window, 'load', function () { + t.step(function () { + window.scrollTo(0, 0); + location.hash = 'test'; + assert_equals(window.scrollX, 14, 'Scroll to the left border edge of #test'); + }); + t.done(); + }); +}, ''); +</script> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-rl.html b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-rl.html new file mode 100644 index 00000000000..60a902199af --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-rl.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html style="writing-mode: vertical-rl;"> +<head> +<meta charset="UTF-8"> +<title>Fragment Navigation: Scroll to block start position in vertical-rl writing mode</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<div id="test" style="position: absolute; top: 5px; right: 7px; margin: 5px 7px; border-style: solid; border-width: 5px 7px; padding: 5px 7px; height: 5px; width: 7px;"></div> +<div style="width: 200vw;"></div> +<script> +async_test(function (t) { + on_event(window, 'load', function () { + t.step(function () { + window.scrollTo(0, 0); + location.hash = 'test'; + assert_equals(window.scrollX, -14, 'Scroll to the right border edge of #test'); + }); + t.done(); + }); +}, ''); +</script> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html new file mode 100644 index 00000000000..c38d2de83bd --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="UTF-8"> +<title>Fragment Navigation: Scroll to block start position</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<div id="test" style="position: absolute; top: 5px; left: 7px; margin: 5px 7px; border-style: solid; border-width: 5px 7px; padding: 5px 7px; height: 5px; width: 7px;"></div> +<div style="height: 200vh;"></div> +<script> +async_test(function (t) { + on_event(window, 'load', function () { + t.step(function () { + window.scrollTo(0, 0); + location.hash = 'test'; + assert_equals(window.scrollY, 10, 'Scroll to the top border edge of #test'); + }); + t.done(); + }); +}, ''); +</script> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_1.html b/tests/wpt/web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_1.html index 11715583dd4..9b59bb05879 100644 --- a/tests/wpt/web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_1.html +++ b/tests/wpt/web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_1.html @@ -13,16 +13,13 @@ clearTimeout(timer); timer = setTimeout(t.step_func( function() { - try { - assert_array_equals(pages, [4, 2], "Pages opened during history navigation"); - t.done(); - } finally { - // win.close(); - } + assert_array_equals(pages, [4, 2], "Pages opened during history navigation"); + t.done(); } ), 500); } ); - t.step(function() {win = window.open("history_entry.html&urls=history_entry.html,history_entry.html,traverse_the_history_1-1.html"); + t.step(function() {win = window.open("history_entry.html?urls=history_entry.html,history_entry.html,traverse_the_history_1-1.html"); + t.add_cleanup(() => { win.close() }); }); </script> diff --git a/tests/wpt/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html b/tests/wpt/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html index af933217336..d3af35c6d7a 100644 --- a/tests/wpt/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html +++ b/tests/wpt/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html @@ -1,14 +1,14 @@ <!doctype html> <html> <head> - <title></title> + <title>document.domain's getter</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script> test(function() { assert_equals(typeof document.domain, "string", "document.domain is a string"); assert_not_equals(document.domain, "", "document.domain is not empty"); - }, "sanity checks"); + }, "basics"); test(function() { assert_equals(document.domain, window.location.hostname, "equals location.hostname"); @@ -16,8 +16,18 @@ test(function() { var doc = new Document(); - assert_equals(doc.domain, "", "new document has empty domain"); - }, "new document"); + assert_equals(doc.domain, window.location.hostname, "equals location.hostname"); + }, "new Document()"); + + async_test(t => { + const client = new XMLHttpRequest(); + client.open("GET", "/common/blank.html"); + client.responseType = "document" + client.send(); + client.onload = t.step_func_done(() => { + assert_equals(client.response.domain, window.location.hostname); + }); + }, "XMLHttpRequest's response document"); </script> </head> <body> diff --git a/tests/wpt/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter.html b/tests/wpt/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter.html index c687906ba15..a55d85dfdf2 100644 --- a/tests/wpt/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter.html +++ b/tests/wpt/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter.html @@ -1,7 +1,7 @@ <!doctype html> <html> <head> - <title></title> + <title>document.domain's setter</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/common/get-host-info.sub.js"></script> @@ -18,12 +18,14 @@ var iframe_url = new URL("support/document_domain_setter_iframe.html", document.location); iframe_url.hostname = REMOTE_HOST; iframe.src = iframe_url; + test(function() { assert_throws("SecurityError", function() { document.domain = SUFFIX_HOST; }); assert_throws("SecurityError", function() { document.domain = "." + SUFFIX_HOST; }); assert_throws("SecurityError", function() { document.domain = REMOTE_HOST; }); assert_throws("SecurityError", function() { document.domain = "example.com"; }); }, "failed setting of document.domain"); + async_test(function(t) { iframe.addEventListener("load", t.step_func_done(function() { // Before setting document.domain, the iframe is not @@ -62,6 +64,12 @@ assert_throws("SecurityError", function() { iframe.contentDocument.open(); }); })); }, "same-origin-domain iframe"); + + test(() => { + assert_throws("SecurityError", () => { (new Document).domain = document.domain }); + assert_throws("SecurityError", () => { document.implementation.createHTMLDocument().domain = document.domain }); + assert_throws("SecurityError", () => { document.implementation.createDocument(null, "").domain = document.domain }); + }, "failed setting of document.domain for documents without browsing context"); </script> </body> </html> diff --git a/tests/wpt/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html b/tests/wpt/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html new file mode 100644 index 00000000000..824795f80b1 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html @@ -0,0 +1,21 @@ +<!doctype html> +<title>Sandboxed document.domain</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> + test(() => { + assert_throws("SecurityError", () => { document.domain = document.domain }); + }); + test(() => { + assert_throws("SecurityError", () => { (new Document).domain = document.domain }); + }); + test(() => { + assert_throws("SecurityError", () => { document.implementation.createHTMLDocument().domain = document.domain }); + }); + test(() => { + assert_throws("SecurityError", () => { document.implementation.createDocument(null, "").domain = document.domain }); + }); + test(() => { + assert_throws("SecurityError", () => { document.createElement("template").content.ownerDocument.domain = document.domain }); + }); +</script> diff --git a/tests/wpt/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html.headers b/tests/wpt/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html.headers new file mode 100644 index 00000000000..82e8023d0ba --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html.headers @@ -0,0 +1 @@ +Content-Security-Policy: sandbox allow-scripts allow-same-origin diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src.html index f1fbe34c596..49e956565cc 100644 --- a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src.html +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src.html @@ -8,7 +8,7 @@ <script> async_test(function(t) { var img = document.getElementById("brokenurl"); - img.src = "http://also a broken url"; + img.src = "http://["; var errorevent = false; // The errors should be queued in the event loop, so they should only trigger @@ -17,7 +17,7 @@ async_test(function(t) { img.addEventListener('loadend', t.step_func_done(function() { assert_true(errorevent, "error event fired"); })); -}, 'src="http://also a broken url"'); +}, 'src="http://["'); async_test(function(t) { var img = document.getElementById("emptysrc"); diff --git a/tests/wpt/web-platform-tests/interfaces/BackgroundSync.idl b/tests/wpt/web-platform-tests/interfaces/BackgroundSync.idl index 3580e3b09bf..214d3a583b0 100644 --- a/tests/wpt/web-platform-tests/interfaces/BackgroundSync.idl +++ b/tests/wpt/web-platform-tests/interfaces/BackgroundSync.idl @@ -1,6 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT -// Content of this file was automatically extracted from the Web Background Synchronization spec. -// See https://wicg.github.io/BackgroundSync/spec/ +// Content of this file was automatically extracted from the +// "Web Background Synchronization" spec. +// See: https://wicg.github.io/BackgroundSync/spec/ partial interface ServiceWorkerRegistration { readonly attribute SyncManager sync; diff --git a/tests/wpt/web-platform-tests/interfaces/accelerometer.idl b/tests/wpt/web-platform-tests/interfaces/accelerometer.idl index d3db6023ea5..aa1a8409e5b 100644 --- a/tests/wpt/web-platform-tests/interfaces/accelerometer.idl +++ b/tests/wpt/web-platform-tests/interfaces/accelerometer.idl @@ -1,3 +1,8 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the +// "Accelerometer" spec. +// See: https://w3c.github.io/accelerometer/ + [Constructor(optional AccelerometerSensorOptions options), SecureContext, Exposed=Window] interface Accelerometer : Sensor { diff --git a/tests/wpt/web-platform-tests/interfaces/ambient-light.idl b/tests/wpt/web-platform-tests/interfaces/ambient-light.idl index 0bdc9cb9e3b..46c89ee8e40 100644 --- a/tests/wpt/web-platform-tests/interfaces/ambient-light.idl +++ b/tests/wpt/web-platform-tests/interfaces/ambient-light.idl @@ -1,3 +1,8 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the +// "Ambient Light Sensor" spec. +// See: https://w3c.github.io/ambient-light/ + [Constructor(optional SensorOptions sensorOptions), SecureContext, Exposed=Window] interface AmbientLightSensor : Sensor { readonly attribute double? illuminance; diff --git a/tests/wpt/web-platform-tests/interfaces/budget-api.idl b/tests/wpt/web-platform-tests/interfaces/budget-api.idl index a7fd1f24526..957e8f2d312 100644 --- a/tests/wpt/web-platform-tests/interfaces/budget-api.idl +++ b/tests/wpt/web-platform-tests/interfaces/budget-api.idl @@ -1,6 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT -// Content of this file was automatically extracted from the budget-api spec. -// See https://wicg.github.io/budget-api/ +// Content of this file was automatically extracted from the +// "Web Budget API" spec. +// See: https://wicg.github.io/budget-api/ [Exposed=Window] partial interface Navigator { diff --git a/tests/wpt/web-platform-tests/interfaces/clipboard-apis.idl b/tests/wpt/web-platform-tests/interfaces/clipboard-apis.idl index 4679483f852..2fb5ab4d38a 100644 --- a/tests/wpt/web-platform-tests/interfaces/clipboard-apis.idl +++ b/tests/wpt/web-platform-tests/interfaces/clipboard-apis.idl @@ -1,3 +1,8 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the +// "Clipboard API and events" spec. +// See: https://w3c.github.io/clipboard-apis/ + dictionary ClipboardEventInit : EventInit { DataTransfer? clipboardData = null; }; diff --git a/tests/wpt/web-platform-tests/interfaces/compat.idl b/tests/wpt/web-platform-tests/interfaces/compat.idl index bbb268b60f0..a0dbc7898d6 100644 --- a/tests/wpt/web-platform-tests/interfaces/compat.idl +++ b/tests/wpt/web-platform-tests/interfaces/compat.idl @@ -1,6 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT -// Content of this file was automatically extracted from the compat spec. -// See https://compat.spec.whatwg.org/ +// Content of this file was automatically extracted from the +// "Compatibility Standard" spec. +// See: https://compat.spec.whatwg.org/ partial interface Window { readonly attribute short orientation; diff --git a/tests/wpt/web-platform-tests/interfaces/css-font-loading.idl b/tests/wpt/web-platform-tests/interfaces/css-font-loading.idl index 56091017172..3b5a2bc50be 100644 --- a/tests/wpt/web-platform-tests/interfaces/css-font-loading.idl +++ b/tests/wpt/web-platform-tests/interfaces/css-font-loading.idl @@ -1,3 +1,8 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the +// "CSS Font Loading Module Level 3" spec. +// See: https://drafts.csswg.org/css-font-loading/ + typedef (ArrayBuffer or ArrayBufferView) BinaryData; dictionary FontFaceDescriptors { diff --git a/tests/wpt/web-platform-tests/interfaces/entries-api.idl b/tests/wpt/web-platform-tests/interfaces/entries-api.idl index 8e177e1d4d5..3e5b63cf33c 100644 --- a/tests/wpt/web-platform-tests/interfaces/entries-api.idl +++ b/tests/wpt/web-platform-tests/interfaces/entries-api.idl @@ -1,6 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT -// Content of this file was automatically extracted from the File and Directory Entries API spec. -// See https://wicg.github.io/entries-api/ +// Content of this file was automatically extracted from the +// "File and Directory Entries API" spec. +// See: https://wicg.github.io/entries-api/ partial interface File { readonly attribute USVString webkitRelativePath; diff --git a/tests/wpt/web-platform-tests/interfaces/feature-policy.idl b/tests/wpt/web-platform-tests/interfaces/feature-policy.idl index f11815ac543..34d92778624 100644 --- a/tests/wpt/web-platform-tests/interfaces/feature-policy.idl +++ b/tests/wpt/web-platform-tests/interfaces/feature-policy.idl @@ -1,6 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT -// Content of this file was automatically extracted from the Feature Policy spec. -// See https://wicg.github.io/feature-policy/ +// Content of this file was automatically extracted from the +// "Feature Policy" spec. +// See: https://wicg.github.io/feature-policy/ partial interface HTMLIFrameElement { [CEReactions] attribute DOMString allow; diff --git a/tests/wpt/web-platform-tests/interfaces/fetch.idl b/tests/wpt/web-platform-tests/interfaces/fetch.idl index 18514856bee..ec68a6d79b6 100644 --- a/tests/wpt/web-platform-tests/interfaces/fetch.idl +++ b/tests/wpt/web-platform-tests/interfaces/fetch.idl @@ -1,3 +1,8 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the +// "Fetch Standard" spec. +// See: https://fetch.spec.whatwg.org/ + typedef (sequence<sequence<ByteString>> or record<ByteString, ByteString>) HeadersInit; [Constructor(optional HeadersInit init), diff --git a/tests/wpt/web-platform-tests/interfaces/fullscreen.idl b/tests/wpt/web-platform-tests/interfaces/fullscreen.idl index 61710f01ee7..4b75bcde632 100644 --- a/tests/wpt/web-platform-tests/interfaces/fullscreen.idl +++ b/tests/wpt/web-platform-tests/interfaces/fullscreen.idl @@ -1,3 +1,8 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the +// "Fullscreen API Standard" spec. +// See: https://fullscreen.spec.whatwg.org/ + partial interface Element { Promise<void> requestFullscreen(); diff --git a/tests/wpt/web-platform-tests/interfaces/geolocation-sensor.idl b/tests/wpt/web-platform-tests/interfaces/geolocation-sensor.idl index 28508db389c..7ee623959fe 100644 --- a/tests/wpt/web-platform-tests/interfaces/geolocation-sensor.idl +++ b/tests/wpt/web-platform-tests/interfaces/geolocation-sensor.idl @@ -1,3 +1,8 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the +// "Geolocation Sensor" spec. +// See: https://wicg.github.io/geolocation-sensor/ + [Constructor(optional GeolocationSensorOptions options), SecureContext, Exposed=Window] interface GeolocationSensor : Sensor { static Promise<GeolocationSensorReading> read(optional ReadOptions readOptions); diff --git a/tests/wpt/web-platform-tests/interfaces/geometry.idl b/tests/wpt/web-platform-tests/interfaces/geometry.idl index be1d56b26dc..b91eb649c7e 100644 --- a/tests/wpt/web-platform-tests/interfaces/geometry.idl +++ b/tests/wpt/web-platform-tests/interfaces/geometry.idl @@ -1,6 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT -// Content of this file was automatically extracted from the Geometry Interfaces spec. -// See https://drafts.fxtf.org/geometry/ +// Content of this file was automatically extracted from the +// "Geometry Interfaces Module Level 1" spec. +// See: https://drafts.fxtf.org/geometry/ [Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, optional unrestricted double z = 0, optional unrestricted double w = 1), diff --git a/tests/wpt/web-platform-tests/interfaces/gyroscope.idl b/tests/wpt/web-platform-tests/interfaces/gyroscope.idl index 5dbb2eae06d..66303fe2833 100644 --- a/tests/wpt/web-platform-tests/interfaces/gyroscope.idl +++ b/tests/wpt/web-platform-tests/interfaces/gyroscope.idl @@ -1,3 +1,8 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the +// "Gyroscope" spec. +// See: https://w3c.github.io/gyroscope/ + [Constructor(optional GyroscopeSensorOptions sensorOptions), SecureContext, Exposed=Window] interface Gyroscope : Sensor { readonly attribute double? x; diff --git a/tests/wpt/web-platform-tests/interfaces/keyboard-lock.idl b/tests/wpt/web-platform-tests/interfaces/keyboard-lock.idl index 771c716ccad..4ffffd43717 100644 --- a/tests/wpt/web-platform-tests/interfaces/keyboard-lock.idl +++ b/tests/wpt/web-platform-tests/interfaces/keyboard-lock.idl @@ -1,3 +1,8 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the +// "Keyboard Lock" spec. +// See: https://w3c.github.io/keyboard-lock/ + partial interface Navigator { [SecureContext, SameObject] readonly attribute Keyboard keyboard; }; diff --git a/tests/wpt/web-platform-tests/interfaces/magnetometer.idl b/tests/wpt/web-platform-tests/interfaces/magnetometer.idl index a9ef069276a..7a558f8c5cc 100644 --- a/tests/wpt/web-platform-tests/interfaces/magnetometer.idl +++ b/tests/wpt/web-platform-tests/interfaces/magnetometer.idl @@ -1,3 +1,8 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the +// "Magnetometer" spec. +// See: https://w3c.github.io/magnetometer/ + [Constructor(optional MagnetometerSensorOptions sensorOptions), SecureContext, Exposed=Window] interface Magnetometer : Sensor { diff --git a/tests/wpt/web-platform-tests/interfaces/payment-request.idl b/tests/wpt/web-platform-tests/interfaces/payment-request.idl index 3720811db38..94e1cf91f8c 100644 --- a/tests/wpt/web-platform-tests/interfaces/payment-request.idl +++ b/tests/wpt/web-platform-tests/interfaces/payment-request.idl @@ -134,4 +134,4 @@ interface PaymentRequestUpdateEvent : Event { void updateWith(Promise<PaymentDetailsUpdate> detailsPromise); }; dictionary PaymentRequestUpdateEventInit : EventInit { -};
\ No newline at end of file +}; diff --git a/tests/wpt/web-platform-tests/interfaces/proximity.idl b/tests/wpt/web-platform-tests/interfaces/proximity.idl index 89397290544..b77baa941c0 100644 --- a/tests/wpt/web-platform-tests/interfaces/proximity.idl +++ b/tests/wpt/web-platform-tests/interfaces/proximity.idl @@ -1,3 +1,8 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the +// "Proximity Sensor" spec. +// See: https://w3c.github.io/proximity/ + [Constructor(optional SensorOptions sensorOptions), SecureContext, Exposed=Window] interface ProximitySensor : Sensor { readonly attribute double? distance; diff --git a/tests/wpt/web-platform-tests/interfaces/storage.idl b/tests/wpt/web-platform-tests/interfaces/storage.idl index cbaf9d0cb55..33ce213b954 100644 --- a/tests/wpt/web-platform-tests/interfaces/storage.idl +++ b/tests/wpt/web-platform-tests/interfaces/storage.idl @@ -1,6 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT -// Content of this file was automatically extracted from the Storage spec. -// See https://storage.spec.whatwg.org/ +// Content of this file was automatically extracted from the +// "Storage Standard" spec. +// See: https://storage.spec.whatwg.org/ [SecureContext] interface mixin NavigatorStorage { diff --git a/tests/wpt/web-platform-tests/interfaces/uievents.idl b/tests/wpt/web-platform-tests/interfaces/uievents.idl index a273887827e..5e2a1871653 100644 --- a/tests/wpt/web-platform-tests/interfaces/uievents.idl +++ b/tests/wpt/web-platform-tests/interfaces/uievents.idl @@ -1,6 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT -// Content of this file was automatically extracted from the UI Events spec. -// See https://w3c.github.io/uievents/ +// Content of this file was automatically extracted from the +// "UI Events" spec. +// See: https://w3c.github.io/uievents/ [Constructor(DOMString type, optional UIEventInit eventInitDict), Exposed=Window] interface UIEvent : Event { diff --git a/tests/wpt/web-platform-tests/interfaces/url.idl b/tests/wpt/web-platform-tests/interfaces/url.idl index aefaa56cf3e..f1a6276f885 100644 --- a/tests/wpt/web-platform-tests/interfaces/url.idl +++ b/tests/wpt/web-platform-tests/interfaces/url.idl @@ -1,3 +1,8 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the +// "URL Standard" spec. +// See: https://url.spec.whatwg.org/ + [Constructor(USVString url, optional USVString base), Exposed=(Window,Worker), LegacyWindowAlias=webkitURL] diff --git a/tests/wpt/web-platform-tests/interfaces/web-animations.idl b/tests/wpt/web-platform-tests/interfaces/web-animations.idl index f5683f54d23..b0c6b642d74 100644 --- a/tests/wpt/web-platform-tests/interfaces/web-animations.idl +++ b/tests/wpt/web-platform-tests/interfaces/web-animations.idl @@ -1,6 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT -// Content of this file was automatically extracted from the Web Animations spec. -// See https://drafts.csswg.org/web-animations/ +// Content of this file was automatically extracted from the +// "Web Animations" spec. +// See: https://w3c.github.io/web-animations/ [Exposed=Window] interface AnimationTimeline { diff --git a/tests/wpt/web-platform-tests/interfaces/webvtt.idl b/tests/wpt/web-platform-tests/interfaces/webvtt.idl index d4603d1726b..7032fce096e 100644 --- a/tests/wpt/web-platform-tests/interfaces/webvtt.idl +++ b/tests/wpt/web-platform-tests/interfaces/webvtt.idl @@ -1,6 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT -// Content of this file was automatically extracted from the WebVTT spec. -// See https://w3c.github.io/webvtt/ +// Content of this file was automatically extracted from the +// "WebVTT: The Web Video Text Tracks Format" spec. +// See: https://w3c.github.io/webvtt/ enum AutoKeyword { "auto" }; typedef (double or AutoKeyword) LineAndPositionSetting; diff --git a/tests/wpt/web-platform-tests/lint.whitelist b/tests/wpt/web-platform-tests/lint.whitelist index f3bf0e1fe77..948f1df6606 100644 --- a/tests/wpt/web-platform-tests/lint.whitelist +++ b/tests/wpt/web-platform-tests/lint.whitelist @@ -144,6 +144,7 @@ SET TIMEOUT: encrypted-media/polyfill/clearkey-polyfill.js SET TIMEOUT: encrypted-media/scripts/playback-temporary-events.js SET TIMEOUT: eventsource/eventsource-close.htm SET TIMEOUT: eventsource/eventsource-request-cancellation.htm +SET TIMEOUT: generic-sensor/resources/iframe_sensor_handler.html SET TIMEOUT: html/browsers/browsing-the-web/history-traversal/* SET TIMEOUT: html/browsers/browsing-the-web/navigating-across-documents/* SET TIMEOUT: html/browsers/browsing-the-web/scroll-to-fragid/* diff --git a/tests/wpt/web-platform-tests/magnetometer/Magnetometer-iframe-access.https.html b/tests/wpt/web-platform-tests/magnetometer/Magnetometer-iframe-access.https.html new file mode 100644 index 00000000000..04c9800fc01 --- /dev/null +++ b/tests/wpt/web-platform-tests/magnetometer/Magnetometer-iframe-access.https.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Magnetometer iframe test</title> +<link rel="author" title="Intel" href="http://www.intel.com"> +<link rel="help" href="https://www.w3.org/TR/magnetometer/"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/generic-sensor/generic-sensor-tests.js"></script> +<script src="/generic-sensor/generic-sensor-iframe-tests.sub.js"></script> +<script src="/generic-sensor/generic-sensor-feature-policy-test.sub.js"></script> +<div id="log"></div> +<script> + +run_generic_sensor_iframe_tests('Magnetometer'); +run_generic_sensor_iframe_tests('UncalibratedMagnetometer'); +</script> diff --git a/tests/wpt/web-platform-tests/offscreen-canvas/convert-to-blob/offscreencanvas.convert.to.blob.w.html b/tests/wpt/web-platform-tests/offscreen-canvas/convert-to-blob/offscreencanvas.convert.to.blob.w.html index a6c4b4b7f93..573236f3ebc 100644 --- a/tests/wpt/web-platform-tests/offscreen-canvas/convert-to-blob/offscreencanvas.convert.to.blob.w.html +++ b/tests/wpt/web-platform-tests/offscreen-canvas/convert-to-blob/offscreencanvas.convert.to.blob.w.html @@ -112,10 +112,11 @@ self.onmessage = function(e) { </script> <script> -function makeWorker(script) -{ - var blob = new Blob([script]); - return new Worker(URL.createObjectURL(blob)); +function makeWorker(test) { + var blob = new Blob([document.getElementById("myWorker").textContent]); + var worker = new Worker(URL.createObjectURL(blob)); + worker.onerror = test.unreached_func("error"); + return worker; } function drawCanvas(ctx) @@ -190,7 +191,7 @@ function compareWithToBlob(t, typeVal, qualityVal, blob2) } async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func(function(msg) { compareWithToBlob(t, "empty", "empty", msg.data); })); @@ -198,7 +199,7 @@ async_test(function(t) { }, "Test that convertToBlob with default arguments produces correct result in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func(function(msg) { compareWithToBlob(t, "empty", 1.0, msg.data); })); @@ -206,7 +207,7 @@ async_test(function(t) { }, "Test that convertToBlob with default type/1.0 quality produces correct result in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func(function(msg) { compareWithToBlob(t, "empty", 0.2, msg.data); })); @@ -214,7 +215,7 @@ async_test(function(t) { }, "Test that convertToBlob with default type/0.2 quality produces correct result in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func(function(msg) { compareWithToBlob(t, "image/png", "empty", msg.data); })); @@ -222,7 +223,7 @@ async_test(function(t) { }, "Test that convertToBlob with png/default quality produces correct result in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func(function(msg) { compareWithToBlob(t, "image/png", 1.0, msg.data); })); @@ -230,7 +231,7 @@ async_test(function(t) { }, "Test that convertToBlob with png/1.0 quality produces correct result in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func(function(msg) { compareWithToBlob(t, "image/png", 0.2, msg.data); })); @@ -238,7 +239,7 @@ async_test(function(t) { }, "Test that convertToBlob with png/0.2 quality produces correct result in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func(function(msg) { compareWithToBlob(t, "image/jpeg", "empty", msg.data); })); @@ -246,7 +247,7 @@ async_test(function(t) { }, "Test that convertToBlob with jpeg/default quality produces correct result in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func(function(msg) { compareWithToBlob(t, "image/jpeg", 1.0, msg.data); })); @@ -254,7 +255,7 @@ async_test(function(t) { }, "Test that convertToBlob with jpeg/1.0 quality produces correct result in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func(function(msg) { compareWithToBlob(t, "image/jpeg", 0.2, msg.data); })); @@ -262,7 +263,7 @@ async_test(function(t) { }, "Test that convertToBlob with jpeg/0.2 quality produces correct result in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func(function(msg) { compareWithToBlob(t, "image/webp", "empty", msg.data); })); @@ -270,7 +271,7 @@ async_test(function(t) { }, "Test that convertToBlob with webp/default quality produces correct result in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func(function(msg) { compareWithToBlob(t, "image/webp", 1.0, msg.data); })); @@ -278,7 +279,7 @@ async_test(function(t) { }, "Test that convertToBlob with webp/1.0 quality produces correct result in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func(function(msg) { compareWithToBlob(t, "image/webp", 0.2, msg.data); })); @@ -286,7 +287,7 @@ async_test(function(t) { }, "Test that convertToBlob with webp/0.2 quality produces correct result in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { if (msg.data == true || msg.data == false) assert_true(msg.data); @@ -295,7 +296,7 @@ async_test(function(t) { }, "Test that call convertToBlob on a detached OffscreenCanvas throws exception in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { if (msg.data == true || msg.data == false) assert_true(msg.data); diff --git a/tests/wpt/web-platform-tests/offscreen-canvas/the-offscreen-canvas/offscreencanvas.commit.w.html b/tests/wpt/web-platform-tests/offscreen-canvas/the-offscreen-canvas/offscreencanvas.commit.w.html index 3b1eac8c9ff..70120978723 100644 --- a/tests/wpt/web-platform-tests/offscreen-canvas/the-offscreen-canvas/offscreencanvas.commit.w.html +++ b/tests/wpt/web-platform-tests/offscreen-canvas/the-offscreen-canvas/offscreencanvas.commit.w.html @@ -49,16 +49,18 @@ function verifyPlaceholder(placeholder) { _assertPixel(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255"); } -function makeWorker(script) { - var blob = new Blob([script]); - return new Worker(URL.createObjectURL(blob)); +function makeWorker(test) { + var blob = new Blob([document.getElementById("myWorker").textContent]); + var worker = new Worker(URL.createObjectURL(blob)); + worker.onerror = test.unreached_func("error"); + return worker; } async_test(function(t) { var placeholder = document.createElement('canvas'); placeholder.width = placeholder.height = 10; var offscreenCanvas = placeholder.transferControlToOffscreen(); - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { assert_true(msg.data); verifyPlaceholder(placeholder); @@ -67,7 +69,7 @@ async_test(function(t) { }, "Test that calling OffscreenCanvas's commit pushes its contents to its placeholder."); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { assert_true(msg.data); })); diff --git a/tests/wpt/web-platform-tests/offscreen-canvas/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.w.html b/tests/wpt/web-platform-tests/offscreen-canvas/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.w.html index bd284905743..530fa166cf5 100644 --- a/tests/wpt/web-platform-tests/offscreen-canvas/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.w.html +++ b/tests/wpt/web-platform-tests/offscreen-canvas/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.w.html @@ -109,10 +109,11 @@ self.onmessage = function(e) { </script> <script> -function makeWorker(script) -{ - var blob = new Blob([script]); - return new Worker(URL.createObjectURL(blob)); +function makeWorker(test) { + var blob = new Blob([document.getElementById("myWorker").textContent]); + var worker = new Worker(URL.createObjectURL(blob)); + worker.onerror = test.unreached_func("error"); + return worker; } function drawImageBitmap(image, x, y) @@ -126,7 +127,7 @@ function drawImageBitmap(image, x, y) } async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(); worker.addEventListener('message', t.step_func_done(function(msg) { assert_true(msg.data); })); @@ -134,7 +135,7 @@ async_test(function(t) { }, "Test that transferToImageBitmap returns an ImageBitmap with correct width and height in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { var clr = drawImageBitmap(msg.data, 50, 25); assert_array_equals(clr, [0, 255, 0, 255]); @@ -143,7 +144,7 @@ async_test(function(t) { }, "Test that transferToImageBitmap returns an ImageBitmap with correct color in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { var clr = drawImageBitmap(msg.data, 50, 25); assert_array_equals(clr, [0, 0, 0, 0]); @@ -152,7 +153,7 @@ async_test(function(t) { }, "Test that call transferToImageBitmap twice returns an ImageBitmap with correct color in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { var clr = drawImageBitmap(msg.data, 50, 25); assert_array_equals(clr, [0, 0, 0, 255]); @@ -161,7 +162,7 @@ async_test(function(t) { }, "Test that call transferToImageBitmap twice on a alpha-disabled context returns an ImageBitmap with correct color in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { assert_true(msg.data); })); @@ -169,7 +170,7 @@ async_test(function(t) { }, "Test that transferToImageBitmap won't change context's property in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { var clr1 = drawImageBitmap(msg.data, 23, 25); assert_array_equals(clr1, [0, 255, 0, 255]); @@ -180,7 +181,7 @@ async_test(function(t) { }, "Test that call transferToImageBitmap preserves transform in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { if (msg.data == true || msg.data == false) assert_true(msg.data); @@ -189,7 +190,7 @@ async_test(function(t) { }, "Test that call transferToImageBitmap on a detached OffscreenCanvas throws an exception in a worker"); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { assert_true(msg.data); })); diff --git a/tests/wpt/web-platform-tests/offscreen-canvas/the-offscreen-canvas/offscreencanvas.transferrable.w.html b/tests/wpt/web-platform-tests/offscreen-canvas/the-offscreen-canvas/offscreencanvas.transferrable.w.html index 506eccca449..813290adad1 100644 --- a/tests/wpt/web-platform-tests/offscreen-canvas/the-offscreen-canvas/offscreencanvas.transferrable.w.html +++ b/tests/wpt/web-platform-tests/offscreen-canvas/the-offscreen-canvas/offscreencanvas.transferrable.w.html @@ -79,14 +79,15 @@ self.onmessage = function(e) { </script> <script> -function makeWorker(script) -{ - var blob = new Blob([script]); - return new Worker(URL.createObjectURL(blob)); +function makeWorker(test) { + var blob = new Blob([document.getElementById("myWorker").textContent]); + var worker = new Worker(URL.createObjectURL(blob)); + worker.onerror = test.unreached_func("error"); + return worker; } async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { assert_equals(msg.data.width, 10); assert_equals(msg.data.height, 10); @@ -95,7 +96,7 @@ async_test(function(t) { }, "Test that OffscreenCanvas's size is correct after being transferred from a worker."); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { assert_true(msg.data); })); @@ -103,7 +104,7 @@ async_test(function(t) { }, "Test that transfer an OffscreenCanvas that has a 2d context throws exception in a worker."); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { assert_true(msg.data); })); @@ -111,7 +112,7 @@ async_test(function(t) { }, "Test that transfer an OffscreenCanvas that has a webgl context throws exception in a worker."); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { if (msg.data == true || msg.data == false) assert_true(msg.data); @@ -120,7 +121,7 @@ async_test(function(t) { }, "Test that transfer an OffscreenCanvas twice throws exception in a worker."); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { if (msg.data == true || msg.data == false) assert_true(msg.data); @@ -129,7 +130,7 @@ async_test(function(t) { }, "Test that calling getContext('2d') on a detached OffscreenCanvas throws exception in a worker."); async_test(function(t) { - var worker = makeWorker(document.getElementById("myWorker").textContent); + var worker = makeWorker(t); worker.addEventListener('message', t.step_func_done(function(msg) { if (msg.data == true || msg.data == false) assert_true(msg.data); diff --git a/tests/wpt/web-platform-tests/orientation-sensor/AbsoluteOrientationSensor-iframe-access.https.html b/tests/wpt/web-platform-tests/orientation-sensor/AbsoluteOrientationSensor-iframe-access.https.html new file mode 100644 index 00000000000..5fe1e528590 --- /dev/null +++ b/tests/wpt/web-platform-tests/orientation-sensor/AbsoluteOrientationSensor-iframe-access.https.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>AbsoluteOrientationSensor iframe test</title> +<link rel="author" title="Intel" href="http://www.intel.com"> +<link rel="help" href="https://www.w3.org/TR/orientation-sensor/"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/generic-sensor/generic-sensor-tests.js"></script> +<script src="/generic-sensor/generic-sensor-iframe-tests.sub.js"></script> +<script src="/generic-sensor/generic-sensor-feature-policy-test.sub.js"></script> +<div id="log"></div> +<script> + +run_generic_sensor_iframe_tests('AbsoluteOrientationSensor'); +</script> diff --git a/tests/wpt/web-platform-tests/orientation-sensor/RelativeOrientationSensor-iframe-access.https.html b/tests/wpt/web-platform-tests/orientation-sensor/RelativeOrientationSensor-iframe-access.https.html new file mode 100644 index 00000000000..95b57647ddb --- /dev/null +++ b/tests/wpt/web-platform-tests/orientation-sensor/RelativeOrientationSensor-iframe-access.https.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>RelativeOrientationSensor iframe test</title> +<link rel="author" title="Intel" href="http://www.intel.com"> +<link rel="help" href="https://www.w3.org/TR/orientation-sensor/"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/generic-sensor/generic-sensor-tests.js"></script> +<script src="/generic-sensor/generic-sensor-iframe-tests.sub.js"></script> +<script src="/generic-sensor/generic-sensor-feature-policy-test.sub.js"></script> +<div id="log"></div> +<script> + +run_generic_sensor_iframe_tests('RelativeOrientationSensor'); +</script> diff --git a/tests/wpt/web-platform-tests/resources/test/README.md b/tests/wpt/web-platform-tests/resources/test/README.md index 73885247efc..b756b91797f 100644 --- a/tests/wpt/web-platform-tests/resources/test/README.md +++ b/tests/wpt/web-platform-tests/resources/test/README.md @@ -81,3 +81,10 @@ must include a summary of the expected results as a JSON string within a "type": "complete" } </script> + +`testharness.js` is expected to function consistently in a number of +distinct environments. In order to verify this expectation, each functional +test may be executed under a number of distinct conditions. These conditions +are applied using WPT's "test variants" pattern. The available variants are +defined in the `variants.js` file; this file must be included before +`testharness.js`. Every test must specify at least one variant. diff --git a/tests/wpt/web-platform-tests/resources/test/conftest.py b/tests/wpt/web-platform-tests/resources/test/conftest.py index dc645940d6a..91f4691e39d 100644 --- a/tests/wpt/web-platform-tests/resources/test/conftest.py +++ b/tests/wpt/web-platform-tests/resources/test/conftest.py @@ -12,6 +12,7 @@ ENC = 'utf8' HERE = os.path.dirname(os.path.abspath(__file__)) WPT_ROOT = os.path.normpath(os.path.join(HERE, '..', '..')) HARNESS = os.path.join(HERE, 'harness.html') +TEST_TYPES = ('functional', 'unit') def pytest_addoption(parser): parser.addoption("--binary", action="store", default=None, help="path to browser binary") @@ -32,12 +33,23 @@ def pytest_configure(config): config.add_cleanup(config.server.stop) config.add_cleanup(config.driver.quit) +def resolve_uri(context, uri): + if uri.startswith('/'): + base = WPT_ROOT + path = uri[1:] + else: + base = os.path.dirname(context) + path = uri + + return os.path.exists(os.path.join(base, path)) + class HTMLItem(pytest.Item, pytest.Collector): def __init__(self, filename, test_type, parent): self.filename = filename self.type = test_type + self.variants = [] - if test_type not in ('functional', 'unit'): + if test_type not in TEST_TYPES: raise ValueError('Unrecognized test type: "%s"' % test_type) with io.open(filename, encoding=ENC) as f: @@ -45,20 +57,36 @@ class HTMLItem(pytest.Item, pytest.Collector): parsed = html5lib.parse(markup, namespaceHTMLElements=False) name = None + includes_variants_script = False self.expected = None for element in parsed.getiterator(): if not name and element.tag == 'title': name = element.text continue - if element.attrib.get('id') == 'expected': - self.expected = json.loads(unicode(element.text)) + if element.tag == 'meta' and element.attrib.get('name') == 'variant': + self.variants.append(element.attrib.get('content')) continue + if element.tag == 'script': + if element.attrib.get('id') == 'expected': + self.expected = json.loads(unicode(element.text)) + + src = element.attrib.get('src', '') + + if 'variants.js' in src: + includes_variants_script = True + if not resolve_uri(filename, src): + raise ValueError('Could not resolve path "%s" from %s' % (src, filename)) if not name: raise ValueError('No name found in file: %s' % filename) - elif self.type == 'functional' and not self.expected: - raise ValueError('Functional tests must specify expected report data') + elif self.type == 'functional': + if not self.expected: + raise ValueError('Functional tests must specify expected report data') + if not includes_variants_script: + raise ValueError('No variants script found in file: %s' % filename) + if len(self.variants) == 0: + raise ValueError('No test variants specified in file %s' % filename) elif self.type == 'unit' and self.expected: raise ValueError('Unit tests must not specify expected report data') @@ -95,12 +123,17 @@ class HTMLItem(pytest.Item, pytest.Collector): assert test[u'status_string'] == u'PASS', msg def _run_functional_test(self): + for variant in self.variants: + self._run_functional_test_variant(variant) + + def _run_functional_test_variant(self, variant): driver = self.session.config.driver server = self.session.config.server driver.get(server.url(HARNESS)) - actual = driver.execute_async_script('runTest("%s", "foo", arguments[0])' % server.url(str(self.filename))) + test_url = server.url(str(self.filename) + variant) + actual = driver.execute_async_script('runTest("%s", "foo", arguments[0])' % test_url) # Test object ordering is not guaranteed. This weak assertion verifies # that the indices are unique and sequential diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup.html index 468319fdbea..31fe19c4bce 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Test#add_cleanup</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> </head> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup_count.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup_count.html index 75f97821918..03f6f11e329 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup_count.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup_count.html @@ -1,7 +1,9 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content="?keep-promise"> <title>Test#add_cleanup reported count</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> </head> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup_err.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup_err.html index 5ec6a3fdd08..d9fd1375e9b 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup_err.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup_err.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Test#add_cleanup: error</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> </head> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup_err_multi.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup_err_multi.html index 7556829ae09..7891c12d77a 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup_err_multi.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/add_cleanup_err_multi.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Test#add_cleanup: multiple functions with one in error</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> </head> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/api-tests-1.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/api-tests-1.html index 4d9c774577b..a9d92b12f81 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/api-tests-1.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/api-tests-1.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Sample HTML5 API Tests</title> +<script src="../../variants.js"></script> <meta name="timeout" content="6000"> </head> <body onload="load_test_attr.done()"> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/api-tests-2.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/api-tests-2.html index 0c269029b4f..08a2b893c24 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/api-tests-2.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/api-tests-2.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Sample HTML5 API Tests</title> +<script src="../../variants.js"></script> </head> <body> <h1>Sample HTML5 API Tests</h1> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/api-tests-3.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/api-tests-3.html index 991fc6da670..d32b4d8bc7d 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/api-tests-3.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/api-tests-3.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Sample HTML5 API Tests</title> +<script src="../../variants.js"></script> </head> <script src="/resources/testharness.js"></script> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/force_timeout.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/force_timeout.html index 2058fdb8621..a43759530ad 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/force_timeout.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/force_timeout.html @@ -1,7 +1,9 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content="?keep-promise"> <title>Test#force_timeout</title> +<script src="../../variants.js"></script> </head> <body> <h1>Test#force_timeout</h1> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/generate-callback.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/generate-callback.html index 11d41743b3e..f8faca62778 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/generate-callback.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/generate-callback.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Sample for using generate_tests to create a series of tests that share the same callback.</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> </head> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlDictionary/test_partial_interface_of.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlDictionary/test_partial_interface_of.html index 7bb435708f3..ff07cdef808 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlDictionary/test_partial_interface_of.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlDictionary/test_partial_interface_of.html @@ -3,7 +3,10 @@ <head> <meta charset="utf-8"> + <meta name="variant" content=""> + <meta name="variant" content="?keep-promise"> <title>idlharness: Partial dictionary</title> + <script src="/resources/test/variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/resources/WebIDLParser.js"></script> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_immutable_prototype.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_immutable_prototype.html index ed578bce0a0..7a5b17751bf 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_immutable_prototype.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_immutable_prototype.html @@ -2,7 +2,10 @@ <html> <head> <meta charset="utf-8"> + <meta name="variant" content=""> + <meta name="variant" content="?keep-promise"> <title>idlharness: Immutable prototypes</title> + <script src="../../../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/resources/WebIDLParser.js"></script> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_partial_interface_of.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_partial_interface_of.html index 75019c60da6..f4c634f0782 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_partial_interface_of.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_partial_interface_of.html @@ -3,7 +3,10 @@ <head> <meta charset="utf-8"> + <meta name="variant" content=""> + <meta name="variant" content="?keep-promise"> <title>idlharness: Partail interface</title> + <script src="/resources/test/variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/resources/WebIDLParser.js"></script> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_primary_interface_of.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_primary_interface_of.html index 69542f1d7d7..5ce457cafd4 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_primary_interface_of.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_primary_interface_of.html @@ -2,7 +2,10 @@ <html> <head> <meta charset="utf-8"> + <meta name="variant" content=""> + <meta name="variant" content="?keep-promise"> <title>idlharness: Primary interface</title> + <script src="../../../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/resources/WebIDLParser.js"></script> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_to_json_operation.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_to_json_operation.html index 5c60465bacb..3d05e9aca9c 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_to_json_operation.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/idlharness/IdlInterface/test_to_json_operation.html @@ -2,7 +2,10 @@ <html> <head> <meta charset="utf-8"> + <meta name="variant" content=""> + <meta name="variant" content="?keep-promise"> <title>IdlInterface.prototype.test_to_json_operation()</title> + <script src="../../../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/resources/WebIDLParser.js"></script> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-callback.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-callback.html index f49d0aa6b80..403628fa91f 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-callback.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-callback.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Example with iframe that notifies containing document via callbacks</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> </head> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-consolidate-errors.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-consolidate-errors.html index 67655fd64e7..9ba6e179faf 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-consolidate-errors.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-consolidate-errors.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Example with iframe that consolidates errors via fetch_tests_from_window</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-consolidate-tests.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-consolidate-tests.html index 0fa1f20797d..ccc9eb765c4 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-consolidate-tests.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-consolidate-tests.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Example with iframe that consolidates tests via fetch_tests_from_window</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script> @@ -16,7 +19,7 @@ tests from an <tt>iframe</tt> into the primary document.</p> executing</p> <div id="log"></div> -<iframe id="childContext" src="promise-async.html" style="display:none"></iframe> +<iframe id="childContext" src="promise-async.html?keep-promise" style="display:none"></iframe> <!-- promise-async.html has async tests with promises --> <script> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-msg.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-msg.html index 283a5d98cc3..cd2c26c278e 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-msg.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/iframe-msg.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Example with iframe that notifies containing document via cross document messaging</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> </head> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/order.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/order.html index 686383861a0..ec9978d8980 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/order.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/order.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Ordering</title> +<script src="../../variants.js"></script> <meta name="timeout" content="6000"> </head> <body> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/promise-async.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/promise-async.html index fa82665cf00..d4c62794c4f 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/promise-async.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/promise-async.html @@ -1,7 +1,9 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content="?keep-promise"> <title>Async Tests and Promises</title> +<script src="../../variants.js"></script> </head> <body> <h1>Async Tests and Promises</h1> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/promise.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/promise.html index bbda0112a6a..bdf6dc3ec2a 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/promise.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/promise.html @@ -1,7 +1,9 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content="?keep-promise"> <title>Promise Tests</title> +<script src="../../variants.js"></script> </head> <body> <h1>Promise Tests</h1> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-fail.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-fail.html index ca90aab5adf..5826a2ef15c 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-fail.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-fail.html @@ -1,5 +1,8 @@ <!DOCTYPE HTML> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Example with file_is_test (should fail)</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-no-assertions.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-no-assertions.html index 063a4ca5142..f3140dd492c 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-no-assertions.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-no-assertions.html @@ -1,5 +1,8 @@ <!DOCTYPE HTML> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Example single page test with no asserts</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-no-body.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-no-body.html index 41671b83d7c..82f3e18a44c 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-no-body.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-no-body.html @@ -1,5 +1,8 @@ <!DOCTYPE HTML> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Example single page test with no body</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-pass.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-pass.html index 1376e28b6b5..9d5f776d541 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-pass.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/single-page-test-pass.html @@ -1,5 +1,8 @@ <!DOCTYPE HTML> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Example with file_is_test</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/uncaught-exception-handle.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/uncaught-exception-handle.html index 764b0c4055b..4c960186e0d 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/uncaught-exception-handle.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/uncaught-exception-handle.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Harness Handling Uncaught Exception</title> +<script src="../../variants.js"></script> </head> <script src="/resources/testharness.js"></script> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/uncaught-exception-ignore.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/uncaught-exception-ignore.html index 6bd0ddbb0d2..b6d30eab0f0 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/uncaught-exception-ignore.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/uncaught-exception-ignore.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Harness Ignoring Uncaught Exception</title> +<script src="../../variants.js"></script> </head> <script src="/resources/testharness.js"></script> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/worker-dedicated.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/worker-dedicated.html index dad46761890..79458eee3f3 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/worker-dedicated.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/worker-dedicated.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Dedicated Worker Tests</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> </head> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/worker-service.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/worker-service.html index 2e07746e622..c271e6599c0 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/worker-service.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/worker-service.html @@ -1,7 +1,9 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content="?keep-promise"> <title>Example with a service worker</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> </head> diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/worker-shared.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/worker-shared.html index e26f17dec27..5d098de9105 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/worker-shared.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/worker-shared.html @@ -1,7 +1,10 @@ <!DOCTYPE HTML> <html> <head> +<meta name="variant" content=""> +<meta name="variant" content="?keep-promise"> <title>Example with a shared worker</title> +<script src="../../variants.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> </head> diff --git a/tests/wpt/web-platform-tests/resources/test/variants.js b/tests/wpt/web-platform-tests/resources/test/variants.js new file mode 100644 index 00000000000..611d2780344 --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/test/variants.js @@ -0,0 +1,57 @@ +(function() { + 'use strict'; + var variants = { + /** + * Tests are executed in the absence of the global Promise constructor by + * default in order to verify support for the Server browser engine. + * + * https://github.com/w3c/web-platform-tests/issues/6266 + */ + 'default': { + description: 'Global Promise constructor removed.', + apply: function() { + delete window.Promise; + } + }, + /** + * This variant allows for testing functionality that is fundamentally + * dependent on Promise support, e.g. the `promise_test` function + */ + 'keep-promise': { + description: 'No modification of global environment.', + apply: function() {} + } + }; + var match = window.location.search.match(/\?(.*)$/); + var variantName = (match && match[1]) || 'default'; + + if (!Object.hasOwnProperty.call(variants, variantName)) { + window.location = 'javascript:"Unrecognized variant: ' + variantName + '";'; + document.close(); + return; + } + + if (typeof test === 'function') { + test(function() { + assert_unreached('variants.js must be included before testharness.js'); + }); + } + var variant = variants[variantName]; + + var variantNode = document.createElement('div'); + variantNode.innerHTML = '<p>This testharness.js test was executed with ' + + 'the variant named, "' + variantName + '". ' + variant.description + + '</p><p>Refer to the test harness README file for more information.</p>'; + function onReady() { + if (document.readyState !== 'complete') { + return; + } + + document.body.insertBefore(variantNode, document.body.firstChild); + } + + onReady(); + document.addEventListener('readystatechange', onReady); + + variant.apply(); +}()); diff --git a/tests/wpt/web-platform-tests/screen-orientation/lock-bad-argument.html b/tests/wpt/web-platform-tests/screen-orientation/lock-bad-argument.html index 222b9ab5f94..7717bf69d66 100644 --- a/tests/wpt/web-platform-tests/screen-orientation/lock-bad-argument.html +++ b/tests/wpt/web-platform-tests/screen-orientation/lock-bad-argument.html @@ -1,6 +1,4 @@ <!DOCTYPE html> -<html> -<body> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script> @@ -11,6 +9,8 @@ promise_test(t => { undefined, 123, window, + "", + true, ["portrait-primary", "landscape-primary"], ]; const promisesToReject = invalid_lock_types.map(type => @@ -23,6 +23,4 @@ promise_test(t => { return promise_rejects(t, new TypeError(), screen.orientation.lock()); }, "screen.orientation.lock() must throw when the input is missing."); </script> -</body> -</html> diff --git a/tests/wpt/web-platform-tests/screen-orientation/lock-basic.html b/tests/wpt/web-platform-tests/screen-orientation/lock-basic.html index 022d24be373..5b30459bf7f 100644 --- a/tests/wpt/web-platform-tests/screen-orientation/lock-basic.html +++ b/tests/wpt/web-platform-tests/screen-orientation/lock-basic.html @@ -1,41 +1,64 @@ <!DOCTYPE html> -<html> -<body> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script> - -var previousOrientation = screen.orientation; - -test(function() { - screen.orientation.unlock(); +test(() => { + screen.orientation.unlock(); }, "Test that screen.orientation.unlock() doesn't throw when there is no lock"); -async_test(function(t) { - var orientations = ['any', 'portrait', 'landscape', 'portrait-secondary', - 'landscape-primary', 'landscape-secondary', 'portrait-primary']; +test(() => { + const value = screen.orientation.unlock(); + assert_equals(value, undefined); +}, "Test that screen.orientation.unlock() returns a void value"); - setOrientation = function(idx) { - if( idx == orientations.length) { - screen.orientation.unlock(); - t.done(); - return; - } - (function(i) { - screen.orientation.lock(orientations[i]).then(function() { - setOrientation(i+1); - },function() {}); - })(idx); - }; - - setOrientation(0); +promise_test(async t => { + const value = await screen.orientation.lock('any'); + assert_equals(value, undefined); +}, "Test that screen.orientation.lock returns a promise which will be fulfilled with a void value."); +promise_test(async t => { + const orientations = [ + 'any', + 'natural', + 'portrait', + 'landscape', + 'portrait-secondary', + 'landscape-primary', + 'landscape-secondary', + 'portrait-primary', + ]; + for (const orientation of orientations) { + const promiseToChange = screen.orientation.lock(orientation); + assert_true(promiseToChange instanceof Promise, "Expected an instance of Promise"); + await promiseToChange; + const type = screen.orientation.type; + switch (orientation) { + case 'any': + break; + case 'natural': + assert_true(type == "portrait-primary" || type == "landscape-primary"); + break; + case 'portrait': + assert_true(type == "portrait-primary" || type == "portrait-secondary"); + break; + case 'landscape': + assert_true(type == "landscape-primary" || type == "landscape-secondary"); + break; + default: + assert_equals(type, orientation, "Expected orientation to change"); + break; + } + } + screen.orientation.unlock(); }, "Test that screen.orientation.lock returns a pending promise."); -test(function() { - assert_equals(screen.orientation, previousOrientation); +promise_test(async t => { + const preType = screen.orientation.type; + const isPortrait = preType.includes("portrait"); + const newType = `${ isPortrait ? "landscape" : "portrait" }-primary`; + const p = screen.orientation.lock(newType); + assert_equals(screen.orientation.type, preType, "Must not change orientation until next spin of event loop"); + await p; + assert_equals(screen.orientation.type, newType); }, "Test that screen.orientation.lock() is actually async"); - </script> -</body> -</html> diff --git a/tests/wpt/web-platform-tests/screen-orientation/lock-sandboxed-iframe.html b/tests/wpt/web-platform-tests/screen-orientation/lock-sandboxed-iframe.html index 1c4f5294c55..1041f91886a 100644 --- a/tests/wpt/web-platform-tests/screen-orientation/lock-sandboxed-iframe.html +++ b/tests/wpt/web-platform-tests/screen-orientation/lock-sandboxed-iframe.html @@ -1,6 +1,4 @@ <!DOCTYPE html> -<html> -<body> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -10,29 +8,21 @@ <iframe id="disallowedIframe" sandbox="allow-scripts allow-same-origin" style="display:none"> </iframe> <script> - var testNotAllowed = async_test("Test without 'allow-orientation-lock' sandboxing directive"); - var testAllowed = async_test("Test with 'allow-orientation-lock' sandboxing directive"); +promise_test(async t => { + const messageWatcher = new EventWatcher(t, window, "message"); + const disallowedIframe = document.getElementById("disallowedIframe"); + disallowedIframe.src = "resources/sandboxed-iframe-locking.html"; - function runTestAllowed() { - window.onmessage = testAllowed.step_func(function (ev) { - assert_equals(ev.data, "portrait-primary", "screen.orientation lock to portrait-primary"); - screen.orientation.unlock(); - testAllowed.done(); - }); - var allowedIframe = document.getElementById("allowedIframe"); - allowedIframe.src = "resources/sandboxed-iframe-locking.html"; - } + const message = await messageWatcher.wait_for("message"); + assert_equals(message.data, "SecurityError", "screen.lockOrientation() throws a SecurityError"); +}, "Test without 'allow-orientation-lock' sandboxing directive"); - function runTestNotAllowed() { - window.onmessage = testNotAllowed.step_func(function (ev) { - assert_equals(ev.data, "SecurityError", "screen.lockOrientation() throws a SecurityError"); - testNotAllowed.done(); - runTestAllowed(); - }); - var disallowedIframe = document.getElementById("disallowedIframe"); - disallowedIframe.src = "resources/sandboxed-iframe-locking.html"; - } - runTestNotAllowed(); +promise_test(async t => { + const messageWatcher = new EventWatcher(t, window, "message"); + const disallowedIframe = document.getElementById("allowedIframe"); + disallowedIframe.src = "resources/sandboxed-iframe-locking.html"; + + const message = await messageWatcher.wait_for("message"); + assert_equals(message.data, "portrait-primary", "screen.orientation lock to portrait-primary"); +}, "Test with 'allow-orientation-lock' sandboxing directive"); </script> -</body> -</html> diff --git a/tests/wpt/web-platform-tests/screen-orientation/onchange-event-subframe.html b/tests/wpt/web-platform-tests/screen-orientation/onchange-event-subframe.html index 87b0e9fe72b..869a2294594 100644 --- a/tests/wpt/web-platform-tests/screen-orientation/onchange-event-subframe.html +++ b/tests/wpt/web-platform-tests/screen-orientation/onchange-event-subframe.html @@ -1,46 +1,29 @@ <!DOCTYPE html> -<html> -<body> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<iframe id="testIframe" sandbox="allow-scripts allow-same-origin" style="display:none"> +<iframe id="testIframe" sandbox="allow-scripts allow-same-origin" + style="display:none" src="resources/iframe-listen-orientation-change.html"> </iframe> <script> - var test = async_test("Test subframes receive orientation change events"); - - var orientations = [ - 'portrait-primary', - 'portrait-secondary', - 'landscape-primary', - 'landscape-secondary' - ]; - - var currentIndex = orientations.indexOf(window.screen.orientation.type); - var eventsReceived = 0; - - function getNextIndex() { - return (currentIndex + 1) % orientations.length; - } - - function changeOrientation() { - screen.orientation.lock(orientations[getNextIndex()]).then(function () {}, function () {}); - currentIndex = getNextIndex(); - } - - window.onmessage = test.step_func(function (ev) { - assert_equals(ev.data, orientations[currentIndex], "subframe receives orientation change event"); - ++eventsReceived; - if (eventsReceived < orientations.length) - changeOrientation() - else - test.done(); - }); - - var testIframe = document.getElementById("testIframe"); - testIframe.src = "resources/iframe-listen-orientation-change.html"; - testIframe.onload = changeOrientation; +promise_test(async t => { + let orientations = [ + 'portrait-primary', + 'portrait-secondary', + 'landscape-primary', + 'landscape-secondary' + ]; + if (screen.orientation.type.includes('portrait')) { + orientations = orientations.reverse(); + } + const messageWatcher = new EventWatcher(t, window, "message"); + + for (const orientation of orientations) { + await screen.orientation.lock(orientation); + const message = await messageWatcher.wait_for("message"); + assert_equals(message.data, orientation, "subframe receives orientation change event"); + } + screen.orientation.unlock(); +}, "Test subframes receive orientation change events"); </script> -</body> -</html> diff --git a/tests/wpt/web-platform-tests/screen-orientation/onchange-event.html b/tests/wpt/web-platform-tests/screen-orientation/onchange-event.html index be39efc3290..538fafc41ec 100644 --- a/tests/wpt/web-platform-tests/screen-orientation/onchange-event.html +++ b/tests/wpt/web-platform-tests/screen-orientation/onchange-event.html @@ -1,80 +1,31 @@ <!DOCTYPE html> -<html> -<body> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script> - -var changeTest = async_test("Test that orientationchange event is fired when the orientation changes."); -var noChangeTest = async_test("Test that orientationchange event is not fired when the orientation does not change."); - -var orientations = [ - 'portrait-primary', - 'portrait-secondary', - 'landscape-primary', - 'landscape-secondary' -]; - -var currentIndex = orientations.indexOf(window.screen.orientation.type); -// Count the number of calls received from the EventHandler set on screen.orientation.onchange. -var orientationChangeEventHandlerCalls = 0; -// Count the number of calls received from the listener set with screen.orientation.addEventListene(). -var orientationChangeEventListenerCalls = 0; - -var orientationChangeContinuation = null; - -function getNextIndex() { - return (currentIndex + 1) % orientations.length; -} - -window.screen.orientation.onchange = function() { - orientationChangeEventHandlerCalls++; - if (orientationChangeEventContinuation) { - setTimeout(orientationChangeEventContinuation); - orientationChangeEventContinuation = null; +promise_test(async t => { + const type = screen.orientation.type; + screen.orientation.onchange = t.unreached_func("change event should not be fired"); + await screen.orientation.lock(type); + assert_equals(screen.orientation.type, type); +}, "Test that orientationchange event is not fired when the orientation does not change."); + +promise_test(async t => { + let orientations = [ + 'portrait-primary', + 'portrait-secondary', + 'landscape-primary', + 'landscape-secondary' + ]; + if (screen.orientation.type.includes('portrait')) { + orientations = orientations.reverse(); } -}; - -window.screen.orientation.addEventListener('change', function() { - orientationChangeEventListenerCalls++; -}); - -function runNoChangeTest() { - screen.orientation.lock(orientations[currentIndex]).then(function() {}, function() {}); - - noChangeTest.step(function() { - assert_equals(screen.orientation.type, orientations[currentIndex]); - assert_equals(orientationChangeEventHandlerCalls, orientations.length); - assert_equals(orientationChangeEventListenerCalls, orientations.length); - }); - - noChangeTest.done(); -} - -var i = 0; -function runChangeTest() { - screen.orientation.lock(orientations[getNextIndex()]).then(function() {}, function() {}); - currentIndex = getNextIndex(); - - orientationChangeEventContinuation = function() { - changeTest.step(function() { - assert_equals(screen.orientation.type, orientations[currentIndex]); - assert_equals(orientationChangeEventHandlerCalls, i + 1); - assert_equals(orientationChangeEventListenerCalls, i + 1); - }); - - ++i; - if (i == orientations.length) { - changeTest.done(); - runNoChangeTest(); - } else { - runChangeTest(); - } - }; -} - -runChangeTest(); + const orientationWatcher = new EventWatcher(t, screen.orientation, 'change'); + for (const orientation of orientations) { + await screen.orientation.lock(orientation); + await orientationWatcher.wait_for('change'); + assert_equals(screen.orientation.type, orientation); + } + screen.orientation.unlock(); +}, "Test that orientationchange event is fired when the orientation changes."); </script> -</body> -</html> diff --git a/tests/wpt/web-platform-tests/screen-orientation/orientation-reading.html b/tests/wpt/web-platform-tests/screen-orientation/orientation-reading.html index 4b1d0b83889..6d67dd3152d 100644 --- a/tests/wpt/web-platform-tests/screen-orientation/orientation-reading.html +++ b/tests/wpt/web-platform-tests/screen-orientation/orientation-reading.html @@ -1,61 +1,58 @@ <!DOCTYPE html> -<html> -<body> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script> - -test(function() { - assert_true('type' in screen.orientation); - assert_true('angle' in screen.orientation); +test(() => { + assert_true('type' in screen.orientation); + assert_true('angle' in screen.orientation); }, "Test screen.orientation properties"); -test(function() { - assert_equals(screen.orientation.type, "portrait-primary"); - assert_equals(screen.orientation.angle, 0); +test(() => { + const type = screen.orientation.type; + const angle = screen.orientation.angle; + + if (screen.width > screen.height) { + assert_true(type == "landscape-primary" || type == "landscape-secondary"); + } else if (screen.width < screen.height) { + assert_true(type == "portrait-primary" || type == "portrait-secondary"); + } + + assert_true(angle == 0 || angle == 90 || angle == 180 || angle == 270); }, "Test screen.orientation default values."); -test(function() { - var type = screen.orientation.type; - var angle = screen.orientation.angle; +test(() => { + const type = screen.orientation.type; + const angle = screen.orientation.angle; - screen.orientation.type = 'foo'; - screen.orientation.angle = 42; + screen.orientation.type = 'foo'; + screen.orientation.angle = 42; - assert_equals(screen.orientation.type, type); - assert_equals(screen.orientation.angle, angle); + assert_equals(screen.orientation.type, type); + assert_equals(screen.orientation.angle, angle); }, "Test that screen.orientation properties are not writable"); -test(function() { - assert_equals(screen.orientation, screen.orientation); +test(() => { + assert_equals(screen.orientation, screen.orientation); }, "Test that screen.orientation is always the same object"); -async_test(function(t) { - var orientation = screen.orientation; - var orientationType = screen.orientation.type; - var orientationAngle = screen.orientation.angle; - - screen.orientation.unlock(); - screen.orientation.lock('landscape-primary').then(function () { - t.step(function () { - assert_equals(screen.orientation, orientation); - assert_equals(screen.orientation.type, orientation.type); - assert_equals(screen.orientation.angle, orientation.angle); - assert_not_equals(screen.orientation.type, orientationType); - assert_not_equals(screen.orientation.angle, orientationAngle); - }); - t.done(); - screen.orientation.unlock(); - }, function () { - t.step(function () { - assert_unreached('Unexpected orientation change'); - }); - t.done(); - screen.orientation.unlock(); - }); - +promise_test(async t => { + const orientation = screen.orientation; + const orientationType = screen.orientation.type; + const orientationAngle = screen.orientation.angle; + const orientationWatcher = new EventWatcher(t, orientation, "change"); + + if (orientationType.includes("portrait")) { + await orientation.lock("landscape-primary"); + } else { + await orientation.lock("portrait-primary"); + } + + await orientationWatcher.wait_for("change"); + assert_equals(screen.orientation, orientation); + assert_equals(screen.orientation.type, orientation.type); + assert_equals(screen.orientation.angle, orientation.angle); + assert_not_equals(screen.orientation.type, orientationType); + assert_not_equals(screen.orientation.angle, orientationAngle); + screen.orientation.unlock(); }, "Test that screen.orientation values change if the orientation changes"); - </script> -</body> -</html> diff --git a/tests/wpt/web-platform-tests/screen-orientation/resources/iframe-listen-orientation-change.html b/tests/wpt/web-platform-tests/screen-orientation/resources/iframe-listen-orientation-change.html index 760d952481f..4cfd37d02bc 100644 --- a/tests/wpt/web-platform-tests/screen-orientation/resources/iframe-listen-orientation-change.html +++ b/tests/wpt/web-platform-tests/screen-orientation/resources/iframe-listen-orientation-change.html @@ -1,6 +1,5 @@ -<!DOCTYPE html> <script> - window.screen.orientation.addEventListener('change', function() { - parent.window.postMessage(screen.orientation.type, "*"); - }); +window.screen.orientation.addEventListener('change', () => { + parent.window.postMessage(screen.orientation.type, "*"); +}); </script> diff --git a/tests/wpt/web-platform-tests/screen-orientation/resources/sandboxed-iframe-locking.html b/tests/wpt/web-platform-tests/screen-orientation/resources/sandboxed-iframe-locking.html index 48f408b4ff4..e1b50f67010 100644 --- a/tests/wpt/web-platform-tests/screen-orientation/resources/sandboxed-iframe-locking.html +++ b/tests/wpt/web-platform-tests/screen-orientation/resources/sandboxed-iframe-locking.html @@ -1,13 +1,11 @@ -<!DOCTYPE html> -<html> <script> - var msg = ""; - screen.orientation.lock("portrait-primary").then(function() { - msg = screen.orientation.type; - }, function(error) { - msg = error.name; - }).then(function() { - parent.window.postMessage(msg, "*"); - }); +let msg = ""; +screen.orientation.lock("portrait-primary") +.then(() => { + msg = screen.orientation.type; +}).catch(error => { + msg = error.name; +}).finally(() => { + parent.window.postMessage(msg, "*"); +}); </script> -</html> diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-getFrequencyResponse.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-getFrequencyResponse.html index 83f057fce7e..2389b334fb8 100644 --- a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-getFrequencyResponse.html +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-getFrequencyResponse.html @@ -37,10 +37,10 @@ let filterGain = 5; // Decibels. // The maximum allowed error in the magnitude response. - let maxAllowedMagError = 9.775e-7; + let maxAllowedMagError = 1.09931e-6; // The maximum allowed error in the phase response. - let maxAllowedPhaseError = 5.4187e-8; + let maxAllowedPhaseError = 6.4724e-8; // The magnitudes and phases of the reference frequency response. let expectedMagnitudes; diff --git a/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-insertDTMF.https.html b/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-insertDTMF.https.html index 7a45e5daba7..9c0055b15cd 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-insertDTMF.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-insertDTMF.https.html @@ -109,6 +109,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const transceiver = pc.addTransceiver('audio', { direction: 'recvonly' }); @@ -126,6 +127,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const transceiver = pc.addTransceiver('audio', { direction: 'inactive' }); @@ -166,6 +168,7 @@ let dtmfSender; let sender; let pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return getTrackFromUserMedia('audio') .then(([track, mediaStream]) => { sender = pc.addTrack(track, mediaStream); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-ontonechange.https.html b/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-ontonechange.https.html index bfb8b8c0067..6beefb5287d 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-ontonechange.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-ontonechange.https.html @@ -232,6 +232,7 @@ */ async_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const transceiver = pc.addTransceiver('audio', { direction: 'sendrecv' }); const dtmfSender = transceiver.sender.dtmf; @@ -279,7 +280,6 @@ dtmfSender.addEventListener('tonechange', onToneChange); dtmfSender.insertDTMF('ABCD', 100, 70); - }, `Setting transceiver.currentDirection to recvonly in the middle of tonechange events should stop future tonechange events from firing`); /* Section 7.3 - Tone change event */ diff --git a/tests/wpt/web-platform-tests/webrtc/RTCDataChannel-id.html b/tests/wpt/web-platform-tests/webrtc/RTCDataChannel-id.html index 7128da8bc04..18f70d8ce96 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCDataChannel-id.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCDataChannel-id.html @@ -11,6 +11,7 @@ // have IDs set according to the rules in rtcweb-data-channel. promise_test(test => { const pc = new RTCPeerConnection; + test.add_cleanup(() => pc.close()); const channel = pc.createDataChannel(''); return pc.createOffer() .then(offer => pc.setLocalDescription(offer)) @@ -35,6 +36,7 @@ promise_test(test => { promise_test(test => { const pc = new RTCPeerConnection; + test.add_cleanup(() => pc.close()); const channel = pc.createDataChannel(''); return pc.createOffer() .then(offer => pc.setLocalDescription(offer)) diff --git a/tests/wpt/web-platform-tests/webrtc/RTCDtlsTransport-getRemoteCertificates.html b/tests/wpt/web-platform-tests/webrtc/RTCDtlsTransport-getRemoteCertificates.html index 80d1bfae46d..0614364e975 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCDtlsTransport-getRemoteCertificates.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCDtlsTransport-getRemoteCertificates.html @@ -38,7 +38,9 @@ */ async_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); pc1.createDataChannel('test'); exchangeIceCandidates(pc1, pc2); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCIceTransport.html b/tests/wpt/web-platform-tests/webrtc/RTCIceTransport.html index 9163285ac5b..17ae6dca016 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCIceTransport.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCIceTransport.html @@ -120,7 +120,9 @@ promise_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); return createDataChannelPair(pc1, pc2) .then(([channel1, channel2]) => { @@ -165,7 +167,9 @@ promise_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); pc1.createDataChannel(''); // setRemoteDescription(answer) without the other peer diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate.html index e55cc61b558..5e321681336 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate.html @@ -142,6 +142,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => promise_rejects(t, new TypeError(), @@ -157,6 +159,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return promise_rejects(t, 'InvalidStateError', pc.addIceCandidate({ candidate: candidateStr1, @@ -170,6 +174,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => pc.addIceCandidate({ candidate: candidateStr1, @@ -180,6 +186,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => pc.addIceCandidate(new RTCIceCandidate({ candidate: candidateStr1, @@ -190,6 +198,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => pc.addIceCandidate({ sdpMid })); }, 'Add candidate with only valid sdpMid should succeed'); @@ -197,6 +207,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => pc.addIceCandidate({ sdpMLineIndex })); }, 'Add candidate with only valid sdpMLineIndex should succeed'); @@ -212,6 +224,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => pc.addIceCandidate({ candidate: candidateStr1, @@ -226,6 +240,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => pc.addIceCandidate({ candidate: candidateStr2, @@ -242,6 +258,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => pc.addIceCandidate({ candidate: candidateStr1, @@ -257,6 +275,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => pc.addIceCandidate({ candidate: candidateStr1, @@ -291,6 +311,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => pc.addIceCandidate({ candidate: candidateStr1, @@ -318,6 +340,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => promise_rejects(t, new TypeError(), @@ -331,6 +355,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => promise_rejects(t, new TypeError(), @@ -342,6 +368,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => promise_rejects(t, new TypeError(), @@ -355,6 +383,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => promise_rejects(t, new TypeError(), @@ -364,6 +394,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => promise_rejects(t, new TypeError(), @@ -385,6 +417,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => promise_rejects(t, 'OperationError', @@ -405,6 +439,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => promise_rejects(t, 'OperationError', @@ -420,6 +456,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => pc.addIceCandidate({ candidate: candidateStr1, @@ -432,6 +470,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => pc.addIceCandidate({ candidate: candidateStr2, @@ -455,6 +495,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => promise_rejects(t, 'OperationError', @@ -475,6 +517,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => promise_rejects(t, 'OperationError', @@ -487,6 +531,8 @@ a=rtcp-rsize promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(sessionDesc) .then(() => promise_rejects(t, 'OperationError', diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-addTrack.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-addTrack.https.html index 406e2d7ce5d..c06273906e3 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-addTrack.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-addTrack.https.html @@ -40,6 +40,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return navigator.mediaDevices.getUserMedia({ audio: true }) .then(mediaStream => { const tracks = mediaStream.getTracks(); @@ -67,6 +69,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return navigator.mediaDevices.getUserMedia({ audio: true }) .then(mediaStream => { const tracks = mediaStream.getTracks(); @@ -102,6 +106,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return navigator.mediaDevices.getUserMedia({ audio: true }) .then(mediaStream => { const tracks = mediaStream.getTracks(); @@ -122,6 +128,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return navigator.mediaDevices.getUserMedia({ audio: true }) .then(mediaStream => { const tracks = mediaStream.getTracks(); @@ -149,6 +157,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return navigator.mediaDevices.getUserMedia({ audio: true }) .then(mediaStream => { const tracks = mediaStream.getTracks(); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html index 38c8b632cd1..09ad67751a7 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html @@ -38,6 +38,8 @@ promise_test(function(t) { var pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(new RTCSessionDescription({type: 'offer', sdp: sdp})) .then(function() { assert_true(pc.canTrickleIceCandidates, 'canTrickleIceCandidates property is true after setRemoteDescription'); @@ -47,6 +49,8 @@ promise_test(function(t) { var pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription(new RTCSessionDescription({type: 'offer', sdp: sdp.replace('a=ice-options:trickle\r\n', '')})) .then(function() { assert_false(pc.canTrickleIceCandidates, 'canTrickleIceCandidates property is false after setRemoteDescription'); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-connectionState.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-connectionState.html index 1f2f1b76c41..d8e94112718 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-connectionState.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-connectionState.html @@ -107,8 +107,11 @@ */ async_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + const onConnectionStateChange = t.step_func(() => { const { connectionState } = pc1; if(connectionState === 'connected') { @@ -136,7 +139,6 @@ exchangeIceCandidates(pc1, pc2); doSignalingHandshake(pc1, pc2); - }, 'connection with one data channel should eventually have connected connection state'); /* diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createAnswer.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createAnswer.html index 19b3a4537aa..abff1eb7329 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createAnswer.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createAnswer.html @@ -24,6 +24,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return promise_rejects(t, 'InvalidStateError', pc.createAnswer()); }, 'createAnswer() with null remoteDescription should reject with InvalidStateError'); @@ -36,6 +37,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer({ offerToReceiveVideo: true }) .then(offer => pc.setRemoteDescription(offer)) .then(() => pc.createAnswer()) @@ -51,6 +54,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return generateOffer({ pc, data: true }) .then(offer => pc.setRemoteDescription(offer)) .then(() => { diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html index 35e22f934f0..450a25002ed 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html @@ -362,6 +362,7 @@ test(() => { */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const channel1 = pc.createDataChannel('channel'); assert_equals(channel1.id, null, 'Expect initial id to be null'); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createOffer-offerToReceive.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createOffer-offerToReceive.html index c599b1c0d07..dd1827a1c8d 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createOffer-offerToReceive.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createOffer-offerToReceive.html @@ -21,6 +21,7 @@ // Start testing promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const dummy = pc.createDataChannel('foo'); // Just to have something to offer return pc.createOffer(offerToReceiveFalse) @@ -33,6 +34,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer(offerToReceiveTrue) .then(() => { assert_equals(pc.getTransceivers().length, 1, @@ -47,6 +50,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer(offerToReceiveTrue) .then(() => { assert_equals(pc.getTransceivers().length, 1, @@ -67,6 +72,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return getTrackFromUserMedia(kind) .then(([track, stream]) => { pc.addTrack(track, stream); @@ -91,6 +98,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return getTrackFromUserMedia(kind) .then(([track, stream]) => { pc.addTrack(track, stream); @@ -110,6 +119,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + pc.addTransceiver(kind, {direction: 'recvonly'}); return pc.createOffer(offerToReceiveFalse) @@ -126,8 +137,11 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + return getTrackFromUserMedia(kind) .then(([track, stream]) => { pc.addTrack(track, stream); @@ -154,6 +168,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer({ offerToReceiveAudio: true, offerToReceiveVideo: true }) .then(() => { assert_equals(pc.getTransceivers().length, 2, diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createOffer.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createOffer.html index dfa4bdc43de..936fd05040d 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createOffer.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createOffer.html @@ -15,7 +15,6 @@ // generateAnswer() // countAudioLine() // countVideoLine() - // test_state_change_event() // assert_session_desc_equals() /* @@ -31,6 +30,8 @@ promise_test(t => { const pc = new RTCPeerConnection() + t.add_cleanup(() => pc.close()); + return pc.createOffer() .then(offer => { assert_equals(typeof offer, 'object', @@ -43,7 +44,10 @@ promise_test(t => { const pc = new RTCPeerConnection(); - test_state_change_event(t, pc, ['have-local-offer']); + t.add_cleanup(() => pc.close()); + + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return pc.createOffer({ offerToReceiveAudio: true }) .then(offer => @@ -53,11 +57,14 @@ assert_session_desc_equals(pc.localDescription, offer); assert_session_desc_equals(pc.pendingLocalDescription, offer); assert_equals(pc.currentLocalDescription, null); + + assert_array_equals(states, ['have-local-offer']); })); }, 'createOffer() and then setLocalDescription() should succeed'); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); pc.close(); return promise_rejects(t, 'InvalidStateError', @@ -78,6 +85,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const promise = pc.createOffer(); pc.addTransceiver('audio'); @@ -122,6 +130,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer({ offerToReceiveAudio: true }) .then(offer1 => { assert_equals(countAudioLine(offer1.sdp), 1, @@ -149,6 +159,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer({ offerToReceiveVideo: true }) .then(offer1 => { assert_equals(countVideoLine(offer1.sdp), 1, @@ -165,6 +177,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer({ offerToReceiveAudio: true, offerToReceiveVideo: false diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-getStats.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-getStats.https.html index ac69ee5e28d..e9ea7da2161 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-getStats.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-getStats.https.html @@ -41,11 +41,13 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return pc.getStats(); }, 'getStats() with no argument should succeed'); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return pc.getStats(null); }, 'getStats(null) should succeed'); @@ -59,6 +61,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return getTrackFromUserMedia('audio') .then(([track, mediaStream]) => { return promise_rejects(t, 'InvalidAccessError', pc.getStats(track)); @@ -67,6 +70,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return getTrackFromUserMedia('audio') .then(([track, mediaStream]) => { pc.addTrack(track, mediaStream); @@ -76,6 +80,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const track = generateMediaStreamTrack(); pc.addTransceiver(track); @@ -84,6 +89,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return getTrackFromUserMedia('audio') .then(([track, mediaStream]) => { // addTransceiver allows adding same track multiple times @@ -100,6 +106,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const transceiver1 = pc.addTransceiver('audio'); // Create another transceiver that resends what @@ -117,6 +124,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return pc.getStats() .then(statsReport => { validateStatsReport(statsReport); @@ -126,6 +134,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return getTrackFromUserMedia('audio') .then(([track, mediaStream]) => { pc.addTrack(track, mediaStream); @@ -140,6 +149,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return getTrackFromUserMedia('audio') .then(([track, mediaStream]) => { pc.addTrack(track); @@ -162,6 +172,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return getTrackFromUserMedia('audio') .then(([track, mediaStream]) => { pc.addTrack(track, mediaStream); @@ -185,6 +196,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const transceiver = pc.addTransceiver('audio'); return pc.getStats(transceiver.receiver.track) diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-helper.js b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-helper.js index 34e0d75903c..df91133a760 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-helper.js +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-helper.js @@ -168,36 +168,6 @@ function generateAnswer(offer) { .then(() => pc.createAnswer()); } -// Wait for peer connection to fire onsignalingstatechange -// event, compare and make sure the new state is the same -// as expected state. It accepts an RTCPeerConnection object -// and an array of expected state changes. The test passes -// if all expected state change events have been fired, and -// fail if the new state is different from the expected state. -// -// Note that the promise is never resolved if no change -// event is fired. To avoid confusion with the main test -// getting timed out, this is done in parallel as a separate -// test -function test_state_change_event(parentTest, pc, expectedStates) { - return async_test(t => { - pc.onsignalingstatechange = t.step_func(() => { - if(expectedStates.length === 0) { - return; - } - - const newState = pc.signalingState; - const expectedState = expectedStates.shift(); - - assert_equals(newState, expectedState, 'New signaling state is different from expected.'); - - if(expectedStates.length === 0) { - t.done(); - } - }); - }, `Test onsignalingstatechange event for ${parentTest.name}`); -} - // Run a test function that return a promise that should // never be resolved. For lack of better options, // we wait for a time out and pass the test if the @@ -418,16 +388,19 @@ function getUserMediaTracksAndStreams(count, type = 'audio') { }); } -// Creates an offer for the caller, set it as the caller's local description and -// then sets the callee's remote description to the offer. Returns the Promise -// of the setRemoteDescription call. -function performOffer(caller, callee) { - let sessionDescription; - return caller.createOffer() - .then(offer => { - sessionDescription = offer; - return caller.setLocalDescription(offer); - }).then(() => callee.setRemoteDescription(sessionDescription)); +async function exchangeOffer(caller, callee) { + const offer = await caller.createOffer(); + await caller.setLocalDescription(offer); + return callee.setRemoteDescription(offer); +} +async function exchangeAnswer(caller, callee) { + const answer = await callee.createAnswer(); + await callee.setLocalDescription(answer); + return caller.setRemoteDescription(answer); +} +async function exchangeOfferAnswer(caller, callee) { + await exchangeOffer(caller, callee); + return exchangeAnswer(caller, callee); } @@ -445,3 +418,13 @@ class Resolver { this.reject = promiseReject; } } + +function addEventListenerPromise(t, target, type, listener) { + return new Promise((resolve, reject) => { + target.addEventListener(type, t.step_func(e => { + if (listener != undefined) + e = listener(e); + resolve(e); + })); + }); +} diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.html index 59c964c645b..4071033a3c9 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.html @@ -104,8 +104,11 @@ */ async_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + const onIceConnectionStateChange = t.step_func(() => { const { iceConnectionState } = pc1; @@ -138,7 +141,6 @@ exchangeIceCandidates(pc1, pc2); doSignalingHandshake(pc1, pc2); - }, 'connection with one data channel should eventually have connected connection state'); /* diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html index 4265b8bf806..fb9e514194b 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html @@ -57,6 +57,8 @@ async_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + const onIceGatheringStateChange = t.step_func(() => { const { iceGatheringState } = pc; @@ -74,7 +76,6 @@ .then(offer => pc.setLocalDescription(offer)) .then(err => t.step_func(err => assert_unreached(`Unhandled rejection ${err.name}: ${err.message}`))); - }, 'iceGatheringState should eventually become complete after setLocalDescription'); /* @@ -97,8 +98,11 @@ */ async_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + const onIceGatheringStateChange = t.step_func(() => { const { iceGatheringState } = pc2; @@ -131,7 +135,6 @@ exchangeIceCandidates(pc1, pc2); doSignalingHandshake(pc1, pc2); - }, 'connection with one data channel should eventually have connected connection state'); /* diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-ondatachannel.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-ondatachannel.html index 4948d11daa6..1070ee701d2 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-ondatachannel.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-ondatachannel.html @@ -36,8 +36,11 @@ */ async_test(t => { const localPc = new RTCPeerConnection(); + t.add_cleanup(() => localPc.close()); const remotePc = new RTCPeerConnection(); + t.add_cleanup(() => remotePc.close()); + let eventCount = 0; const onDataChannel = t.step_func_done(event => { @@ -69,7 +72,6 @@ remotePc.addEventListener('datachannel', onDataChannel); exchangeIceCandidates(localPc, remotePc); doSignalingHandshake(localPc, remotePc); - }, 'datachannel event should fire when new data channel is announced to the remote peer'); /* @@ -98,8 +100,11 @@ */ async_test(t => { const localPc = new RTCPeerConnection(); + t.add_cleanup(() => localPc.close()); const remotePc = new RTCPeerConnection(); + t.add_cleanup(() => remotePc.close()); + const onDataChannel = t.step_func_done(event => { const remoteChannel = event.channel; assert_true(remoteChannel instanceof RTCDataChannel, @@ -145,8 +150,11 @@ */ async_test(t => { const localPc = new RTCPeerConnection(); + t.add_cleanup(() => localPc.close()); const remotePc = new RTCPeerConnection(); + t.add_cleanup(() => remotePc.close()); + const onDataChannel = t.unreached_func('datachannel event should not be fired'); localPc.createDataChannel('test', { @@ -158,7 +166,6 @@ doSignalingHandshake(localPc, remotePc); t.step_timeout(t.step_func_done(), 200); - }, 'Data channel created with negotiated set to true should not fire datachannel event on remote peer'); /* diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-onnegotiationneeded.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-onnegotiationneeded.html index a71625c0715..8f9ea2be780 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-onnegotiationneeded.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-onnegotiationneeded.html @@ -82,6 +82,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const negotiated = awaitNegotiation(pc); pc.createDataChannel('test'); @@ -114,6 +115,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const negotiated = awaitNegotiation(pc); pc.addTransceiver('audio'); @@ -184,6 +186,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return assert_first_promise_fulfill_after_second( awaitNegotiation(pc), pc.createOffer({ offerToReceiveAudio: true }) diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-ontrack.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-ontrack.https.html index 66101398ec3..10210129acd 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-ontrack.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-ontrack.https.html @@ -98,6 +98,8 @@ async_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + // Fail the test if the ontrack event handler is not implemented assert_idl_attribute(pc, 'ontrack', 'Expect pc to have ontrack event handler attribute'); @@ -151,6 +153,8 @@ a=ssrc:1001 cname:some async_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + assert_idl_attribute(pc, 'ontrack', 'Expect pc to have ontrack event handler attribute'); const sdp = `v=0 @@ -182,13 +186,15 @@ a=ssrc:1001 cname:some .then(t.step_func(() => { t.step_timeout(t.step_func_done(), 100); })); - }, 'setRemoteDescription() with m= line of recvonly direction should not trigger track event'); async_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + pc2.ontrack = t.step_func(trackEvent => { const { track } = trackEvent; @@ -210,13 +216,15 @@ a=ssrc:1001 cname:some .catch(t.step_func(err => { assert_unreached('Error ' + err.name + ': ' + err.message); })); - }, 'addTrack() should cause remote connection to fire ontrack when setRemoteDescription()'); async_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + pc2.ontrack = t.step_func(trackEvent => { const { track } = trackEvent; @@ -235,13 +243,15 @@ a=ssrc:1001 cname:some .catch(t.step_func(err => { assert_unreached('Error ' + err.name + ': ' + err.message); })); - }, `addTransceiver('video') should cause remote connection to fire ontrack when setRemoteDescription()`); async_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + pc2.ontrack = t.step_func(trackEvent => { const { track } = trackEvent; @@ -264,7 +274,6 @@ a=ssrc:1001 cname:some .then(t.step_func(() => { t.step_timeout(t.step_func_done(), 100); })); - }, `addTransceiver() with inactive direction should not cause remote connection to fire ontrack when setRemoteDescription()`); </script> diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-peerIdentity.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-peerIdentity.html index 68d9f209a9e..64ad212a5ba 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-peerIdentity.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-peerIdentity.html @@ -56,8 +56,11 @@ */ promise_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + const port = window.location.port; const [idpDomain] = getIdpDomains(); const idpHost = hostString(idpDomain, port); @@ -92,10 +95,13 @@ const idpHost = hostString(idpDomain, port); const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection({ peerIdentity: `bob@${idpDomain}` }); + t.add_cleanup(() => pc2.close()); + pc1.setIdentityProvider(idpHost, { protocol: 'mock-idp.js', usernameHint: `alice@${idpDomain}` @@ -131,10 +137,13 @@ const idpHost = hostString(idpDomain, port); const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection({ peerIdentity: `alice@${idpDomain}` }); + t.add_cleanup(() => pc2.close()); + // Ask mockidp.js to return custom contents in validation result pc1.setIdentityProvider(idpHost, { protocol: 'mock-idp.js?validatorAction=return-custom-contents&contents=bogus', @@ -167,10 +176,13 @@ const idpHost1 = hostString(idpDomain1, port); const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection({ peerIdentity: `alice@${idpDomain2}` }); + t.add_cleanup(() => pc2.close()); + // mock-idp.js will return assertion of domain2 identity // with domain1 in the idp.domain field pc1.setIdentityProvider(idpHost1, { @@ -220,10 +232,13 @@ const idpHost = hostString(idpDomain, port); const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection({ peerIdentity: `alice@${idpDomain}` }); + t.add_cleanup(() => pc2.close()); + // Ask mock-idp.js to throw error during validation, // i.e. during pc2.setRemoteDescription() pc1.setIdentityProvider(idpHost, { @@ -263,8 +278,11 @@ */ promise_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + const port = window.location.port; const [idpDomain] = getIdpDomains(); const idpHost = hostString(idpDomain, port); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-removeTrack.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-removeTrack.https.html index e2da02b9dcf..7db0afc6d5b 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-removeTrack.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-removeTrack.https.html @@ -49,6 +49,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return navigator.mediaDevices.getUserMedia({ audio: true }) .then(mediaStream => { const tracks = mediaStream.getTracks(); @@ -78,6 +80,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return navigator.mediaDevices.getUserMedia({ audio: true }) .then(mediaStream => { const tracks = mediaStream.getTracks(); @@ -111,6 +115,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return navigator.mediaDevices.getUserMedia({ audio: true }) .then(mediaStream => { const tracks = mediaStream.getTracks(); @@ -149,6 +155,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return navigator.mediaDevices.getUserMedia({ audio: true }) .then(mediaStream => { const tracks = mediaStream.getTracks(); @@ -173,6 +181,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const track = generateMediaStreamTrack('audio'); const transceiver = pc.addTransceiver(track); const { sender } = transceiver; @@ -205,6 +214,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const track = generateMediaStreamTrack('audio'); const transceiver = pc.addTransceiver(track, { direction: 'sendonly' }); const { sender } = transceiver; @@ -237,6 +247,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const track = generateMediaStreamTrack('audio'); const transceiver = pc.addTransceiver(track, { direction: 'recvonly' }); const { sender } = transceiver; @@ -268,6 +279,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const track = generateMediaStreamTrack('audio'); const transceiver = pc.addTransceiver(track, { direction: 'inactive' }); const { sender } = transceiver; diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver.html index d19b4747df1..5fc957df8fb 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver.html @@ -66,6 +66,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const transceiver = pc.addTransceiver('audio'); assert_equals(transceiver.mid, null); @@ -99,8 +100,11 @@ */ promise_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + const transceiver1 = pc1.addTransceiver('audio'); assert_array_equals(pc1.getTransceivers(), [transceiver1]); assert_array_equals(pc2.getTransceivers(), []); @@ -139,6 +143,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const transceiver = pc.addTransceiver('audio'); assert_equals(transceiver.mid, null); @@ -159,6 +164,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const transceiver1 = pc.addTransceiver('audio'); assert_equals(transceiver1.mid, null); @@ -204,8 +210,11 @@ */ promise_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + pc1.addTransceiver('audio'); return pc1.createOffer() diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-answer.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-answer.html index 99f0d48d20a..64b6901f0fa 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-answer.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-answer.html @@ -14,7 +14,6 @@ // generateOffer // generateAnswer // assert_session_desc_equals - // test_state_change_event /* 4.3.2. Interface Definition @@ -61,7 +60,10 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); - test_state_change_event(t, pc, ['have-remote-offer', 'stable']); + t.add_cleanup(() => pc.close()); + + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return pc.createOffer({ offerToReceiveVideo: true }) .then(offer => @@ -79,6 +81,8 @@ assert_equals(pc.pendingLocalDescription, null); assert_equals(pc.pendingRemoteDescription, null); + + assert_array_equals(states, ['have-remote-offer', 'stable']); }))); }, 'setLocalDescription() with valid answer should succeed'); @@ -91,6 +95,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer({ offerToReceiveVideo: true }) .then(offer => pc.setRemoteDescription(offer) @@ -120,6 +126,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer({ offerToReceiveVideo: true }) .then(offer => pc.setRemoteDescription(offer) @@ -142,16 +150,19 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer() .then(offer => promise_rejects(t, 'InvalidStateError', pc.setLocalDescription({ type: 'answer', sdp: offer.sdp }))); - }, 'Calling setLocalDescription(answer) from stable state should reject with InvalidStateError'); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer() .then(offer => pc.setLocalDescription(offer) diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html index 76df63a8a80..d8cb8133b41 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html @@ -14,7 +14,6 @@ // generateOffer // assert_session_desc_not_equals // assert_session_desc_equals - // test_state_change_event /* 4.3.2. Interface Definition @@ -58,7 +57,10 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); - test_state_change_event(t, pc, ['have-local-offer']); + t.add_cleanup(() => pc.close()); + + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return pc.createOffer({ offerToReceiveAudio: true }) .then(offer => @@ -68,6 +70,8 @@ assert_session_desc_equals(pc.localDescription, offer); assert_session_desc_equals(pc.pendingLocalDescription, offer); assert_equals(pc.currentLocalDescription, null); + + assert_array_equals(states, ['have-local-offer']); })); }, 'setLocalDescription with valid offer should succeed'); @@ -79,6 +83,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return pc.createOffer({ offerToReceiveAudio: true }) .then(offer => pc.setLocalDescription({ type: 'offer' }) @@ -99,8 +104,11 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + return generateOffer({ pc, data: true }) .then(offer => promise_rejects(t, 'InvalidModificationError', @@ -113,6 +121,7 @@ // last offer, setLocalDescription would reject when setting // with the first offer const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return pc.createOffer({ offerToReceiveAudio: true }) .then(offer1 => pc.createOffer({ offerToReceiveVideo: true }) @@ -125,9 +134,10 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); - // Only one state change event should be fired - test_state_change_event(t, pc, ['have-local-offer']); + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return pc.createOffer({ offerToReceiveAudio: true }) .then(offer1 => @@ -142,6 +152,8 @@ assert_session_desc_equals(pc.localDescription, offer2); assert_session_desc_equals(pc.pendingLocalDescription, offer2); assert_equals(pc.currentLocalDescription, null); + + assert_array_equals(states, ['have-local-offer']); })))); }, 'Creating and setting offer multiple times should succeed'); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-pranswer.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-pranswer.html index 4d6b011bee6..8b173c441b0 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-pranswer.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-pranswer.html @@ -14,7 +14,6 @@ // generateOffer // generateAnswer // assert_session_desc_equals - // test_state_change_event /* 4.3.2. Interface Definition @@ -64,11 +63,12 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer() .then(offer => promise_rejects(t, 'InvalidStateError', pc.setLocalDescription({ type: 'pranswer', sdp: offer.sdp }))); - }, 'setLocalDescription(pranswer) from stable state should reject with InvalidStateError'); /* @@ -81,7 +81,10 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); - test_state_change_event(t, pc, ['have-remote-offer', 'have-local-pranswer']); + t.add_cleanup(() => pc.close()); + + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return pc.createOffer({ offerToReceiveVideo: true }) .then(offer => @@ -103,13 +106,18 @@ assert_equals(pc.currentLocalDescription, null); assert_equals(pc.pendingRemoteDescription, null); + + assert_array_equals(states, ['have-remote-offer', 'have-local-pranswer']); }); })); }, 'setLocalDescription(pranswer) should succeed'); promise_test(t => { const pc = new RTCPeerConnection(); - test_state_change_event(t, pc, ['have-remote-offer', 'have-local-pranswer']); + t.add_cleanup(() => pc.close()); + + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return pc.createOffer({ offerToReceiveVideo: true }) .then(offer => @@ -119,13 +127,19 @@ const pranswer = { type: 'pranswer', sdp: answer.sdp }; return pc.setLocalDescription(pranswer) - .then(() => pc.setLocalDescription(pranswer)); + .then(() => pc.setLocalDescription(pranswer)) + .then(() => { + assert_array_equals(states, ['have-remote-offer', 'have-local-pranswer']); + }); })); }, 'setLocalDescription(pranswer) can be applied multiple times while still in have-local-pranswer'); promise_test(t => { const pc = new RTCPeerConnection(); - test_state_change_event(t, pc, ['have-remote-offer', 'have-local-pranswer', 'stable']); + t.add_cleanup(() => pc.close()); + + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return pc.createOffer({ offerToReceiveVideo: true }) .then(offer => @@ -146,6 +160,8 @@ assert_equals(pc.pendingLocalDescription, null); assert_equals(pc.pendingRemoteDescription, null); + + assert_array_equals(states, ['have-remote-offer', 'have-local-pranswer', 'stable']); }); })); }, 'setLocalDescription(answer) from have-local-pranswer state should succeed'); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-rollback.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-rollback.html index 5cafb1e3d2d..45ee0cc736a 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-rollback.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-rollback.html @@ -12,7 +12,6 @@ // The following helper functions are called from RTCPeerConnection-helper.js: // assert_session_desc_equals - // test_state_change_event /* 4.3.2. Interface Definition @@ -58,8 +57,10 @@ */ promise_test(t=> { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); - test_state_change_event(t, pc, ['have-local-offer', 'stable']); + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return pc.createOffer() .then(offer => pc.setLocalDescription(offer)) @@ -76,6 +77,8 @@ assert_equals(pc.localDescription, null); assert_equals(pc.pendingLocalDescription, null); assert_equals(pc.currentLocalDescription, null); + + assert_array_equals(states, ['have-local-offer', 'stable']); }); }, 'setLocalDescription(rollback) from have-local-offer state should reset back to stable state'); @@ -94,12 +97,14 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return promise_rejects(t, 'InvalidStateError', pc.setLocalDescription({ type: 'rollback' })); }, `setLocalDescription(rollback) from stable state should reject with InvalidStateError`); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return pc.createOffer({ offerToReceiveAudio: true }) .then(offer => pc.setRemoteDescription(offer) @@ -113,6 +118,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return pc.createOffer() .then(offer => pc.setLocalDescription(offer)) .then(() => pc.setLocalDescription({ diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription.html index 72685bd7b09..078a6ff9c50 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription.html @@ -14,7 +14,6 @@ // generateOffer // assert_session_desc_not_equals // assert_session_desc_equals - // test_state_change_event /* 4.3.2. Interface Definition @@ -46,7 +45,10 @@ promise_test(t => { const pc = new RTCPeerConnection(); - test_state_change_event(t, pc, ['have-local-offer', 'stable', 'have-local-offer']); + t.add_cleanup(() => pc.close()); + + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return pc.createOffer({ offerToReceiveAudio: true }) .then(offer1 => @@ -65,13 +67,17 @@ assert_session_desc_equals(pc.localDescription, offer2); assert_session_desc_equals(pc.currentLocalDescription, offer1); assert_session_desc_equals(pc.pendingLocalDescription, offer2); + + assert_array_equals(states, ['have-local-offer', 'stable', 'have-local-offer']); }))); }, 'Calling createOffer() and setLocalDescription() again after one round of local-offer/remote-answer should succeed'); promise_test(t => { const pc = new RTCPeerConnection(); - test_state_change_event(t, pc, - ['have-remote-offer', 'stable', 'have-local-offer']); + t.add_cleanup(() => pc.close()); + + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return generateOffer({ pc, data: true }) .then(offer => pc.setRemoteDescription(offer)) @@ -86,10 +92,26 @@ assert_session_desc_equals(pc.localDescription, offer); assert_session_desc_equals(pc.currentLocalDescription, answer); assert_session_desc_equals(pc.pendingLocalDescription, offer); - }))); + assert_array_equals(states, ['have-remote-offer', 'stable', 'have-local-offer']); + }))); }, 'Switching role from answerer to offerer after going back to stable state should succeed'); + promise_test(async t => { + const pc = new RTCPeerConnection(); + const offer = await pc.createOffer(); + let eventSequence = ''; + const signalingstatechangeResolver = new Resolver(); + pc.onsignalingstatechange = () => { + eventSequence += 'onsignalingstatechange;'; + signalingstatechangeResolver.resolve(); + }; + await pc.setLocalDescription(offer); + eventSequence += 'setLocalDescription;'; + await signalingstatechangeResolver.promise; + assert_equals(eventSequence, 'onsignalingstatechange;setLocalDescription;'); + }, 'onsignalingstatechange fires before setLocalDescription resolves'); + /* TODO 4.3.2. setLocalDescription diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-answer.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-answer.html index 75bbec80c28..30c7e432896 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-answer.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-answer.html @@ -14,7 +14,6 @@ // generateOffer() // generateAnswer() // assert_session_desc_equals() - // test_state_change_event() /* 4.3.2. Interface Definition @@ -60,7 +59,10 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); - test_state_change_event(t, pc, ['have-local-offer', 'stable']); + t.add_cleanup(() => pc.close()); + + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return pc.createOffer({ offerToReceiveVideo: true }) .then(offer => @@ -79,6 +81,8 @@ assert_equals(pc.pendingLocalDescription, null); assert_equals(pc.pendingRemoteDescription, null); + + assert_array_equals(states, ['have-local-offer', 'stable']); }))); }, 'setRemoteDescription() with valid state and answer should succeed'); @@ -95,6 +99,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer() .then(offer => promise_rejects(t, 'InvalidStateError', @@ -104,6 +110,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer() .then(offer => pc.setRemoteDescription(offer) @@ -111,7 +119,6 @@ .then(answer => promise_rejects(t, 'InvalidStateError', pc.setRemoteDescription(answer))); - }, 'Calling setRemoteDescription(answer) from have-remote-offer state should reject with InvalidStateError'); </script> diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-offer.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-offer.html index 449925cb1db..ae6ee952c6b 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-offer.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-offer.html @@ -12,7 +12,6 @@ // The following helper functions are called from RTCPeerConnection-helper.js: // assert_session_desc_equals() - // test_state_change_event() /* 4.3.2. Interface Definition @@ -52,11 +51,14 @@ promise_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); pc1.createDataChannel('datachannel'); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); - test_state_change_event(t, pc2, ['have-remote-offer']); + const states = []; + pc2.addEventListener('signalingstatechange', () => states.push(pc2.signalingState)); return pc1.createOffer() .then(offer => { @@ -66,18 +68,22 @@ assert_session_desc_equals(pc2.remoteDescription, offer); assert_session_desc_equals(pc2.pendingRemoteDescription, offer); assert_equals(pc2.currentRemoteDescription, null); + + assert_array_equals(states, ['have-remote-offer']); }); }); - }, 'setRemoteDescription with valid offer should succeed'); + }, 'setRemoteDescription with valid offer should succeed'); promise_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); pc1.createDataChannel('datachannel'); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); - // have-remote-offer event should only fire once - test_state_change_event(t, pc2, ['have-remote-offer']); + const states = []; + pc2.addEventListener('signalingstatechange', () => states.push(pc2.signalingState)); return pc1.createOffer() .then(offer => { @@ -88,18 +94,22 @@ assert_session_desc_equals(pc2.remoteDescription, offer); assert_session_desc_equals(pc2.pendingRemoteDescription, offer); assert_equals(pc2.currentRemoteDescription, null); + + assert_array_equals(states, ['have-remote-offer']); }); }); }, 'setRemoteDescription multiple times should succeed'); promise_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); pc1.createDataChannel('datachannel'); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); - // have-remote-offer event should only fire once - test_state_change_event(t, pc2, ['have-remote-offer']); + const states = []; + pc2.addEventListener('signalingstatechange', () => states.push(pc2.signalingState)); return pc1.createOffer() .then(offer1 => { @@ -116,6 +126,8 @@ assert_session_desc_equals(pc2.remoteDescription, offer2); assert_session_desc_equals(pc2.pendingRemoteDescription, offer2); assert_equals(pc2.currentRemoteDescription, null); + + assert_array_equals(states, ['have-remote-offer']); }); }); }); @@ -132,6 +144,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.setRemoteDescription({ type: 'offer', sdp: 'Invalid SDP' @@ -159,6 +173,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return pc.createOffer() .then(offer => { return pc.setLocalDescription(offer) diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-pranswer.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-pranswer.html index 521290fc955..d1073c85f5b 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-pranswer.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-pranswer.html @@ -14,7 +14,6 @@ // generateOffer // generateAnswer // assert_session_desc_equals - // test_state_change_event /* 4.3.2. Interface Definition @@ -64,6 +63,8 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + return pc.createOffer() .then(offer => promise_rejects(t, 'InvalidStateError', @@ -80,7 +81,10 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); - test_state_change_event(t, pc, ['have-local-offer', 'have-remote-pranswer']); + t.add_cleanup(() => pc.close()); + + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return pc.createOffer({ offerToReceiveVideo: true }) .then(offer => @@ -100,13 +104,18 @@ assert_session_desc_equals(pc.remoteDescription, pranswer); assert_session_desc_equals(pc.pendingRemoteDescription, pranswer); assert_equals(pc.currentRemoteDescription, null); + + assert_array_equals(states, ['have-local-offer', 'have-remote-pranswer']); }); })); }, 'setRemoteDescription(pranswer) from have-local-offer state should succeed'); promise_test(t => { const pc = new RTCPeerConnection(); - test_state_change_event(t, pc, ['have-local-offer', 'have-remote-pranswer']); + t.add_cleanup(() => pc.close()); + + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return pc.createOffer({ offerToReceiveVideo: true }) .then(offer => @@ -116,13 +125,19 @@ const pranswer = { type: 'pranswer', sdp: answer.sdp }; return pc.setRemoteDescription(pranswer) - .then(() => pc.setRemoteDescription(pranswer)); + .then(() => pc.setRemoteDescription(pranswer)) + .then(() => { + assert_array_equals(states, ['have-local-offer', 'have-remote-pranswer']); + }); })); }, 'setRemoteDescription(pranswer) multiple times should succeed'); promise_test(t => { const pc = new RTCPeerConnection(); - test_state_change_event(t, pc, ['have-local-offer', 'have-remote-pranswer', 'stable']); + t.add_cleanup(() => pc.close()); + + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return pc.createOffer({ offerToReceiveVideo: true }) .then(offer => @@ -143,6 +158,8 @@ assert_session_desc_equals(pc.remoteDescription, answer); assert_session_desc_equals(pc.currentRemoteDescription, answer); assert_equals(pc.pendingRemoteDescription, null); + + assert_array_equals(states, ['have-local-offer', 'have-remote-pranswer', 'stable']); }); })); }, 'setRemoteDescription(answer) from have-remote-pranswer state should succeed'); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-replaceTrack.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-replaceTrack.https.html index 06408d072af..6c98eae52cd 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-replaceTrack.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-replaceTrack.https.html @@ -12,6 +12,7 @@ async_test(t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); return getUserMediaTracksAndStreams(2) .then(t.step_func(([tracks, streams]) => { const sender = caller.addTrack(tracks[0], streams[0]); @@ -28,6 +29,7 @@ async_test(t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); return getUserMediaTracksAndStreams(1) .then(t.step_func(([tracks, streams]) => { const sender = caller.addTrack(tracks[0], streams[0]); @@ -44,6 +46,7 @@ async_test(t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); return getUserMediaTracksAndStreams(2) .then(t.step_func(([tracks, streams]) => { const sender = caller.addTrack(tracks[0], streams[0]); @@ -62,6 +65,7 @@ async_test(t => { const expectedException = 'InvalidStateError'; const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); return getUserMediaTracksAndStreams(2) .then(t.step_func(([tracks, streams]) => { const sender = caller.addTrack(tracks[0], streams[0]); @@ -84,6 +88,7 @@ async_test(t => { const expectedException = 'InvalidModificationError'; const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); return getUserMediaTracksAndStreams(2) .then(t.step_func(([tracks, streams]) => { const sender = caller.addTrack(tracks[0], streams[0]); @@ -108,6 +113,7 @@ async_test(t => { const expectedException = 'InvalidModificationError'; const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); return getUserMediaTracksAndStreams(2) .then(t.step_func(([tracks, streams]) => { const sender = caller.addTrack(tracks[0], streams[0]); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-rollback.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-rollback.html index 931a25f92b0..f6777237b8d 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-rollback.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-rollback.html @@ -13,7 +13,6 @@ // The following helper functions are called from RTCPeerConnection-helper.js: // generateOffer // assert_session_desc_equals - // test_state_change_event /* 4.3.2. Interface Definition @@ -59,8 +58,10 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); - test_state_change_event(t, pc, ['have-remote-offer', 'stable']); + const states = []; + pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState)); return generateOffer({ data: true }) .then(offer => pc.setRemoteDescription(offer)) @@ -77,6 +78,8 @@ assert_equals(pc.remoteDescription, null); assert_equals(pc.pendingRemoteDescription, null); assert_equals(pc.currentRemoteDescription, null); + + assert_array_equals(states, ['have-remote-offer', 'stable']); }); }, 'setRemoteDescription(rollback) in have-remote-offer state should revert to stable state'); @@ -94,12 +97,14 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return promise_rejects(t, 'InvalidStateError', pc.setRemoteDescription({ type: 'rollback' })); }, `setRemoteDescription(rollback) from stable state should reject with InvalidStateError`); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); return pc.createOffer({ offerToReceiveAudio: true }) .then(offer => pc.setRemoteDescription(offer)) .then(() => pc.setRemoteDescription({ diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-tracks.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-tracks.https.html index d4663e5373b..251d28243ed 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-tracks.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-tracks.https.html @@ -7,420 +7,348 @@ <script> 'use strict'; - // Test is based on the following editor draft: - // https://w3c.github.io/webrtc-pc/archives/20171002/webrtc.html - // The following helper functions are called from RTCPeerConnection-helper.js: - // getUserMediaTracksAndStreams - // performOffer + // addEventListenerPromise + // exchangeOffer + // exchangeOfferAnswer // Resolver // These tests are concerned with the observable consequences of processing // the addition or removal of remote tracks, including events firing and the // states of RTCPeerConnection, MediaStream and MediaStreamTrack. - async_test(t => { + promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); - return getUserMediaTracksAndStreams(1) - .then(t.step_func(([tracks, streams]) => { - const localTrack = tracks[0]; - caller.addTrack(localTrack); - const offerPromise = performOffer(caller, callee); - callee.ontrack = t.step_func(trackEvent => { - const remoteTrack = trackEvent.track; - assert_equals(remoteTrack.id, localTrack.id, - 'Expected local and remote track IDs to match.'); - assert_equals(trackEvent.streams.length, 0, - 'Expected remote track not to belong to a stream.'); - t.done(); - }); - return offerPromise; - })) - .catch(t.step_func(reason => { - assert_unreached(reason); - })); + t.add_cleanup(() => callee.close()); + const localStream = + await navigator.mediaDevices.getUserMedia({audio: true}); + caller.addTrack(localStream.getTracks()[0]); + const ontrackPromise = addEventListenerPromise(t, callee, 'track', e => { + assert_equals(e.track.id, localStream.getTracks()[0].id, + 'Local and remote track IDs match.'); + assert_equals(e.streams.length, 0, 'No remote stream created.'); + }); + await exchangeOffer(caller, callee); + await ontrackPromise; }, 'addTrack() with a track and no stream makes ontrack fire with a track and no stream.'); - async_test(t => { + promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); - return getUserMediaTracksAndStreams(1) - .then(t.step_func(([tracks, streams]) => { - const localTrack = tracks[0]; - const localStream = streams[0]; - caller.addTrack(localTrack, localStream); - const offerPromise = performOffer(caller, callee); - callee.ontrack = t.step_func(trackEvent => { - assert_equals(trackEvent.streams.length, 1, - 'Expected track event to fire with a single stream.'); - const remoteTrack = trackEvent.track; - const remoteStream = trackEvent.streams[0]; - assert_equals(remoteTrack.id, localTrack.id, - 'Expected local and remote track IDs to match.'); - assert_equals(remoteStream.id, localStream.id, - 'Expected local and remote stream IDs to match.'); - assert_array_equals(remoteStream.getTracks(), [remoteTrack], - 'Expected the remote stream\'s tracks to be the remote track.'); - t.done(); - }); - return offerPromise; - })) - .catch(t.step_func(reason => { - assert_unreached(reason); - })); + t.add_cleanup(() => callee.close()); + const localStream = + await navigator.mediaDevices.getUserMedia({audio: true}); + caller.addTrack(localStream.getTracks()[0], localStream); + const ontrackPromise = addEventListenerPromise(t, callee, 'track', e => { + assert_equals(e.track.id, localStream.getTracks()[0].id, + 'Local and remote track IDs match.'); + assert_equals(e.streams.length, 1, 'Created a single remote stream.'); + assert_equals(e.streams[0].id, localStream.id, + 'Local and remote stream IDs match.'); + assert_array_equals(e.streams[0].getTracks(), [e.track], + 'The remote stream contains the remote track.'); + }); + await exchangeOffer(caller, callee); + await ontrackPromise; }, 'addTrack() with a track and a stream makes ontrack fire with a track and a stream.'); - async_test(t => { + promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); let eventSequence = ''; - return getUserMediaTracksAndStreams(1) - .then(t.step_func(([tracks, streams]) => { - const ontrackResolver = new Resolver(); - callee.ontrack = () => { - eventSequence += 'ontrack;'; - ontrackResolver.resolve(); - } - caller.addTrack(tracks[0]); - return Promise.all([ - ontrackResolver.promise, - performOffer(caller, callee).then(() => { - eventSequence += 'setRemoteDescription;'; - }) - ]); - })) - .then(t.step_func(() => { - assert_equals(eventSequence, 'ontrack;setRemoteDescription;'); - t.done(); - })) - .catch(t.step_func(reason => { - assert_unreached(reason); - })); + const localStream = + await navigator.mediaDevices.getUserMedia({audio: true}); + caller.addTrack(localStream.getTracks()[0], localStream); + const ontrackPromise = addEventListenerPromise(t, callee, 'track', e => { + eventSequence += 'ontrack;'; + }); + await exchangeOffer(caller, callee); + eventSequence += 'setRemoteDescription;'; + await ontrackPromise; + assert_equals(eventSequence, 'ontrack;setRemoteDescription;'); }, 'ontrack fires before setRemoteDescription resolves.'); - async_test(t => { + promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); - return getUserMediaTracksAndStreams(2) - .then(t.step_func(([tracks, streams]) => { - const localTrack1 = tracks[0]; - const localTrack2 = tracks[1]; - const localStream = streams[0]; - caller.addTrack(localTrack1, localStream); - caller.addTrack(localTrack2, localStream); - const offerPromise = performOffer(caller, callee); - callee.ontrack = t.step_func(trackEvent => { - assert_equals(trackEvent.streams.length, 1, - 'Expected track event to fire with a single stream.'); - const remoteTrack1 = trackEvent.track; - const remoteStream = trackEvent.streams[0]; - assert_equals(remoteTrack1.id, localTrack1.id, - 'Expected first remote track ID to match first local track ID.'); - assert_equals(remoteStream.getTracks().length, 2, - 'Expected the remote stream to contain two tracks.'); - callee.ontrack = t.step_func(trackEvent => { - assert_equals(trackEvent.streams.length, 1, - 'Expected track event to fire with a single stream.'); - const remoteTrack2 = trackEvent.track; - assert_equals(trackEvent.streams[0], remoteStream, - 'Expected both track events to fire with the same remote stream.'); - assert_equals(remoteTrack2.id, localTrack2.id, - 'Expected second remote track ID to match second local track ID.'); - assert_equals(remoteStream.getTracks().length, 2, - 'Expected the remote stream to contain two tracks.'); - assert_array_equals(remoteStream.getTracks(), [remoteTrack1, remoteTrack2], - 'Expected the remote stream\'s tracks to be the [first, second] remote tracks.'); - t.done(); - }); - }); - return offerPromise; - })) - .catch(t.step_func(reason => { - assert_unreached(reason); - })); + t.add_cleanup(() => callee.close()); + const localStreams = await Promise.all([ + navigator.mediaDevices.getUserMedia({audio: true}), + navigator.mediaDevices.getUserMedia({audio: true}), + ]); + caller.addTrack(localStreams[0].getTracks()[0], localStreams[0]); + caller.addTrack(localStreams[1].getTracks()[0], localStreams[0]); + let ontrackEventsFired = 0; + const ontrackEventResolvers = [ new Resolver(), new Resolver() ]; + callee.ontrack = t.step_func(e => { + ontrackEventResolvers[ontrackEventsFired++].resolve(e); + }); + await exchangeOffer(caller, callee); + let firstTrackEvent = await ontrackEventResolvers[0].promise; + assert_equals(firstTrackEvent.track.id, + localStreams[0].getTracks()[0].id, + 'First ontrack\'s track ID matches first local track.'); + assert_equals(firstTrackEvent.streams.length, 1, + 'First ontrack fires with a single stream.'); + assert_equals(firstTrackEvent.streams[0].id, + localStreams[0].id, + 'First ontrack\'s stream ID matches local stream.'); + let secondTrackEvent = await ontrackEventResolvers[1].promise; + assert_equals(secondTrackEvent.track.id, + localStreams[1].getTracks()[0].id, + 'Second ontrack\'s track ID matches second local track.'); + assert_equals(secondTrackEvent.streams.length, 1, + 'Second ontrack fires with a single stream.'); + assert_equals(secondTrackEvent.streams[0].id, + localStreams[0].id, + 'Second ontrack\'s stream ID matches local stream.'); + assert_array_equals(firstTrackEvent.streams, secondTrackEvent.streams, + 'ontrack was fired with the same streams both times.'); + assert_array_equals(firstTrackEvent.streams[0].getTracks(), + [firstTrackEvent.track, secondTrackEvent.track], + 'The remote stream == [first track, second track].'); + assert_equals(ontrackEventsFired, 2, 'Unexpected number of track events.'); }, 'addTrack() with two tracks and one stream makes ontrack fire twice with the tracks and shared stream.'); - async_test(t => { + promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); - return getUserMediaTracksAndStreams(2) - .then(t.step_func(([tracks, streams]) => { - const localTracks = tracks; - const localStream = streams[0]; - caller.addTrack(localTracks[0], localStream); - const offerPromise = performOffer(caller, callee); - callee.ontrack = t.step_func(trackEvent => { - assert_equals(trackEvent.streams.length, 1, - 'Expected track event to fire with a single stream.'); - const remoteTracks = [ trackEvent.track ]; - const remoteStream = trackEvent.streams[0]; - assert_equals(remoteTracks[0].id, localTracks[0].id, 'Remote track ID.'); - assert_equals(remoteStream.id, localStream.id, 'Remote stream ID.'); - assert_array_equals(remoteStream.getTracks(), remoteTracks, - 'Expected the remote stream\'s tracks to be the remote track.'); - caller.addTrack(localTracks[1], localStream); - performOffer(caller, callee); - remoteStream.onaddtrack = t.step_func(trackEvent => { - remoteTracks.push(trackEvent.track); - assert_equals(remoteTracks[1].id, localTracks[1].id, 'Remote track ID.'); - assert_array_equals(remoteStream.getTracks(), remoteTracks, - 'Expected the remote stream\'s tracks to be the remote tracks.'); - t.done(); - }); - }); - return offerPromise; - })) - .catch(t.step_func(reason => { - assert_unreached(reason); - })); + t.add_cleanup(() => callee.close()); + let eventSequence = ''; + const localStreams = await Promise.all([ + navigator.mediaDevices.getUserMedia({audio: true}), + navigator.mediaDevices.getUserMedia({audio: true}), + ]); + caller.addTrack(localStreams[0].getTracks()[0], localStreams[0]); + const remoteStreams = []; + callee.ontrack = e => { + if (!remoteStreams.includes(e.streams[0])) + remoteStreams.push(e.streams[0]); + }; + await exchangeOfferAnswer(caller, callee); + assert_equals(remoteStreams.length, 1, 'One remote stream created.'); + assert_equals(remoteStreams[0].getTracks()[0].id, + localStreams[0].getTracks()[0].id, + 'First local and remote tracks have the same ID.'); + const onaddtrackPromise = + addEventListenerPromise(t, remoteStreams[0], 'addtrack', e => { + assert_equals(e.track.id, localStreams[1].getTracks()[0].id, + 'Second local and remote tracks have the same ID.'); + }); + caller.addTrack(localStreams[1].getTracks()[0], localStreams[0]); + await exchangeOffer(caller, callee); + await onaddtrackPromise; + assert_equals(remoteStreams.length, 1, 'Still a single remote stream.'); }, 'addTrack() for an existing stream makes stream.onaddtrack fire.'); - async_test(t => { + promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); let eventSequence = ''; - return getUserMediaTracksAndStreams(2) - .then(t.step_func(([tracks, streams]) => { - const localTracks = tracks; - const localStream = streams[0]; - caller.addTrack(localTracks[0], localStream); - const offerPromise = performOffer(caller, callee); - callee.ontrack = t.step_func(trackEvent => { - callee.ontrack = null; - const remoteStream = trackEvent.streams[0]; - const onaddtrackResolver = new Resolver(); - remoteStream.onaddtrack = () => { - eventSequence += 'stream.onaddtrack;'; - onaddtrackResolver.resolve(); - } - caller.addTrack(localTracks[1], localStream); - Promise.all([ - onaddtrackResolver.promise, - performOffer(caller, callee).then(() => { - eventSequence += 'setRemoteDescription;'; - }) - ]).then(t.step_func(() => { - assert_equals(eventSequence, 'stream.onaddtrack;setRemoteDescription;'); - t.done(); - })); - }); - return offerPromise; - })) - .catch(t.step_func(reason => { - assert_unreached(reason); - })); + const localStreams = await Promise.all([ + navigator.mediaDevices.getUserMedia({audio: true}), + navigator.mediaDevices.getUserMedia({audio: true}), + ]); + caller.addTrack(localStreams[0].getTracks()[0], localStreams[0]); + const remoteStreams = []; + callee.ontrack = e => { + if (!remoteStreams.includes(e.streams[0])) + remoteStreams.push(e.streams[0]); + }; + await exchangeOfferAnswer(caller, callee); + assert_equals(remoteStreams.length, 1, 'One remote stream created.'); + const onaddtrackPromise = + addEventListenerPromise(t, remoteStreams[0], 'addtrack', e => { + eventSequence += 'stream.onaddtrack;'; + }); + caller.addTrack(localStreams[1].getTracks()[0], localStreams[0]); + await exchangeOffer(caller, callee); + eventSequence += 'setRemoteDescription;'; + await onaddtrackPromise; + assert_equals(remoteStreams.length, 1, 'Still a single remote stream.'); + assert_equals(eventSequence, 'stream.onaddtrack;setRemoteDescription;'); }, 'stream.onaddtrack fires before setRemoteDescription resolves.'); - async_test(t => { + promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); - return getUserMediaTracksAndStreams(2) - .then(t.step_func(([tracks, streams]) => { - const localTrack = tracks[0]; - const localStreams = streams; - caller.addTrack(localTrack, localStreams[0], localStreams[1]); - const performOffer = performOffer(caller, callee); - callee.ontrack = t.step_func(trackEvent => { - assert_equals(trackEvent.streams.length, 2, - 'Expected the track event to fire with two streams.'); - const remoteTrack = trackEvent.track; - const remoteStreams = trackEvent.streams; - assert_equals(remoteTrack.id, localTrack.id, - 'Expected local and remote track IDs to match.'); - assert_equals(remoteStreams[0].id, localStreams[0].id, - 'Expected the first remote stream ID to match the first local stream ID.'); - assert_equals(remoteStreams[1].id, localStreams[1].id, - 'Expected the second remote stream ID to match the second local stream ID.'); - assert_array_equals(remoteStreams[0].getTracks(), [remoteTrack], - 'Expected the remote stream\'s tracks to be the remote track.'); - assert_array_equals(remoteStreams[1].getTracks(), [remoteTrack], - 'Expected the remote stream\'s tracks to be the remote track.'); - t.done(); - }); - return performOffer; - })) - .catch(t.step_func(reason => { - assert_unreached(reason); - })); + t.add_cleanup(() => callee.close()); + const localStreams = await Promise.all([ + navigator.mediaDevices.getUserMedia({audio: true}), + navigator.mediaDevices.getUserMedia({audio: true}), + ]); + caller.addTrack(localStreams[0].getTracks()[0], + localStreams[0], localStreams[1]); + const ontrackPromise = addEventListenerPromise(t, callee, 'track', e => { + assert_equals(e.track.id, localStreams[0].getTracks()[0].id, + 'Local and remote track IDs match.'); + assert_equals(e.streams.length, 2, 'Two remote stream created.'); + assert_array_equals(e.streams[0].getTracks(), [e.track], + 'First remote stream == [remote track].'); + assert_array_equals(e.streams[1].getTracks(), [e.track], + 'Second remote stream == [remote track].'); + assert_equals(e.streams[0].id, localStreams[0].id, + 'First local and remote stream IDs match.'); + assert_equals(e.streams[1].id, localStreams[1].id, + 'Second local and remote stream IDs match.'); + }); + await exchangeOffer(caller, callee); + await ontrackPromise; }, 'addTrack() with a track and two streams makes ontrack fire with a track and two streams.'); - async_test(t => { + promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); - return getUserMediaTracksAndStreams(1) - .then(t.step_func(([tracks, streams]) => { - caller.addTrack(tracks[0]); - const offerPromise = performOffer(caller, callee); - callee.ontrack = t.step_func(trackEvent => { - assert_array_equals(callee.getReceivers(), [trackEvent.receiver]); - t.done(); - }); - return offerPromise; - })) - .catch(t.step_func(reason => { - assert_unreached(reason); - })); + t.add_cleanup(() => callee.close()); + const localStream = + await navigator.mediaDevices.getUserMedia({audio: true}); + caller.addTrack(localStream.getTracks()[0]); + const ontrackPromise = addEventListenerPromise(t, callee, 'track', e => { + assert_array_equals(callee.getReceivers(), [e.receiver], + 'getReceivers() == [e.receiver].'); + }); + await exchangeOffer(caller, callee); + await ontrackPromise; }, 'ontrack\'s receiver matches getReceivers().'); - async_test(t => { + promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); - return getUserMediaTracksAndStreams(1) - .then(t.step_func(([tracks, streams]) => { - const sender = caller.addTrack(tracks[0]); - assert_not_equals(sender, null); - const offerPromise = performOffer(caller, callee); - callee.ontrack = t.step_func(trackEvent => { - const receivers = callee.getReceivers(); - assert_equals(receivers.length, 1, - 'Expected getReceivers() to be the track event\'s receiver.'); - caller.removeTrack(sender); - performOffer(caller, callee) - .then(t.step_func(() => { - assert_array_equals(callee.getReceivers(), receivers, - 'Expected the set of receivers to remain the same.'); - t.done(); - })); - }); - return offerPromise; - })) - .catch(t.step_func(reason => { - assert_unreached(reason); - })); + t.add_cleanup(() => callee.close()); + const localStream = + await navigator.mediaDevices.getUserMedia({audio: true}); + const sender = caller.addTrack(localStream.getTracks()[0]); + const ontrackPromise = addEventListenerPromise(t, callee, 'track'); + await exchangeOfferAnswer(caller, callee); + await ontrackPromise; + assert_equals(callee.getReceivers().length, 1, 'One receiver created.'); + caller.removeTrack(sender); + await exchangeOffer(caller, callee); + assert_equals(callee.getReceivers().length, 1, 'Receiver not removed.'); }, 'removeTrack() does not remove the receiver.'); - async_test(t => { + promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); - return getUserMediaTracksAndStreams(1) - .then(t.step_func(([tracks, streams]) => { - const sender = caller.addTrack(tracks[0], streams[0]); - assert_not_equals(sender, null); - const offerPromise = performOffer(caller, callee); - callee.ontrack = t.step_func(trackEvent => { - assert_not_equals(trackEvent.track, null); - assert_equals(trackEvent.streams.length, 1); - assert_true(trackEvent.streams[0].getTracks().includes(trackEvent.track)); - caller.removeTrack(sender); - performOffer(caller, callee); - trackEvent.streams[0].onremovetrack = t.step_func(removeEvent => { - assert_equals(removeEvent.track, trackEvent.track); - assert_false(trackEvent.streams[0].getTracks().includes(trackEvent.track)); - t.done(); - }); - }); - return offerPromise; - })) - .catch(t.step_func(reason => { - assert_unreached(reason); - })); + t.add_cleanup(() => callee.close()); + const localStream = + await navigator.mediaDevices.getUserMedia({audio: true}); + const sender = caller.addTrack(localStream.getTracks()[0], localStream); + const ontrackPromise = addEventListenerPromise(t, callee, 'track', e => { + assert_equals(e.streams.length, 1); + return e.streams[0]; + }); + await exchangeOfferAnswer(caller, callee); + const remoteStream = await ontrackPromise; + const remoteTrack = remoteStream.getTracks()[0]; + const onremovetrackPromise = + addEventListenerPromise(t, remoteStream, 'removetrack', e => { + assert_equals(e.track, remoteTrack); + assert_equals(remoteStream.getTracks().length, 0, + 'Remote stream emptied of tracks.'); + }); + caller.removeTrack(sender); + await exchangeOffer(caller, callee); + await onremovetrackPromise; }, 'removeTrack() makes stream.onremovetrack fire and the track to be removed from the stream.'); - async_test(t => { + promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); let eventSequence = ''; - return getUserMediaTracksAndStreams(1) - .then(t.step_func(([tracks, streams]) => { - const sender = caller.addTrack(tracks[0], streams[0]); - assert_not_equals(sender, null); - const offerPromise = performOffer(caller, callee); - callee.ontrack = t.step_func(trackEvent => { - const remoteStream = trackEvent.streams[0]; - const onremovetrackResolver = new Resolver(); - remoteStream.onremovetrack = t.step_func(removeEvent => { - eventSequence += 'stream.onremovetrack;'; - onremovetrackResolver.resolve(); - }); - caller.removeTrack(sender); - return Promise.all([ - onremovetrackResolver.promise, - performOffer(caller, callee).then(() => { - eventSequence += 'setRemoteDescription;'; - }) - ]).then(t.step_func(() => { - assert_equals(eventSequence, 'stream.onremovetrack;setRemoteDescription;'); - t.done(); - })); - }); - return offerPromise; - })) - .catch(t.step_func(reason => { - assert_unreached(reason); - })); + const localStream = + await navigator.mediaDevices.getUserMedia({audio: true}); + const sender = caller.addTrack(localStream.getTracks()[0], localStream); + const ontrackPromise = addEventListenerPromise(t, callee, 'track', e => { + assert_equals(e.streams.length, 1); + return e.streams[0]; + }); + await exchangeOfferAnswer(caller, callee); + const remoteStream = await ontrackPromise; + const remoteTrack = remoteStream.getTracks()[0]; + const onremovetrackPromise = + addEventListenerPromise(t, remoteStream, 'removetrack', e => { + eventSequence += 'stream.onremovetrack;'; + }); + caller.removeTrack(sender); + await exchangeOffer(caller, callee); + eventSequence += 'setRemoteDescription;'; + await onremovetrackPromise; + assert_equals(eventSequence, 'stream.onremovetrack;setRemoteDescription;'); }, 'stream.onremovetrack fires before setRemoteDescription resolves.'); - async_test(t => { + promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); - return getUserMediaTracksAndStreams(1) - .then(t.step_func(([tracks, streams]) => { - const sender = caller.addTrack(tracks[0]); - assert_not_equals(sender, null); - const offerPromise = performOffer(caller, callee); - callee.ontrack = t.step_func(trackEvent => { - const remoteTrack = trackEvent.track; - caller.removeTrack(sender); - performOffer(caller, callee); - remoteTrack.onmute = t.step_func(() => { - assert_true(trackEvent.track.muted); - t.done(); - }); - }); - return offerPromise; - })) - .catch(t.step_func(reason => { - assert_unreached(reason); - })); + t.add_cleanup(() => callee.close()); + const localStream = + await navigator.mediaDevices.getUserMedia({audio: true}); + const sender = caller.addTrack(localStream.getTracks()[0], localStream); + const ontrackPromise = addEventListenerPromise(t, callee, 'track', e => { + assert_equals(e.streams.length, 1); + return e.streams[0]; + }); + await exchangeOfferAnswer(caller, callee); + const remoteStream = await ontrackPromise; + const remoteTrack = remoteStream.getTracks()[0]; + const onmutePromise = + addEventListenerPromise(t, remoteTrack, 'mute', () => { + assert_true(remoteTrack.muted); + }); + caller.removeTrack(sender); + await exchangeOffer(caller, callee); + await onmutePromise; }, 'removeTrack() makes track.onmute fire and the track to be muted.'); - async_test(t => { + promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); let eventSequence = ''; - return getUserMediaTracksAndStreams(1) - .then(t.step_func(([tracks, streams]) => { - const sender = caller.addTrack(tracks[0]); - assert_not_equals(sender, null); - const offerPromise = performOffer(caller, callee); - callee.ontrack = t.step_func(trackEvent => { - const remoteTrack = trackEvent.track; - const onmuteResolver = new Resolver(); - remoteTrack.onmute = t.step_func(() => { - eventSequence += 'track.onmute;'; - onmuteResolver.resolve(); - }); - caller.removeTrack(sender); - return Promise.all([ - onmuteResolver.promise, - performOffer(caller, callee).then(() => { - eventSequence += 'setRemoteDescription;'; - }) - ]).then(t.step_func(() => { - assert_equals(eventSequence, 'track.onmute;setRemoteDescription;'); - t.done(); - })); - }); - return offerPromise; - })) - .catch(t.step_func(reason => { - assert_unreached(reason); - })); + const localStream = + await navigator.mediaDevices.getUserMedia({audio: true}); + const sender = caller.addTrack(localStream.getTracks()[0], localStream); + const ontrackPromise = addEventListenerPromise(t, callee, 'track', e => { + assert_equals(e.streams.length, 1); + return e.streams[0]; + }); + await exchangeOfferAnswer(caller, callee); + const remoteStream = await ontrackPromise; + const remoteTrack = remoteStream.getTracks()[0]; + const onmutePromise = + addEventListenerPromise(t, remoteTrack, 'mute', () => { + eventSequence += 'track.onmute;'; + }); + caller.removeTrack(sender); + await exchangeOffer(caller, callee); + eventSequence += 'setRemoteDescription;'; + await onmutePromise; + assert_equals(eventSequence, 'track.onmute;setRemoteDescription;'); }, 'track.onmute fires before setRemoteDescription resolves.'); - async_test(t => { + promise_test(async t => { const pc = new RTCPeerConnection(); - return getUserMediaTracksAndStreams(1) - .then(t.step_func(([tracks, streams]) => { - const sender = pc.addTrack(tracks[0]); - assert_not_equals(sender, null); - pc.removeTrack(sender); - pc.removeTrack(sender); - t.done(); - })) - .catch(t.step_func(reason => { - assert_unreached(reason); - })); + t.add_cleanup(() => pc.close()); + const stream = await navigator.mediaDevices.getUserMedia({audio: true}); + const sender = pc.addTrack(stream.getTracks()[0]); + pc.removeTrack(sender); + pc.removeTrack(sender); }, 'removeTrack() twice is safe.'); </script> diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-track-stats.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-track-stats.https.html index d833eb9ce11..682e7e57e46 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-track-stats.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-track-stats.https.html @@ -19,6 +19,7 @@ async_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); let track; return getUserMediaTracksAndStreams(1) .then(t.step_func(([tracks, streams]) => { @@ -43,6 +44,7 @@ async_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); let stream; return getUserMediaTracksAndStreams(1) .then(t.step_func(([tracks, streams]) => { @@ -64,6 +66,7 @@ async_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); let track; return getUserMediaTracksAndStreams(1) .then(t.step_func(([tracks, streams]) => { @@ -90,6 +93,7 @@ async_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); let stream; return getUserMediaTracksAndStreams(1) .then(t.step_func(([tracks, streams]) => { @@ -117,6 +121,7 @@ async_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); let track; let stream; return getUserMediaTracksAndStreams(1) @@ -155,6 +160,7 @@ // https://github.com/w3c/webrtc-pc/issues/1125 async_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); let track; let stream; return getUserMediaTracksAndStreams(1) @@ -189,7 +195,9 @@ async_test(t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); let sendingTrack; return getUserMediaTracksAndStreams(1) .then(t.step_func(([tracks, streams]) => { @@ -217,7 +225,9 @@ async_test(t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); let receivingTrack; callee.ontrack = trackEvent => { assert_true(receivingTrack == undefined, 'ontrack has not fired before'); @@ -249,7 +259,9 @@ async_test(t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); let sendingTrack1; let sendingTrack2; let sender; @@ -276,7 +288,9 @@ async_test(t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); let sendingTrack1; let sendingTrack2; let sender; @@ -285,7 +299,7 @@ sendingTrack1 = tracks[0]; sendingTrack2 = tracks[1]; sender = caller.addTrack(sendingTrack1); - return performOffer(caller, callee); + return exchangeOffer(caller, callee); })) .then(t.step_func(() => { return sender.replaceTrack(sendingTrack2); @@ -311,7 +325,9 @@ async_test(t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); let sendingTrack1; let sendingTrack2; let sender; @@ -345,7 +361,9 @@ async_test(t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); let sendingTrack1; let sendingTrack2; let sender; @@ -380,7 +398,9 @@ promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); let [tracks, streams] = await getUserMediaTracksAndStreams(2); let sender = caller.addTrack(tracks[0], streams[0]); callee.addTrack(tracks[1], streams[1]); @@ -426,7 +446,9 @@ promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); let [tracks, streams] = await getUserMediaTracksAndStreams(2); let sender = caller.addTrack(tracks[0], streams[0]); callee.addTrack(tracks[1], streams[1]); @@ -472,7 +494,9 @@ promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); let [tracks, streams] = await getUserMediaTracksAndStreams(2); let sender = caller.addTrack(tracks[0], streams[0]); callee.addTrack(tracks[1], streams[1]); @@ -497,7 +521,9 @@ promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); let [tracks, streams] = await getUserMediaTracksAndStreams(2); let sender = caller.addTrack(tracks[0], streams[0]); callee.addTrack(tracks[1], streams[1]); @@ -523,6 +549,7 @@ promise_test(async t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); let [tracks, streams] = await getUserMediaTracksAndStreams(1); await promise_rejects(t, 'InvalidAccessError', pc.getStats(tracks[0])); }, 'RTCPeerConnection.getStats(track) throws InvalidAccessError when there ' + @@ -530,6 +557,7 @@ promise_test(async t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); let [tracks, streams] = await getUserMediaTracksAndStreams(2); let sender1 = pc.addTrack(tracks[0]); let sender2 = pc.addTrack(tracks[1]); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-codecs.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-codecs.html index 58cad8ae1c3..4ce76d17645 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-codecs.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-codecs.html @@ -82,6 +82,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); validateSenderRtpParameters(param); @@ -96,11 +97,11 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, 'setParameters() with codec.payloadType modified should reject with InvalidModificationError'); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); validateSenderRtpParameters(param); @@ -115,11 +116,11 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, 'setParameters() with codec.mimeType modified should reject with InvalidModificationError'); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); validateSenderRtpParameters(param); @@ -134,11 +135,11 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, 'setParameters() with codec.clockRate modified should reject with InvalidModificationError'); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); validateSenderRtpParameters(param); @@ -153,12 +154,12 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, 'setParameters() with codec.channels modified should reject with InvalidModificationError'); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); validateSenderRtpParameters(param); @@ -173,12 +174,12 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, 'setParameters() with codec.sdpFmtpLine modified should reject with InvalidModificationError'); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); validateSenderRtpParameters(param); @@ -194,11 +195,11 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, 'setParameters() with new codecs inserted should reject with InvalidModificationError'); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); validateSenderRtpParameters(param); @@ -213,11 +214,11 @@ } return sender.setParameters(param); - }, 'setParameters with reordered codecs should succeed'); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); validateSenderRtpParameters(param); @@ -227,7 +228,6 @@ param.codecs = codecs.slice(1); return sender.setParameters(param); - }, 'setParameters with dropped codec should succeed'); </script> diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-degradationPreference.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-degradationPreference.html index 8d0ab7e2b2c..e2c92bc1c08 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-degradationPreference.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-degradationPreference.html @@ -42,6 +42,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); @@ -63,6 +64,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-encodings.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-encodings.html index 5a9630e1532..00c2f479804 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-encodings.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-encodings.html @@ -192,6 +192,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); validateSenderRtpParameters(param); @@ -205,11 +206,11 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, `sender.setParameters() with mismatch number of encodings should reject with InvalidModificationError`); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); validateSenderRtpParameters(param); @@ -218,11 +219,11 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, `sender.setParameters() with encodings unset should reject with InvalidModificationError`); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); @@ -240,11 +241,11 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, `setParameters() with modified encoding.ssrc field should reject with InvalidModificationError`); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); @@ -262,11 +263,11 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, `setParameters() with modified encoding.rtx field should reject with InvalidModificationError`); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); @@ -284,11 +285,11 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, `setParameters() with modified encoding.fec field should reject with InvalidModificationError`); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio', { sendEncodings: [{ rid: 'foo' }], }); @@ -302,7 +303,6 @@ encoding.rid = 'bar'; return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, `setParameters() with modified encoding.rid field should reject with InvalidModificationError`); /* @@ -313,6 +313,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); @@ -322,11 +323,11 @@ encoding.scaleResolutionDownBy = 0.5; return promise_rejects(t, 'RangeError', sender.setParameters(param)); - }, `setParameters() with encoding.scaleResolutionDownBy field set to less than 1.0 should reject with RangeError`); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); @@ -342,13 +343,13 @@ assert_approx_equals(encoding.scaleResolutionDownBy, 1.5, 0.01); }); - }, `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(field, value1, value2, desc) { promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio', { sendEncodings: [{ [field]: value1 diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-headerExtensions.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-headerExtensions.html index ed6b1e682a7..5cec059eb7f 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-headerExtensions.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-headerExtensions.html @@ -57,6 +57,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); validateSenderRtpParameters(param); @@ -69,7 +70,6 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, `setParameters() with modified headerExtensions should reject with InvalidModificationError`); </script> diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-rtcp.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-rtcp.html index 94d5afdb180..c40edf25698 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-rtcp.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-rtcp.html @@ -56,6 +56,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); @@ -75,11 +76,11 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, `setParameters() with modified rtcp.cname should reject with InvalidModificationError`); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); @@ -99,7 +100,6 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, `setParameters() with modified rtcp.reducedSize should reject with InvalidModificationError`); </script> diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-transactionId.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-transactionId.html index 184cdb5a715..02413fe7177 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-transactionId.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-transactionId.html @@ -85,6 +85,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); @@ -95,11 +96,11 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, `sender.setParameters() with transaction ID different from last getParameters() should reject with InvalidModificationError`); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); @@ -109,11 +110,11 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param)); - }, `sender.setParameters() with transaction ID unset should reject with InvalidModificationError`); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param = sender.getParameters(); @@ -123,11 +124,11 @@ .then(() => promise_rejects(t, 'InvalidModificationError', sender.setParameters(param))); - }, `setParameters() twice with the same parameters should reject with InvalidModificationError`); promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const { sender } = pc.addTransceiver('audio'); const param1 = sender.getParameters(); @@ -140,7 +141,6 @@ return promise_rejects(t, 'InvalidModificationError', sender.setParameters(param1)); - }, `setParameters() with parameters older than last getParameters() should reject with InvalidModificationError`); </script> diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getContributingSources.https.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getContributingSources.https.html index 7ddc7e822f3..8ddff5be410 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getContributingSources.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getContributingSources.https.html @@ -40,8 +40,11 @@ promise_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + const ontrackPromise = new Promise(resolve => { pc2.addEventListener('track', trackEvent => { const { receiver } = trackEvent; diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getStats.https.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getStats.https.html index 4da0b0ac623..30b15851fd6 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getStats.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getStats.https.html @@ -46,7 +46,9 @@ promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); const { receiver } = caller.addTransceiver('audio'); await doSignalingHandshake(caller, callee); @@ -57,7 +59,9 @@ promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); const stream = await navigator.mediaDevices.getUserMedia({audio:true}); const [track] = stream.getTracks(); caller.addTrack(track, stream); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html index 236ec8b630e..80685580e22 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html @@ -27,8 +27,11 @@ promise_test(t => { const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + const ontrackPromise = new Promise(resolve => { pc2.addEventListener('track', trackEvent => { const { receiver } = trackEvent; diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-getStats.https.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-getStats.https.html index a20304d6300..a0e2b9dbcf2 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-getStats.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-getStats.https.html @@ -41,7 +41,9 @@ promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); const { sender } = caller.addTransceiver('audio'); await doSignalingHandshake(caller, callee); @@ -52,7 +54,9 @@ promise_test(async t => { const caller = new RTCPeerConnection(); + t.add_cleanup(() => caller.close()); const callee = new RTCPeerConnection(); + t.add_cleanup(() => callee.close()); const stream = await navigator.mediaDevices.getUserMedia({audio:true}); const [track] = stream.getTracks(); const sender = caller.addTrack(track, stream); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-replaceTrack.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-replaceTrack.html index 587ca572e4e..f7f83f264f9 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-replaceTrack.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-replaceTrack.html @@ -33,6 +33,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const track = generateMediaStreamTrack('audio'); const transceiver = pc.addTransceiver('audio'); @@ -41,7 +42,6 @@ return promise_rejects(t, 'InvalidStateError', sender.replaceTrack(track)); - }, 'Calling replaceTrack on closed connection should reject with InvalidStateError'); /* @@ -52,6 +52,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const track = generateMediaStreamTrack('video'); const transceiver = pc.addTransceiver('audio'); @@ -59,7 +60,6 @@ return promise_rejects(t, new TypeError(), sender.replaceTrack(track)); - }, 'Calling replaceTrack with track of different kind should reject with TypeError'); /* @@ -69,6 +69,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const track = generateMediaStreamTrack('audio'); const transceiver = pc.addTransceiver('audio'); @@ -77,7 +78,6 @@ return promise_rejects(t, 'InvalidStateError', sender.replaceTrack(track)); - }, 'Calling replaceTrack on stopped sender should reject with InvalidStateError'); /* @@ -88,6 +88,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const track = generateMediaStreamTrack('audio'); const transceiver = pc.addTransceiver('audio'); @@ -102,6 +103,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const track1 = generateMediaStreamTrack('audio'); const track2 = generateMediaStreamTrack('audio'); @@ -118,6 +120,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const track = generateMediaStreamTrack('audio'); const transceiver = pc.addTransceiver(track); @@ -144,6 +147,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const track = generateMediaStreamTrack('audio'); const transceiver = pc.addTransceiver(track); @@ -173,6 +177,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const track1 = generateMediaStreamTrack('audio'); const track2 = generateMediaStreamTrack('audio'); @@ -204,6 +209,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const track1 = generateMediaStreamTrack('audio'); const track2 = generateMediaStreamTrack('audio'); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-setParameters.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-setParameters.html index d8fbe35e75a..1278737414c 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-setParameters.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-setParameters.html @@ -16,6 +16,7 @@ */ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const transceiver = pc.addTransceiver('audio'); const { sender } = transceiver; @@ -24,7 +25,6 @@ return promise_rejects(t, 'InvalidStateError', sender.setParameters(param)); - }, `setParameters() when transceiver is stopped should reject with InvalidStateError`); </script> diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-setDirection.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-setDirection.html index 00cddce7d40..32cbff5d985 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-setDirection.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-setDirection.html @@ -56,6 +56,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); const transceiver = pc.addTransceiver('audio', { direction: 'recvonly' }); assert_equals(transceiver.direction, 'recvonly'); assert_equals(transceiver.currentDirection, null); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCSctpTransport-constructor.html b/tests/wpt/web-platform-tests/webrtc/RTCSctpTransport-constructor.html index 347aa0ef4bd..c415c3fe180 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCSctpTransport-constructor.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCSctpTransport-constructor.html @@ -41,6 +41,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); assert_equals(pc.sctp, null); pc.createDataChannel('test'); @@ -65,6 +66,7 @@ promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); assert_equals(pc.sctp, null); return generateOffer({ pc, data: true }) diff --git a/tests/wpt/web-platform-tests/webrtc/RTCSctpTransport-maxMessageSize.html b/tests/wpt/web-platform-tests/webrtc/RTCSctpTransport-maxMessageSize.html index d7f836292eb..28d17eeaccf 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCSctpTransport-maxMessageSize.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCSctpTransport-maxMessageSize.html @@ -45,6 +45,7 @@ const remoteValue2 = 2; promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); assert_equals(pc.sctp, null); let maxMessageSize; @@ -69,6 +70,7 @@ promise_test(t => { promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); assert_equals(pc.sctp, null); return generateOffer({ pc, data: true }) @@ -97,6 +99,7 @@ promise_test(t => { promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); assert_equals(pc.sctp, null); return generateOffer({ pc, data: true }) @@ -118,6 +121,7 @@ promise_test(t => { promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); assert_equals(pc.sctp, null); return generateOffer({ pc, data: true }) @@ -152,6 +156,7 @@ promise_test(t => { promise_test(t => { const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); assert_equals(pc.sctp, null); const largerThanCanSendSize = canSendSize + 1; |