diff --git a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-simple-height-change.html.ini b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-simple-height-change.html.ini new file mode 100644 index 00000000000..d8164acdb14 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-simple-height-change.html.ini @@ -0,0 +1,3 @@ +[align-content-block-simple-height-change.html] + [Updating a container height should align the content again] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-valid-hsl.html.ini b/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-valid-hsl.html.ini index b7142ed0ee1..fb22c6bf352 100644 --- a/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-valid-hsl.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-valid-hsl.html.ini @@ -16,3 +16,36 @@ [e.style['color'\] = "hsl(90 50% 50% / calc(0 / 0))" should set the property value] expected: FAIL + + [e.style['color'\] = "hsl(120 30 50)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hsl(120 30 50 / 0.5)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hsl(120 30% 50)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hsl(120 30% 50 / 0.5)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hsl(120 30 50%)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hsl(120 30 50% / 0.5)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hsl(120 none 50)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hsl(120 none 50 / 0.5)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hsl(120 30 none)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hsl(120 30 none / 0.5)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hsl(120 30 50 / none)" should set the property value] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-valid-hwb.html.ini b/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-valid-hwb.html.ini index 9644c0d12fd..9532bbe6531 100644 --- a/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-valid-hwb.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-valid-hwb.html.ini @@ -16,3 +16,36 @@ [e.style['color'\] = "hwb(90 20% 10% / calc(0 / 0))" should set the property value] expected: FAIL + + [e.style['color'\] = "hwb(120 30 50)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hwb(120 30 50 / 0.5)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hwb(120 30% 50)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hwb(120 30% 50 / 0.5)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hwb(120 30 50%)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hwb(120 30 50% / 0.5)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hwb(120 none 50)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hwb(120 none 50 / 0.5)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hwb(120 30 none)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hwb(120 30 none / 0.5)" should set the property value] + expected: FAIL + + [e.style['color'\] = "hwb(120 30 50 / none)" should set the property value] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-values/progress-computed.tentative.html.ini b/tests/wpt/meta-legacy-layout/css/css-values/progress-computed.tentative.html.ini new file mode 100644 index 00000000000..740691a9d0e --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-values/progress-computed.tentative.html.ini @@ -0,0 +1,27 @@ +[progress-computed.tentative.html] + [progress(1 from 0 to 1) should be used-value-equivalent to 1] + expected: FAIL + + [progress(progress(1 from 0 to 1) from progress(0px from 0px to 1px) to progress(1deg from 0deg to 1deg)) should be used-value-equivalent to 1] + expected: FAIL + + [progress(sign(-10px) * 10px from (10px - 10px) to 10px * progress(1deg from 0deg to 1deg)) should be used-value-equivalent to -1] + expected: FAIL + + [calc(progress(100px from 0px to 50px) * 10px + 100px) should be used-value-equivalent to 120px] + expected: FAIL + + [calc(progress(100 from 0 to sign(50px))) should be used-value-equivalent to 100] + expected: FAIL + + [calc(progress(abs(5%) from hypot(3%, 4%) to 10%)) should be used-value-equivalent to 1] + expected: FAIL + + [calc(progress(1 from 0 to 1) * 10px) should be used-value-equivalent to 10px] + expected: FAIL + + [calc(progress(1 from 0 to 1) * 1s) should be used-value-equivalent to 1s] + expected: FAIL + + [calc(progress(1 from 0 to 1) * 1deg) should be used-value-equivalent to 1deg] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-values/progress-serialize.tentative.html.ini b/tests/wpt/meta-legacy-layout/css/css-values/progress-serialize.tentative.html.ini new file mode 100644 index 00000000000..b03213eef76 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-values/progress-serialize.tentative.html.ini @@ -0,0 +1,66 @@ +[progress-serialize.tentative.html] + ['progress(100px from 0px to 100px)' as a specified value should serialize as 'calc(1)'.] + expected: FAIL + + ['scale(progress(100px from 0px to 100px))' as a specified value should serialize as 'scale(calc(1))'.] + expected: FAIL + + ['scale(progress(100px from 0px to 100px))' as a computed value should serialize as 'matrix(1, 0, 0, 1, 0, 0)'.] + expected: FAIL + + ['progress(10em from 0px to 10em)' as a specified value should serialize as 'calc(progress(10em from 0px to 10em))'.] + expected: FAIL + + ['scale(progress(10em from 0px to 10em))' as a specified value should serialize as 'scale(calc(progress(10em from 0px to 10em)))'.] + expected: FAIL + + ['scale(progress(10em from 0px to 10em))' as a computed value should serialize as 'matrix(1, 0, 0, 1, 0, 0)'.] + expected: FAIL + + ['progress(10em from 0px to 10rem)' as a specified value should serialize as 'calc(progress(10em from 0px to 10rem))'.] + expected: FAIL + + ['scale(progress(10em from 0px to 10rem))' as a specified value should serialize as 'scale(calc(progress(10em from 0px to 10rem)))'.] + expected: FAIL + + ['scale(progress(10em from 0px to 10rem))' as a computed value should serialize as 'matrix(1, 0, 0, 1, 0, 0)'.] + expected: FAIL + + ['progress(100px from (10px - 10px) to 100px)' as a specified value should serialize as 'calc(1)'.] + expected: FAIL + + ['scale(progress(100px from (10px - 10px) to 100px))' as a specified value should serialize as 'scale(calc(1))'.] + expected: FAIL + + ['scale(progress(100px from (10px - 10px) to 100px))' as a computed value should serialize as 'matrix(1, 0, 0, 1, 0, 0)'.] + expected: FAIL + + ['progress(1% from (10% - 10%) to 100%)' as a specified value should serialize as 'calc(0.01)'.] + expected: FAIL + + ['scale(progress(1% from (10% - 10%) to 100%))' as a specified value should serialize as 'scale(calc(0.01))'.] + expected: FAIL + + ['progress(1% from (10% - 10%) to 100%)' as a computed value should serialize as '0.01'.] + expected: FAIL + + ['scale(progress(1% from (10% - 10%) to 100%))' as a computed value should serialize as 'matrix(0.01, 0, 0, 0.01, 0, 0)'.] + expected: FAIL + + ['calc(0.5 * progress(100px from 0px to 100px))' as a specified value should serialize as 'calc(0.5)'.] + expected: FAIL + + ['scale(calc(0.5 * progress(100px from 0px to 100px)))' as a specified value should serialize as 'scale(calc(0.5))'.] + expected: FAIL + + ['calc(0.5 * progress(100px from 0px to 100px))' as a computed value should serialize as '0.5'.] + expected: FAIL + + ['scale(calc(0.5 * progress(100px from 0px to 100px)))' as a computed value should serialize as 'matrix(0.5, 0, 0, 0.5, 0, 0)'.] + expected: FAIL + + ['calc(50px * progress(100px from 0px to 100px))' as a specified value should serialize as 'calc(50px)'.] + expected: FAIL + + ['calc(1px * progress(abs(10%) from (10% - 10%) to 100% / 10))' as a computed value should serialize as '1px'.] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-values/signs-abs-computed.html.ini b/tests/wpt/meta-legacy-layout/css/css-values/signs-abs-computed.html.ini index 700fc02cfe6..86afe4029a6 100644 --- a/tests/wpt/meta-legacy-layout/css/css-values/signs-abs-computed.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-values/signs-abs-computed.html.ini @@ -742,3 +742,6 @@ [calc(10 - abs(20 - sign(2 - abs(-20)))) should be used-value-equivalent to -11] expected: FAIL + + [calc((1em + 1px) * (sign(1em - 10px - 10%) + 1)) should be used-value-equivalent to 21px] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-values/sin-cos-tan-serialize.html.ini b/tests/wpt/meta-legacy-layout/css/css-values/sin-cos-tan-serialize.html.ini index 102a346eec9..a7cc3ac4342 100644 --- a/tests/wpt/meta-legacy-layout/css/css-values/sin-cos-tan-serialize.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-values/sin-cos-tan-serialize.html.ini @@ -376,3 +376,813 @@ ['scale(calc(calc(tan(NaN))))' as a specified value should serialize as 'scale(calc(NaN))'.] expected: FAIL + + [cos(0) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [cos(0) should be computed-value-equivalent to 1] + expected: FAIL + + [cos(0) should be used-value-equivalent to 1] + expected: FAIL + + [calc(cos(0)) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [calc(cos(0)) should be computed-value-equivalent to 1] + expected: FAIL + + [calc(cos(0)) should be used-value-equivalent to 1] + expected: FAIL + + [sin(0) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [sin(0) should be computed-value-equivalent to 0] + expected: FAIL + + [sin(0) should be used-value-equivalent to 0] + expected: FAIL + + [calc(sin(0)) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [calc(sin(0)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(sin(0)) should be used-value-equivalent to 0] + expected: FAIL + + [tan(0) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [tan(0) should be computed-value-equivalent to 0] + expected: FAIL + + [tan(0) should be used-value-equivalent to 0] + expected: FAIL + + [calc(tan(0)) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [calc(tan(0)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(tan(0)) should be used-value-equivalent to 0] + expected: FAIL + + [calc(sin(0) + 0.5) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [calc(sin(0) + 0.5) should be computed-value-equivalent to 0.5] + expected: FAIL + + [calc(sin(0) + 0.5) should be used-value-equivalent to 0.5] + expected: FAIL + + [calc(calc(sin(0) + 0.5)) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [calc(calc(sin(0) + 0.5)) should be computed-value-equivalent to 0.5] + expected: FAIL + + [calc(calc(sin(0) + 0.5)) should be used-value-equivalent to 0.5] + expected: FAIL + + [calc(sin(0) + cos(0) + tan(0)) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [calc(sin(0) + cos(0) + tan(0)) should be computed-value-equivalent to 1] + expected: FAIL + + [calc(sin(0) + cos(0) + tan(0)) should be used-value-equivalent to 1] + expected: FAIL + + [calc(calc(sin(0) + cos(0) + tan(0))) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [calc(calc(sin(0) + cos(0) + tan(0))) should be computed-value-equivalent to 1] + expected: FAIL + + [calc(calc(sin(0) + cos(0) + tan(0))) should be used-value-equivalent to 1] + expected: FAIL + + [calc(cos(0) + 0.5) should be specified-value-equivalent to calc(1.5)] + expected: FAIL + + [calc(cos(0) + 0.5) should be computed-value-equivalent to 1.5] + expected: FAIL + + [calc(cos(0) + 0.5) should be used-value-equivalent to 1.5] + expected: FAIL + + [calc(calc(cos(0) + 0.5)) should be specified-value-equivalent to calc(1.5)] + expected: FAIL + + [calc(calc(cos(0) + 0.5)) should be computed-value-equivalent to 1.5] + expected: FAIL + + [calc(calc(cos(0) + 0.5)) should be used-value-equivalent to 1.5] + expected: FAIL + + [calc(tan(0) + 0.5) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [calc(tan(0) + 0.5) should be computed-value-equivalent to 0.5] + expected: FAIL + + [calc(tan(0) + 0.5) should be used-value-equivalent to 0.5] + expected: FAIL + + [calc(calc(tan(0) + 0.5)) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [calc(calc(tan(0) + 0.5)) should be computed-value-equivalent to 0.5] + expected: FAIL + + [calc(calc(tan(0) + 0.5)) should be used-value-equivalent to 0.5] + expected: FAIL + + [cos(0deg) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [cos(0deg) should be computed-value-equivalent to 1] + expected: FAIL + + [cos(0deg) should be used-value-equivalent to 1] + expected: FAIL + + [calc(cos(0deg)) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [calc(cos(0deg)) should be computed-value-equivalent to 1] + expected: FAIL + + [calc(cos(0deg)) should be used-value-equivalent to 1] + expected: FAIL + + [sin(0deg) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [sin(0deg) should be computed-value-equivalent to 0] + expected: FAIL + + [sin(0deg) should be used-value-equivalent to 0] + expected: FAIL + + [calc(sin(0deg)) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [calc(sin(0deg)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(sin(0deg)) should be used-value-equivalent to 0] + expected: FAIL + + [tan(0deg) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [tan(0deg) should be computed-value-equivalent to 0] + expected: FAIL + + [tan(0deg) should be used-value-equivalent to 0] + expected: FAIL + + [calc(tan(0deg)) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [calc(tan(0deg)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(tan(0deg)) should be used-value-equivalent to 0] + expected: FAIL + + [sin(30deg) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [sin(30deg) should be computed-value-equivalent to 0.5] + expected: FAIL + + [sin(30deg) should be used-value-equivalent to 0.5] + expected: FAIL + + [calc(sin(30deg)) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [calc(sin(30deg)) should be computed-value-equivalent to 0.5] + expected: FAIL + + [calc(sin(30deg)) should be used-value-equivalent to 0.5] + expected: FAIL + + [sin(0.523599) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [sin(0.523599) should be computed-value-equivalent to 0.5] + expected: FAIL + + [sin(0.523599) should be used-value-equivalent to 0.5] + expected: FAIL + + [calc(sin(0.523599)) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [calc(sin(0.523599)) should be computed-value-equivalent to 0.5] + expected: FAIL + + [calc(sin(0.523599)) should be used-value-equivalent to 0.5] + expected: FAIL + + [sin(0.523599rad) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [sin(0.523599rad) should be computed-value-equivalent to 0.5] + expected: FAIL + + [sin(0.523599rad) should be used-value-equivalent to 0.5] + expected: FAIL + + [calc(sin(0.523599rad)) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [calc(sin(0.523599rad)) should be computed-value-equivalent to 0.5] + expected: FAIL + + [calc(sin(0.523599rad)) should be used-value-equivalent to 0.5] + expected: FAIL + + [sin(33.333333grad) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [sin(33.333333grad) should be computed-value-equivalent to 0.5] + expected: FAIL + + [sin(33.333333grad) should be used-value-equivalent to 0.5] + expected: FAIL + + [calc(sin(33.333333grad)) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [calc(sin(33.333333grad)) should be computed-value-equivalent to 0.5] + expected: FAIL + + [calc(sin(33.333333grad)) should be used-value-equivalent to 0.5] + expected: FAIL + + [sin(0.08333333turn) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [sin(0.08333333turn) should be computed-value-equivalent to 0.5] + expected: FAIL + + [sin(0.08333333turn) should be used-value-equivalent to 0.5] + expected: FAIL + + [calc(sin(0.08333333turn)) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [calc(sin(0.08333333turn)) should be computed-value-equivalent to 0.5] + expected: FAIL + + [calc(sin(0.08333333turn)) should be used-value-equivalent to 0.5] + expected: FAIL + + [cos(60deg) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [cos(60deg) should be computed-value-equivalent to 0.5] + expected: FAIL + + [cos(60deg) should be used-value-equivalent to 0.5] + expected: FAIL + + [calc(cos(60deg)) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [calc(cos(60deg)) should be computed-value-equivalent to 0.5] + expected: FAIL + + [calc(cos(60deg)) should be used-value-equivalent to 0.5] + expected: FAIL + + [cos(66.66666666grad) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [cos(66.66666666grad) should be computed-value-equivalent to 0.5] + expected: FAIL + + [cos(66.66666666grad) should be used-value-equivalent to 0.5] + expected: FAIL + + [calc(cos(66.66666666grad)) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [calc(cos(66.66666666grad)) should be computed-value-equivalent to 0.5] + expected: FAIL + + [calc(cos(66.66666666grad)) should be used-value-equivalent to 0.5] + expected: FAIL + + [cos(1.047197551) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [cos(1.047197551) should be computed-value-equivalent to 0.5] + expected: FAIL + + [cos(1.047197551) should be used-value-equivalent to 0.5] + expected: FAIL + + [calc(cos(1.047197551)) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [calc(cos(1.047197551)) should be computed-value-equivalent to 0.5] + expected: FAIL + + [calc(cos(1.047197551)) should be used-value-equivalent to 0.5] + expected: FAIL + + [cos(1.047197551rad) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [cos(1.047197551rad) should be computed-value-equivalent to 0.5] + expected: FAIL + + [cos(1.047197551rad) should be used-value-equivalent to 0.5] + expected: FAIL + + [calc(cos(1.047197551rad)) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [calc(cos(1.047197551rad)) should be computed-value-equivalent to 0.5] + expected: FAIL + + [calc(cos(1.047197551rad)) should be used-value-equivalent to 0.5] + expected: FAIL + + [cos(0.16666666666turn) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [cos(0.16666666666turn) should be computed-value-equivalent to 0.5] + expected: FAIL + + [cos(0.16666666666turn) should be used-value-equivalent to 0.5] + expected: FAIL + + [calc(cos(0.16666666666turn)) should be specified-value-equivalent to calc(0.5)] + expected: FAIL + + [calc(cos(0.16666666666turn)) should be computed-value-equivalent to 0.5] + expected: FAIL + + [calc(cos(0.16666666666turn)) should be used-value-equivalent to 0.5] + expected: FAIL + + [tan(45deg) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [tan(45deg) should be computed-value-equivalent to 1] + expected: FAIL + + [tan(45deg) should be used-value-equivalent to 1] + expected: FAIL + + [calc(tan(45deg)) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [calc(tan(45deg)) should be computed-value-equivalent to 1] + expected: FAIL + + [calc(tan(45deg)) should be used-value-equivalent to 1] + expected: FAIL + + [tan(50grad) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [tan(50grad) should be computed-value-equivalent to 1] + expected: FAIL + + [tan(50grad) should be used-value-equivalent to 1] + expected: FAIL + + [calc(tan(50grad)) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [calc(tan(50grad)) should be computed-value-equivalent to 1] + expected: FAIL + + [calc(tan(50grad)) should be used-value-equivalent to 1] + expected: FAIL + + [tan(0.78539816) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [tan(0.78539816) should be computed-value-equivalent to 1] + expected: FAIL + + [tan(0.78539816) should be used-value-equivalent to 1] + expected: FAIL + + [calc(tan(0.78539816)) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [calc(tan(0.78539816)) should be computed-value-equivalent to 1] + expected: FAIL + + [calc(tan(0.78539816)) should be used-value-equivalent to 1] + expected: FAIL + + [tan(0.78539816rad) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [tan(0.78539816rad) should be computed-value-equivalent to 1] + expected: FAIL + + [tan(0.78539816rad) should be used-value-equivalent to 1] + expected: FAIL + + [calc(tan(0.78539816rad)) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [calc(tan(0.78539816rad)) should be computed-value-equivalent to 1] + expected: FAIL + + [calc(tan(0.78539816rad)) should be used-value-equivalent to 1] + expected: FAIL + + [tan(0.125turn) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [tan(0.125turn) should be computed-value-equivalent to 1] + expected: FAIL + + [tan(0.125turn) should be used-value-equivalent to 1] + expected: FAIL + + [calc(tan(0.125turn)) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [calc(tan(0.125turn)) should be computed-value-equivalent to 1] + expected: FAIL + + [calc(tan(0.125turn)) should be used-value-equivalent to 1] + expected: FAIL + + [sin(180deg) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [sin(180deg) should be computed-value-equivalent to 0] + expected: FAIL + + [sin(180deg) should be used-value-equivalent to 0] + expected: FAIL + + [calc(sin(180deg)) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [calc(sin(180deg)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(sin(180deg)) should be used-value-equivalent to 0] + expected: FAIL + + [cos(180deg) should be specified-value-equivalent to calc(-1)] + expected: FAIL + + [cos(180deg) should be computed-value-equivalent to -1] + expected: FAIL + + [cos(180deg) should be used-value-equivalent to -1] + expected: FAIL + + [calc(cos(180deg)) should be specified-value-equivalent to calc(-1)] + expected: FAIL + + [calc(cos(180deg)) should be computed-value-equivalent to -1] + expected: FAIL + + [calc(cos(180deg)) should be used-value-equivalent to -1] + expected: FAIL + + [tan(180deg) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [tan(180deg) should be computed-value-equivalent to 0] + expected: FAIL + + [tan(180deg) should be used-value-equivalent to 0] + expected: FAIL + + [calc(tan(180deg)) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [calc(tan(180deg)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(tan(180deg)) should be used-value-equivalent to 0] + expected: FAIL + + [sin(270deg) should be specified-value-equivalent to calc(-1)] + expected: FAIL + + [sin(270deg) should be computed-value-equivalent to -1] + expected: FAIL + + [sin(270deg) should be used-value-equivalent to -1] + expected: FAIL + + [calc(sin(270deg)) should be specified-value-equivalent to calc(-1)] + expected: FAIL + + [calc(sin(270deg)) should be computed-value-equivalent to -1] + expected: FAIL + + [calc(sin(270deg)) should be used-value-equivalent to -1] + expected: FAIL + + [cos(270deg) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [cos(270deg) should be computed-value-equivalent to 0] + expected: FAIL + + [cos(270deg) should be used-value-equivalent to 0] + expected: FAIL + + [calc(cos(270deg)) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [calc(cos(270deg)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(cos(270deg)) should be used-value-equivalent to 0] + expected: FAIL + + [sin(-180deg) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [sin(-180deg) should be computed-value-equivalent to 0] + expected: FAIL + + [sin(-180deg) should be used-value-equivalent to 0] + expected: FAIL + + [calc(sin(-180deg)) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [calc(sin(-180deg)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(sin(-180deg)) should be used-value-equivalent to 0] + expected: FAIL + + [cos(-180deg) should be specified-value-equivalent to calc(-1)] + expected: FAIL + + [cos(-180deg) should be computed-value-equivalent to -1] + expected: FAIL + + [cos(-180deg) should be used-value-equivalent to -1] + expected: FAIL + + [calc(cos(-180deg)) should be specified-value-equivalent to calc(-1)] + expected: FAIL + + [calc(cos(-180deg)) should be computed-value-equivalent to -1] + expected: FAIL + + [calc(cos(-180deg)) should be used-value-equivalent to -1] + expected: FAIL + + [tan(-180deg) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [tan(-180deg) should be computed-value-equivalent to 0] + expected: FAIL + + [tan(-180deg) should be used-value-equivalent to 0] + expected: FAIL + + [calc(tan(-180deg)) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [calc(tan(-180deg)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(tan(-180deg)) should be used-value-equivalent to 0] + expected: FAIL + + [sin(-270deg) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [sin(-270deg) should be computed-value-equivalent to 1] + expected: FAIL + + [sin(-270deg) should be used-value-equivalent to 1] + expected: FAIL + + [calc(sin(-270deg)) should be specified-value-equivalent to calc(1)] + expected: FAIL + + [calc(sin(-270deg)) should be computed-value-equivalent to 1] + expected: FAIL + + [calc(sin(-270deg)) should be used-value-equivalent to 1] + expected: FAIL + + [cos(-270deg) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [cos(-270deg) should be computed-value-equivalent to 0] + expected: FAIL + + [cos(-270deg) should be used-value-equivalent to 0] + expected: FAIL + + [calc(cos(-270deg)) should be specified-value-equivalent to calc(0)] + expected: FAIL + + [calc(cos(-270deg)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(cos(-270deg)) should be used-value-equivalent to 0] + expected: FAIL + + [calc(sin(30deg) + cos(60deg) + tan(45deg)) should be specified-value-equivalent to calc(2)] + expected: FAIL + + [calc(sin(30deg) + cos(60deg) + tan(45deg)) should be computed-value-equivalent to 2] + expected: FAIL + + [calc(sin(30deg) + cos(60deg) + tan(45deg)) should be used-value-equivalent to 2] + expected: FAIL + + [calc(calc(sin(30deg) + cos(60deg) + tan(45deg))) should be specified-value-equivalent to calc(2)] + expected: FAIL + + [calc(calc(sin(30deg) + cos(60deg) + tan(45deg))) should be computed-value-equivalent to 2] + expected: FAIL + + [calc(calc(sin(30deg) + cos(60deg) + tan(45deg))) should be used-value-equivalent to 2] + expected: FAIL + + [calc(sin(infinity)) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(sin(infinity)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(sin(infinity)) should be used-value-equivalent to 0] + expected: FAIL + + [calc(calc(sin(infinity))) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(calc(sin(infinity))) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(calc(sin(infinity))) should be used-value-equivalent to 0] + expected: FAIL + + [calc(cos(infinity)) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(cos(infinity)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(cos(infinity)) should be used-value-equivalent to 0] + expected: FAIL + + [calc(calc(cos(infinity))) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(calc(cos(infinity))) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(calc(cos(infinity))) should be used-value-equivalent to 0] + expected: FAIL + + [calc(tan(infinity)) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(tan(infinity)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(tan(infinity)) should be used-value-equivalent to 0] + expected: FAIL + + [calc(calc(tan(infinity))) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(calc(tan(infinity))) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(calc(tan(infinity))) should be used-value-equivalent to 0] + expected: FAIL + + [calc(sin(-infinity)) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(sin(-infinity)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(sin(-infinity)) should be used-value-equivalent to 0] + expected: FAIL + + [calc(calc(sin(-infinity))) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(calc(sin(-infinity))) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(calc(sin(-infinity))) should be used-value-equivalent to 0] + expected: FAIL + + [calc(cos(-infinity)) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(cos(-infinity)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(cos(-infinity)) should be used-value-equivalent to 0] + expected: FAIL + + [calc(calc(cos(-infinity))) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(calc(cos(-infinity))) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(calc(cos(-infinity))) should be used-value-equivalent to 0] + expected: FAIL + + [calc(tan(-infinity)) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(tan(-infinity)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(tan(-infinity)) should be used-value-equivalent to 0] + expected: FAIL + + [calc(calc(tan(-infinity))) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(calc(tan(-infinity))) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(calc(tan(-infinity))) should be used-value-equivalent to 0] + expected: FAIL + + [calc(sin(NaN)) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(sin(NaN)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(sin(NaN)) should be used-value-equivalent to 0] + expected: FAIL + + [calc(calc(sin(NaN))) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(calc(sin(NaN))) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(calc(sin(NaN))) should be used-value-equivalent to 0] + expected: FAIL + + [calc(cos(NaN)) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(cos(NaN)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(cos(NaN)) should be used-value-equivalent to 0] + expected: FAIL + + [calc(calc(cos(NaN))) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(calc(cos(NaN))) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(calc(cos(NaN))) should be used-value-equivalent to 0] + expected: FAIL + + [calc(tan(NaN)) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(tan(NaN)) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(tan(NaN)) should be used-value-equivalent to 0] + expected: FAIL + + [calc(calc(tan(NaN))) should be specified-value-equivalent to calc(NaN)] + expected: FAIL + + [calc(calc(tan(NaN))) should be computed-value-equivalent to 0] + expected: FAIL + + [calc(calc(tan(NaN))) should be used-value-equivalent to 0] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini b/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini index d52a3e77a70..314dca9c1f5 100644 --- a/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini +++ b/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini @@ -1,6 +1,3 @@ [MediaQueryList-addListener-removeListener.html] [listeners are called when + + +
+ diff --git a/tests/wpt/tests/css/css-values/progress-invalid.tentative.html b/tests/wpt/tests/css/css-values/progress-invalid.tentative.html new file mode 100644 index 00000000000..e009eef4ccf --- /dev/null +++ b/tests/wpt/tests/css/css-values/progress-invalid.tentative.html @@ -0,0 +1,44 @@ + + + + + + + diff --git a/tests/wpt/tests/css/css-values/progress-serialize.tentative.html b/tests/wpt/tests/css/css-values/progress-serialize.tentative.html new file mode 100644 index 00000000000..6ea12f2b756 --- /dev/null +++ b/tests/wpt/tests/css/css-values/progress-serialize.tentative.html @@ -0,0 +1,56 @@ + + + + + + +
+ diff --git a/tests/wpt/tests/css/css-values/signs-abs-computed.html b/tests/wpt/tests/css/css-values/signs-abs-computed.html index 9b8ec89e2a9..73b1e0d1c32 100644 --- a/tests/wpt/tests/css/css-values/signs-abs-computed.html +++ b/tests/wpt/tests/css/css-values/signs-abs-computed.html @@ -47,6 +47,8 @@ test_math_used('abs(10px + 10%)', '20px', {type:'length'}); test_math_used('calc(10px + abs(10%))', '20px', {type:'length'}); test_math_used('abs(-10px)', '10px', {type:'length'}); test_math_used('abs(-10%)', '10px', {type:'length'}); +// (20px + 1px) * (sign(20px - 10px - 10px) + 1) +test_math_used('calc((1em + 1px) * (sign(1em - 10px - 10%) + 1))', '21px', {type:'length'}); // Test sign for zero test_zero('calc(sign(-0))', {is_negative: true}); diff --git a/tests/wpt/tests/css/css-values/signs-abs-invalid.html b/tests/wpt/tests/css/css-values/signs-abs-invalid.html index 15b058d0c42..ccb94c21c23 100644 --- a/tests/wpt/tests/css/css-values/signs-abs-invalid.html +++ b/tests/wpt/tests/css/css-values/signs-abs-invalid.html @@ -8,7 +8,16 @@ \ No newline at end of file +test_invalid_number('abs(1%)'); +test_invalid_number('sign(10px + 5rad)'); +test_invalid_number('sign(10%)'); +test_invalid_length('abs(10%)'); +test_invalid_length('1px * sign(10%)'); +test_invalid_length('1px * sign(1em + 10%)'); +test_invalid_length_percentage('1px * sign(10px + 5rad)'); + diff --git a/tests/wpt/tests/css/css-values/sin-cos-tan-serialize.html b/tests/wpt/tests/css/css-values/sin-cos-tan-serialize.html index 59d682421da..52a548113a4 100644 --- a/tests/wpt/tests/css/css-values/sin-cos-tan-serialize.html +++ b/tests/wpt/tests/css/css-values/sin-cos-tan-serialize.html @@ -6,64 +6,70 @@ - +
diff --git a/tests/wpt/tests/css/css-view-transitions/break-inside-avoid-child.html b/tests/wpt/tests/css/css-view-transitions/break-inside-avoid-child.html index 7791f7ab4f6..7b2a83c7769 100644 --- a/tests/wpt/tests/css/css-view-transitions/break-inside-avoid-child.html +++ b/tests/wpt/tests/css/css-view-transitions/break-inside-avoid-child.html @@ -49,6 +49,8 @@ html::view-transition-new(target) { + + + diff --git a/tests/wpt/tests/css/css-view-transitions/parsing/pseudo-elements-valid.html b/tests/wpt/tests/css/css-view-transitions/parsing/pseudo-elements-valid.html new file mode 100644 index 00000000000..1a0e5b82d35 --- /dev/null +++ b/tests/wpt/tests/css/css-view-transitions/parsing/pseudo-elements-valid.html @@ -0,0 +1,32 @@ + + +Test pseudo elements parsing of valid selectors + + + + + + diff --git a/tests/wpt/tests/css/css-view-transitions/parsing/view-transition-name-computed.html b/tests/wpt/tests/css/css-view-transitions/parsing/view-transition-name-computed.html index 4a13ed5d2e9..5b05667f749 100644 --- a/tests/wpt/tests/css/css-view-transitions/parsing/view-transition-name-computed.html +++ b/tests/wpt/tests/css/css-view-transitions/parsing/view-transition-name-computed.html @@ -12,13 +12,16 @@
-
diff --git a/tests/wpt/tests/css/css-view-transitions/parsing/view-transition-name-invalid.html b/tests/wpt/tests/css/css-view-transitions/parsing/view-transition-name-invalid.html new file mode 100644 index 00000000000..0151991436c --- /dev/null +++ b/tests/wpt/tests/css/css-view-transitions/parsing/view-transition-name-invalid.html @@ -0,0 +1,28 @@ + + + + +CSS View Transitions Test: view-transition-name with invalid values + + + + + + + + + + + diff --git a/tests/wpt/tests/css/css-view-transitions/rotated-cat-off-top-edge.html b/tests/wpt/tests/css/css-view-transitions/rotated-cat-off-top-edge.html index 5e909594fa0..c7179b7a011 100644 --- a/tests/wpt/tests/css/css-view-transitions/rotated-cat-off-top-edge.html +++ b/tests/wpt/tests/css/css-view-transitions/rotated-cat-off-top-edge.html @@ -21,6 +21,8 @@ - This should be green
+

 
 
diff --git a/tests/wpt/tests/css/selectors/selectors-4/lang-020.html b/tests/wpt/tests/css/selectors/selectors-4/lang-020.html
new file mode 100644
index 00000000000..9a17af2e419
--- /dev/null
+++ b/tests/wpt/tests/css/selectors/selectors-4/lang-020.html
@@ -0,0 +1,14 @@
+
+
+
+CSS Selectors 4 - :lang matching
+
+
+
+
+
+
+
This should be green
diff --git a/tests/wpt/tests/css/selectors/selectors-4/lang-021.html b/tests/wpt/tests/css/selectors/selectors-4/lang-021.html new file mode 100644 index 00000000000..73209021510 --- /dev/null +++ b/tests/wpt/tests/css/selectors/selectors-4/lang-021.html @@ -0,0 +1,15 @@ + + + +CSS Selectors 4 - :lang matching + + + + + + +
This should be green
diff --git a/tests/wpt/tests/css/selectors/selectors-4/lang-022.html b/tests/wpt/tests/css/selectors/selectors-4/lang-022.html new file mode 100644 index 00000000000..5573fa00d35 --- /dev/null +++ b/tests/wpt/tests/css/selectors/selectors-4/lang-022.html @@ -0,0 +1,14 @@ + + + +CSS Selectors 4 - :lang matching + + + + + + +
This should be green
diff --git a/tests/wpt/tests/css/selectors/selectors-4/lang-023.html b/tests/wpt/tests/css/selectors/selectors-4/lang-023.html new file mode 100644 index 00000000000..58e82e7be73 --- /dev/null +++ b/tests/wpt/tests/css/selectors/selectors-4/lang-023.html @@ -0,0 +1,15 @@ + + + +CSS Selectors 4 - :lang matching + + + + + + +
This should be green
diff --git a/tests/wpt/tests/css/selectors/selectors-4/lang-024.html b/tests/wpt/tests/css/selectors/selectors-4/lang-024.html new file mode 100644 index 00000000000..fb1926855d8 --- /dev/null +++ b/tests/wpt/tests/css/selectors/selectors-4/lang-024.html @@ -0,0 +1,14 @@ + + + +CSS Selectors 4 - :lang matching + + + + + + +
This should be green
diff --git a/tests/wpt/tests/css/selectors/selectors-4/lang-025.html b/tests/wpt/tests/css/selectors/selectors-4/lang-025.html new file mode 100644 index 00000000000..027223299da --- /dev/null +++ b/tests/wpt/tests/css/selectors/selectors-4/lang-025.html @@ -0,0 +1,16 @@ + + + +CSS Selectors 4 - :lang matching + + + + + + + +
This should be green
diff --git a/tests/wpt/tests/css/support/numeric-testcommon.js b/tests/wpt/tests/css/support/numeric-testcommon.js index ea1762e7fd7..b11f5e90447 100644 --- a/tests/wpt/tests/css/support/numeric-testcommon.js +++ b/tests/wpt/tests/css/support/numeric-testcommon.js @@ -25,6 +25,9 @@ test_math_X( msgExtra, // Extra info to put after the auto-genned message. prop, // If you want to override the automatic choice of tested property. extraStyle, // Styles that need to be set at the same time to properly test the value. + approx, // The epsilon in order to compare numeric-ish values. + // Note that it'd use parseFloat in order to extract the + // values, so they can drop units or what not. } ); @@ -42,14 +45,14 @@ to test that a given value is ±∞, ±0, or NaN: -function test_math_used(testString, expectedString, {approx, msg, msgExtra, type, prop, prefix, suffix, extraStyle={}}={}) { +function test_math_used(testString, expectedString, {approx, msg, msgExtra, type, prop, extraStyle={}}={}) { if(type === undefined) type = "length"; if(!prop) { switch(type) { - case "number": prop = "transform"; prefix="scale("; suffix=")"; break; + case "number": prop = "scale"; break; case "integer": prop = "z-index"; extraStyle.position="absolute"; break; case "length": prop = "margin-left"; break; - case "angle": prop = "transform"; prefix="rotate("; suffix=")"; break; + case "angle": prop = "rotate"; break; case "time": prop = "transition-delay"; break; case "resolution": prop = "image-resolution"; break; case "flex": prop = "grid-template-rows"; break; @@ -57,17 +60,17 @@ function test_math_used(testString, expectedString, {approx, msg, msgExtra, type } } - _test_math({stage:'used', testString, expectedString, type, approx, msg, msgExtra, prop, prefix, suffix, extraStyle}); + _test_math({stage:'used', testString, expectedString, type, approx, msg, msgExtra, prop, extraStyle}); } -function test_math_computed(testString, expectedString, {approx, msg, msgExtra, type, prop, prefix, suffix, extraStyle={}}={}) { +function test_math_computed(testString, expectedString, {approx, msg, msgExtra, type, prop, extraStyle={}}={}) { if(type === undefined) type = "length"; if(!prop) { switch(type) { - case "number": prop = "transform"; prefix="scale("; suffix=")"; break; + case "number": prop = "scale"; break; case "integer": prop = "z-index"; extraStyle.position="absolute"; break; case "length": prop = "flex-basis"; break; - case "angle": prop = "transform"; prefix="rotate("; suffix=")"; break; + case "angle": prop = "rotate"; break; case "time": prop = "transition-delay"; break; case "resolution": prop = "image-resolution"; break; case "flex": prop = "grid-template-rows"; break; @@ -75,18 +78,18 @@ function test_math_computed(testString, expectedString, {approx, msg, msgExtra, } } - _test_math({stage:'computed', testString, expectedString, type, approx, msg, msgExtra, prop, prefix, suffix, extraStyle}); + _test_math({stage:'computed', testString, expectedString, type, approx, msg, msgExtra, prop, extraStyle}); } -function test_math_specified(testString, expectedString, {approx, msg, msgExtra, type, prop, prefix, suffix, extraStyle={}}={}) { +function test_math_specified(testString, expectedString, {approx, msg, msgExtra, type, prop, extraStyle={}}={}) { if(type === undefined) type = "length"; const stage = "specified"; if(!prop) { switch(type) { - case "number": prop = "transform"; prefix="scale("; suffix=")"; break; + case "number": prop = "scale"; break; case "integer": prop = "z-index"; extraStyle.position="absolute"; break; case "length": prop = "flex-basis"; break; - case "angle": prop = "transform"; prefix="rotate("; suffix=")"; break; + case "angle": prop = "rotate"; break; case "time": prop = "transition-delay"; break; case "resolution": prop = "image-resolution"; break; case "flex": prop = "grid-template-rows"; break; @@ -108,14 +111,6 @@ function test_math_specified(testString, expectedString, {approx, msg, msgExtra, } let t = testString; let e = expectedString; - if(prefix) { - t = prefix + t; - e = prefix + e; - } - if(suffix) { - t += suffix; - e += suffix; - } test(()=>{ testEl.style[prop] = ''; testEl.style[prop] = t; @@ -125,7 +120,19 @@ function test_math_specified(testString, expectedString, {approx, msg, msgExtra, testEl.style[prop] = e; const expectedValue = testEl.style[prop]; assert_not_equals(expectedValue, '', `${expectedString} isn't valid in '${prop}'; got the default value instead.`) - assert_equals(usedValue, expectedValue, `${testString} and ${expectedString} serialize to the same thing in ${stage} values.`); + if (approx) { + let extractValue = function(value) { + if (value.startsWith("calc(")) { + value = value.slice("calc(".length, -1); + } + return parseFloat(value); + }; + let parsedUsed = extractValue(usedValue); + let parsedExpected = extractValue(expectedValue); + assert_approx_equals(parsedUsed, parsedExpected, approx, `${testString} and ${expectedString} ${approx} serialize to the same thing in ${stage} values.`); + } else { + assert_equals(usedValue, expectedValue, `${testString} and ${expectedString} serialize to the same thing in ${stage} values.`); + } }, msg); } @@ -152,7 +159,7 @@ function test_nan(testString) { } -function _test_math({stage, testEl, testString, expectedString, type, approx, msg, msgExtra, prop, prefix, suffix, extraStyle}={}) { +function _test_math({stage, testEl, testString, expectedString, type, approx, msg, msgExtra, prop, extraStyle}={}) { // Find the test element if(!testEl) testEl = document.getElementById('target'); if(testEl == null) throw "Couldn't find #target element to run tests on."; @@ -167,14 +174,6 @@ function _test_math({stage, testEl, testString, expectedString, type, approx, ms } let t = testString; let e = expectedString; - if(prefix) { - t = prefix + t; - e = prefix + e; - } - if(suffix) { - t += suffix; - e += suffix; - } test(()=>{ testEl.style[prop] = ''; const defaultValue = getComputedStyle(testEl)[prop]; @@ -186,15 +185,12 @@ function _test_math({stage, testEl, testString, expectedString, type, approx, ms const expectedValue = getComputedStyle(testEl)[prop]; assert_not_equals(expectedValue, defaultValue, `${expectedString} isn't valid in '${prop}'; got the default value instead.`) if (approx) { - let extractValues = function(value) { - if (type == "number" || type == "angle") { - return value.split('(')[1].split(')')[0].split(',').map(parseFloat); - } - return [parseFloat(value)]; + let extractValue = function(value) { + return parseFloat(value); }; - let parsedUsed = extractValues(usedValue); - let parsedExpected = extractValues(expectedValue); - assert_array_approx_equals(parsedUsed, parsedExpected, approx, `${testString} and ${expectedString} ${approx} serialize to the same thing in ${stage} values.`); + let parsedUsed = extractValue(usedValue); + let parsedExpected = extractValue(expectedValue); + assert_approx_equals(parsedUsed, parsedExpected, approx, `${testString} and ${expectedString} ${approx} serialize to the same thing in ${stage} values.`); } else { assert_equals(usedValue, expectedValue, `${testString} and ${expectedString} serialize to the same thing in ${stage} values.`); } diff --git a/tests/wpt/tests/dom/observable/tentative/observable-constructor.any.js b/tests/wpt/tests/dom/observable/tentative/observable-constructor.any.js index f2360e2c683..851369e2c98 100644 --- a/tests/wpt/tests/dom/observable/tentative/observable-constructor.any.js +++ b/tests/wpt/tests/dom/observable/tentative/observable-constructor.any.js @@ -176,16 +176,20 @@ test(t => { }, "Subscription is inactive after error()"); test(t => { + let innerSubscriber; let initialActivity; + let initialSignalAborted; const source = new Observable((subscriber) => { + innerSubscriber = subscriber; initialActivity = subscriber.active; + initialSignalAborted = subscriber.signal.aborted; }); - const ac = new AbortController(); - ac.abort(); - source.subscribe({signal: ac.signal}); + source.subscribe({}, {signal: AbortSignal.abort('Initially aborted')}); assert_false(initialActivity); + assert_true(initialSignalAborted); + assert_equals(innerSubscriber.signal.reason, 'Initially aborted'); }, "Subscription is inactive when aborted signal is passed in"); test(() => { @@ -194,7 +198,7 @@ test(() => { const source = new Observable(subscriber => outerSubscriber = subscriber); const controller = new AbortController(); - source.subscribe({signal: controller.signal}); + source.subscribe({}, {signal: controller.signal}); assert_not_equals(controller.signal, outerSubscriber.signal); }, "Subscriber#signal is not the same AbortSignal as the one passed into `subscribe()`"); @@ -541,15 +545,18 @@ test(() => { subscriber.signal.addEventListener('abort', () => { assert_true(subscriber.signal.aborted); - subscriber.next('inner abort handler'); + results.push('inner abort handler'); + subscriber.next('next from inner abort handler'); + subscriber.complete(); }); }); const ac = new AbortController(); source.subscribe({ + // This should never get called. If it is, the array assertion below will fail. next: (x) => results.push(x), - signal: ac.signal, - }); + complete: () => results.push('complete()') + }, {signal: ac.signal}); ac.signal.addEventListener('abort', () => { results.push('outer abort handler'); @@ -559,8 +566,9 @@ test(() => { assert_array_equals(results, ['subscribe() callback']); ac.abort(); + results.push('abort() returned'); assert_array_equals(results, ['subscribe() callback', - 'outer abort handler', 'inner abort handler']); + 'outer abort handler', 'inner abort handler', 'abort() returned']); }, "Unsubscription lifecycle"); // TODO(domfarolino): If we add `subscriber.closed`, assert that its value is @@ -587,9 +595,8 @@ test(t => { } }, error: () => results.push('error'), - complete: () => results.push('complete'), - signal: ac.signal, - }); + complete: () => results.push('complete') + }, {signal: ac.signal}); assert_array_equals( results, @@ -644,4 +651,166 @@ test(() => { assert_equals(errorReported.error, error, "Error object is equivalent"); }, "Calling subscribe should never throw an error synchronously, subscriber pushes error"); -// TODO(domfarolino): Add back the teardown tests that Ben wrote. +test(() => { + let addTeardownCalled = false; + let activeDuringTeardown; + + const source = new Observable((subscriber) => { + subscriber.addTeardown(() => { + addTeardownCalled = true; + activeDuringTeardown = subscriber.active; + }); + }); + + const ac = new AbortController(); + source.subscribe({}, {signal: ac.signal}); + + assert_false(addTeardownCalled, "Teardown is not be called upon subscription"); + ac.abort(); + assert_true(addTeardownCalled, "Teardown is called when subscription is aborted"); + assert_false(activeDuringTeardown, "Teardown observers inactive subscription"); +}, "Teardown should be called when subscription is aborted"); + +test(() => { + const addTeardownsCalled = []; + // This is used to snapshot `addTeardownsCalled` from within the subscribe + // callback, for assertion/comparison later. + let teardownsSnapshot = []; + const results = []; + + const source = new Observable((subscriber) => { + subscriber.addTeardown(() => addTeardownsCalled.push("teardown 1")); + subscriber.addTeardown(() => addTeardownsCalled.push("teardown 2")); + + subscriber.next(1); + subscriber.next(2); + subscriber.next(3); + subscriber.complete(); + + // We don't run the actual `assert_array_equals` here because if it fails, + // it won't be properly caught. This is because assertion failures throw an + // error, and in subscriber callback, thrown errors result in + // `window.onerror` handlers being called, which this test file doesn't + // record as an error (see the first line of this file). + teardownsSnapshot = addTeardownsCalled; + }); + + source.subscribe({ + next: (x) => results.push(x), + error: () => results.push("unreached"), + complete: () => results.push("complete"), + }); + + assert_array_equals( + results, + [1, 2, 3, "complete"], + "should emit values and complete synchronously" + ); + + assert_array_equals(teardownsSnapshot, addTeardownsCalled); + assert_array_equals(addTeardownsCalled, ["teardown 2", "teardown 1"], + "Teardowns called in LIFO order synchronously after complete()"); +}, "Teardowns should be called when subscription is closed by completion"); + +test(() => { + const addTeardownsCalled = []; + let teardownsSnapshot = []; + const error = new Error("error"); + const results = []; + + const source = new Observable((subscriber) => { + subscriber.addTeardown(() => addTeardownsCalled.push("teardown 1")); + subscriber.addTeardown(() => addTeardownsCalled.push("teardown 2")); + + subscriber.next(1); + subscriber.next(2); + subscriber.next(3); + subscriber.error(error); + + teardownsSnapshot = addTeardownsCalled; + }); + + source.subscribe({ + next: (x) => results.push(x), + error: (error) => results.push(error), + complete: () => assert_unreached("complete should not be called"), + }); + + assert_array_equals( + results, + [1, 2, 3, error], + "should emit values and error synchronously" + ); + + assert_array_equals(teardownsSnapshot, addTeardownsCalled); + assert_array_equals(addTeardownsCalled, ["teardown 2", "teardown 1"], + "Teardowns called in LIFO order synchronously after error()"); +}, "Teardowns should be called when subscription is closed by subscriber pushing an error"); + +test(() => { + const addTeardownsCalled = []; + const error = new Error("error"); + const results = []; + + const source = new Observable((subscriber) => { + subscriber.addTeardown(() => addTeardownsCalled.push("teardown 1")); + subscriber.addTeardown(() => addTeardownsCalled.push("teardown 2")); + + subscriber.next(1); + subscriber.next(2); + subscriber.next(3); + throw error; + }); + + source.subscribe({ + next: (x) => results.push(x), + error: (error) => results.push(error), + complete: () => assert_unreached("complete should not be called"), + }); + + assert_array_equals( + results, + [1, 2, 3, error], + "should emit values and error synchronously" + ); + + assert_array_equals(addTeardownsCalled, ["teardown 2", "teardown 1"], + "Teardowns called in LIFO order synchronously after thrown error"); +}, "Teardowns should be called when subscription is closed by subscriber throwing error"); + +test(() => { + const addTeardownsCalled = []; + const results = []; + let firstTeardownInvokedSynchronously = false; + let secondTeardownInvokedSynchronously = false; + + const source = new Observable((subscriber) => { + subscriber.addTeardown(() => addTeardownsCalled.push("teardown 1")); + if (addTeardownsCalled.length === 1) { + firstTeardownInvokedSynchronously = true; + } + subscriber.addTeardown(() => addTeardownsCalled.push("teardown 2")); + if (addTeardownsCalled.length === 2) { + secondTeardownInvokedSynchronously = true; + } + + subscriber.next(1); + subscriber.next(2); + subscriber.next(3); + subscriber.complete(); + }); + + const ac = new AbortController(); + ac.abort(); + source.subscribe({ + next: (x) => results.push(x), + error: (error) => results.push(error), + complete: () => results.push('complete') + }, {signal: ac.signal}); + + assert_array_equals(results, []); + assert_true(firstTeardownInvokedSynchronously, "First teardown callback is invoked during addTeardown()"); + assert_true(secondTeardownInvokedSynchronously, "Second teardown callback is invoked during addTeardown()"); + assert_array_equals(addTeardownsCalled, ["teardown 1", "teardown 2"], + "Teardowns called synchronously upon addition end up in FIFO order"); +}, "Teardowns should be called synchronously during addTeardown() if the subscription is inactive"); diff --git a/tests/wpt/tests/ecmascript/locale-compat.html b/tests/wpt/tests/ecmascript/locale-compat.html index d1d2f78c67f..74806987879 100644 --- a/tests/wpt/tests/ecmascript/locale-compat.html +++ b/tests/wpt/tests/ecmascript/locale-compat.html @@ -43,4 +43,8 @@ test(t => { // https://bugs.chromium.org/p/chromium/issues/detail?id=1418727 }, '`Date.prototype.toLocaleString` produces `yyyy-mm-dd` instead of `m/d/yyyy` for `en-CA` locale'); +test(t => { // https://bugzilla.mozilla.org/show_bug.cgi?id=1864612 + assert_true(new Intl.DateTimeFormat('sv-SE', {}).format(0).endsWith('-01-01')); +}); + diff --git a/tests/wpt/tests/editing/edit-context/edit-context-input.tentative.html b/tests/wpt/tests/editing/edit-context/edit-context-input.tentative.html index a3bfcdb48af..3285453cc2c 100644 --- a/tests/wpt/tests/editing/edit-context/edit-context-input.tentative.html +++ b/tests/wpt/tests/editing/edit-context/edit-context-input.tentative.html @@ -124,6 +124,22 @@ assert_equals(beforeInputTargetRanges.length, 0, "Delete should not have a target range in EditContext"); div.remove(); }, "Backspace and delete in EditContext"); + + promise_test(async function() { + const iframe = document.createElement("iframe"); + document.body.appendChild(iframe); + const editContext = new EditContext(); + iframe.contentDocument.body.editContext = editContext; + iframe.contentDocument.body.focus(); + let got_textupdate_event = false; + editContext.addEventListener("textupdate", e => { + got_textupdate_event = true; + }); + await test_driver.send_keys(iframe.contentDocument.body, "a"); + assert_equals(iframe.contentDocument.body.innerHTML, "", "EditContext should disable DOM modification in iframe."); + assert_true(got_textupdate_event, "Input in iframe EditContext should trigger textupdate event"); + iframe.remove(); + }, 'EditContext constructed outside iframe can be used in iframe'); diff --git a/tests/wpt/tests/event-timing/event-click-visibilitychange.html b/tests/wpt/tests/event-timing/event-click-visibilitychange.html index 988be3623ee..3e1c41ea7ac 100644 --- a/tests/wpt/tests/event-timing/event-click-visibilitychange.html +++ b/tests/wpt/tests/event-timing/event-click-visibilitychange.html @@ -2,7 +2,7 @@ -Event Timing: eventCounts. +Event Timing: visibility change. diff --git a/tests/wpt/tests/event-timing/interactionid-aux-pointerdown-and-pointerdown.html b/tests/wpt/tests/event-timing/interactionid-aux-pointerdown-and-pointerdown.html new file mode 100644 index 00000000000..a46ca672779 --- /dev/null +++ b/tests/wpt/tests/event-timing/interactionid-aux-pointerdown-and-pointerdown.html @@ -0,0 +1,49 @@ + + + +Event Timing: interactionId-aux-pointerdown-and-pointerdown + + + + + + +
Right click me to bring up OS level contextmenu popup.
+ + + + diff --git a/tests/wpt/tests/event-timing/interactionid-aux-pointerdown.html b/tests/wpt/tests/event-timing/interactionid-aux-pointerdown.html new file mode 100644 index 00000000000..3b5b7d5fd05 --- /dev/null +++ b/tests/wpt/tests/event-timing/interactionid-aux-pointerdown.html @@ -0,0 +1,48 @@ + + + +Event Timing: interactionId-aux-pointerdown + + + + + + +
Right click me to bring up OS level contextmenu popup.
+ + + diff --git a/tests/wpt/tests/event-timing/interactionid-auxclick.html b/tests/wpt/tests/event-timing/interactionid-auxclick.html new file mode 100644 index 00000000000..e10d29e9a60 --- /dev/null +++ b/tests/wpt/tests/event-timing/interactionid-auxclick.html @@ -0,0 +1,32 @@ + + + +Event Timing: interactionId-auxclick. + + + + + + +
Right click me to bring up OS level contextmenu popup.
+ + + diff --git a/tests/wpt/tests/event-timing/resources/event-timing-test-utils.js b/tests/wpt/tests/event-timing/resources/event-timing-test-utils.js index ddbaafbefb6..859bc0f7bf5 100644 --- a/tests/wpt/tests/event-timing/resources/event-timing-test-utils.js +++ b/tests/wpt/tests/event-timing/resources/event-timing-test-utils.js @@ -12,7 +12,7 @@ async function clickOnElementAndDelay(id, delay, callback) { }; element.addEventListener("pointerdown", pointerdownHandler); - await test_driver.click(element); + await click(element); } function mainThreadBusy(duration) { @@ -318,43 +318,72 @@ async function testEventType(t, eventType, looseCount=false) { await observerPromise; } -function addListeners(element, events) { - const clickHandler = (e) => { +function addListeners(target, events) { + const eventListener = (e) => { mainThreadBusy(200); }; - events.forEach(e => { element.addEventListener(e, clickHandler); }); + events.forEach(e => { target.addEventListener(e, eventListener); }); } // The testdriver.js, testdriver-vendor.js and testdriver-actions.js need to be // included to use this function. -async function tap(element) { +async function tap(target) { return new test_driver.Actions() .addPointer("touchPointer", "touch") - .pointerMove(0, 0, { origin: element }) + .pointerMove(0, 0, { origin: target }) .pointerDown() .pointerUp() .send(); } -// The testdriver.js, testdriver-vendor.js need to be included to use this -// function. -async function pressKey(element, key) { - await test_driver.send_keys(element, key); +async function click(target) { + return test_driver.click(target); +} + +async function auxClick(target) { + const actions = new test_driver.Actions(); + return actions.addPointer("mousePointer", "mouse") + .pointerMove(0, 0, { origin: target }) + .pointerDown({ button: actions.ButtonType.RIGHT }) + .pointerUp({ button: actions.ButtonType.RIGHT }) + .send(); +} + +async function pointerdown(target) { + const actions = new test_driver.Actions(); + return actions.addPointer("mousePointer", "mouse") + .pointerMove(0, 0, { origin: target }) + .pointerDown() + .send(); +} + +async function auxPointerdown(target) { + const actions = new test_driver.Actions(); + return actions.addPointer("mousePointer", "mouse") + .pointerMove(0, 0, { origin: target }) + .pointerDown({ button: actions.ButtonType.RIGHT }) + .send(); } // The testdriver.js, testdriver-vendor.js need to be included to use this // function. -async function addListenersAndPress(element, key, events) { - addListeners(element, events); - return pressKey(element, key); +async function pressKey(target, key) { + await test_driver.send_keys(target, key); } // The testdriver.js, testdriver-vendor.js need to be included to use this // function. -async function addListenersAndClick(element) { - addListeners(element, +async function addListenersAndPress(target, key, events) { + addListeners(target, events); + return pressKey(target, key); +} + +// The testdriver.js, testdriver-vendor.js need to be included to use this +// function. +async function addListenersAndClick(target) { + addListeners(target, ['mousedown', 'mouseup', 'pointerdown', 'pointerup', 'click']); - return test_driver.click(element); + return click(target); } function filterAndAddToMap(events, map) { @@ -382,18 +411,36 @@ async function createPerformanceObserverPromise(observeTypes, callback, readyToR // The testdriver.js, testdriver-vendor.js need to be included to use this // function. -async function interactAndObserve(interactionType, element, observerPromise) { +async function interactAndObserve(interactionType, target, observerPromise) { let interactionPromise; switch (interactionType) { case 'tap': { - addListeners(element, ['pointerdown', 'pointerup']); - interactionPromise = tap(element); + addListeners(target, ['pointerdown', 'pointerup']); + interactionPromise = tap(target); break; } case 'click': { - addListeners(element, + addListeners(target, ['mousedown', 'mouseup', 'pointerdown', 'pointerup', 'click']); - interactionPromise = test_driver.click(element); + interactionPromise = click(target); + break; + } + case 'auxclick': { + addListeners(target, + ['mousedown', 'mouseup', 'pointerdown', 'pointerup', 'contextmenu', 'auxclick']); + interactionPromise = auxClick(target); + break; + } + case 'aux-pointerdown': { + addListeners(target, + ['mousedown', 'pointerdown', 'contextmenu']); + interactionPromise = auxPointerdown(target); + break; + } + case 'aux-pointerdown-and-pointerdown': { + addListeners(target, + ['mousedown', 'pointerdown', 'contextmenu']); + interactionPromise = Promise.all([auxPointerdown(target), pointerdown(target)]); break; } } @@ -403,7 +450,7 @@ async function interactAndObserve(interactionType, element, observerPromise) { async function interact(interactionType, element, key = '') { switch (interactionType) { case 'click': { - return test_driver.click(element); + return click(element); } case 'tap': { return tap(element); diff --git a/tests/wpt/tests/fenced-frame/automatic-beacon-anchor-click-handler.https.html b/tests/wpt/tests/fenced-frame/automatic-beacon-anchor-click-handler.https.html index 4c2a6485d40..d6e52f90865 100644 --- a/tests/wpt/tests/fenced-frame/automatic-beacon-anchor-click-handler.https.html +++ b/tests/wpt/tests/fenced-frame/automatic-beacon-anchor-click-handler.https.html @@ -8,13 +8,15 @@ + + + diff --git a/tests/wpt/tests/fenced-frame/automatic-beacon-shared-storage.https.html b/tests/wpt/tests/fenced-frame/automatic-beacon-shared-storage.https.html index eb0a4be77c4..e93bde442c4 100644 --- a/tests/wpt/tests/fenced-frame/automatic-beacon-shared-storage.https.html +++ b/tests/wpt/tests/fenced-frame/automatic-beacon-shared-storage.https.html @@ -9,13 +9,15 @@ + diff --git a/tests/wpt/tests/fenced-frame/automatic-beacon-two-events-clear.https.html b/tests/wpt/tests/fenced-frame/automatic-beacon-two-events-clear.https.html index 482dee1dfe1..8ad2f4e2672 100644 --- a/tests/wpt/tests/fenced-frame/automatic-beacon-two-events-clear.https.html +++ b/tests/wpt/tests/fenced-frame/automatic-beacon-two-events-clear.https.html @@ -8,13 +8,15 @@ + + diff --git a/tests/wpt/tests/fenced-frame/automatic-beacon-unfenced-top.https.html b/tests/wpt/tests/fenced-frame/automatic-beacon-unfenced-top.https.html index d62808404b9..6b6c4af1cf8 100644 --- a/tests/wpt/tests/fenced-frame/automatic-beacon-unfenced-top.https.html +++ b/tests/wpt/tests/fenced-frame/automatic-beacon-unfenced-top.https.html @@ -8,6 +8,7 @@ + + - \ No newline at end of file + diff --git a/tests/wpt/tests/fetch/metadata/portal.https.sub.html b/tests/wpt/tests/fetch/metadata/portal.https.sub.html deleted file mode 100644 index 55b555a1b8e..00000000000 --- a/tests/wpt/tests/fetch/metadata/portal.https.sub.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - diff --git a/tests/wpt/tests/font-access/font_access_basic.tentative.https.window.js b/tests/wpt/tests/font-access/font_access_basic.tentative.https.window.js index 669fa31e1a1..4e714dcf5c9 100644 --- a/tests/wpt/tests/font-access/font_access_basic.tentative.https.window.js +++ b/tests/wpt/tests/font-access/font_access_basic.tentative.https.window.js @@ -1,8 +1,9 @@ -//META: script=/resources/testdriver.js -//META: script=/resources/testdriver-vendor.js -//META: script=resources/font-asserts.js -//META: script=resources/font-data.js -//META: script=resources/font-test-utils.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=resources/font-asserts.js +// META: script=resources/font-data.js +// META: script=resources/font-test-utils.js +// META: timeout=long 'use strict'; @@ -23,8 +24,7 @@ font_access_test(async t => { assert_equals(typeof font.postscriptName, 'string'); assert_true( font.postscriptName.split('').every(c => (' ' <= c && c < '\x7f')), - `postscriptName should be printable ASCII: "${font.postscriptName}"` - ); + `postscriptName should be printable ASCII: "${font.postscriptName}"`); assert_equals(typeof font.fullName, 'string', 'fullName attribute type'); assert_equals(typeof font.family, 'string', 'family attribute type'); assert_equals(typeof font.style, 'string', 'style attribute type'); diff --git a/tests/wpt/tests/font-access/font_access_blob.tentative.https.window.js b/tests/wpt/tests/font-access/font_access_blob.tentative.https.window.js index 0dfe0ac9685..16691d0ab55 100644 --- a/tests/wpt/tests/font-access/font_access_blob.tentative.https.window.js +++ b/tests/wpt/tests/font-access/font_access_blob.tentative.https.window.js @@ -1,8 +1,9 @@ -//META: script=/resources/testdriver.js -//META: script=/resources/testdriver-vendor.js -//META: script=resources/font-asserts.js -//META: script=resources/font-data.js -//META: script=resources/font-test-utils.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=resources/font-asserts.js +// META: script=resources/font-data.js +// META: script=resources/font-test-utils.js +// META: timeout=long 'use strict'; @@ -26,7 +27,7 @@ font_access_test(async t => { const parsedData = await parseFontData(data); assert_version_info(parsedData.versionTag); assert_not_equals( - parsedData.tables.size, 0, "Should not have tables of size zero."); + parsedData.tables.size, 0, 'Should not have tables of size zero.'); assert_font_has_tables(font.postscriptName, parsedData.tables, BASE_TABLES); } }, 'FontData.blob(): blob has expected format and parsable table data.'); diff --git a/tests/wpt/tests/font-access/font_access_detached_iframe.tentative.https.window.js b/tests/wpt/tests/font-access/font_access_detached_iframe.tentative.https.window.js index bce925bfc04..ca8171aec03 100644 --- a/tests/wpt/tests/font-access/font_access_detached_iframe.tentative.https.window.js +++ b/tests/wpt/tests/font-access/font_access_detached_iframe.tentative.https.window.js @@ -1,6 +1,7 @@ -//META: script=/resources/testdriver.js -//META: script=/resources/testdriver-vendor.js -//META: script=resources/font-test-utils.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=resources/font-test-utils.js +// META: timeout=long 'use strict'; diff --git a/tests/wpt/tests/font-access/font_access_permission.tentative.https.window.js b/tests/wpt/tests/font-access/font_access_permission.tentative.https.window.js index cb7aabfc6b0..fbd0d1d885b 100644 --- a/tests/wpt/tests/font-access/font_access_permission.tentative.https.window.js +++ b/tests/wpt/tests/font-access/font_access_permission.tentative.https.window.js @@ -1,5 +1,6 @@ -//META: script=/resources/testdriver.js -//META: script=/resources/testdriver-vendor.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: timeout=long 'use strict'; diff --git a/tests/wpt/tests/font-access/font_access_query_select.tentative.https.window.js b/tests/wpt/tests/font-access/font_access_query_select.tentative.https.window.js index 86ddb490605..df89ea7938b 100644 --- a/tests/wpt/tests/font-access/font_access_query_select.tentative.https.window.js +++ b/tests/wpt/tests/font-access/font_access_query_select.tentative.https.window.js @@ -1,8 +1,9 @@ -//META: script=/resources/testdriver.js -//META: script=/resources/testdriver-vendor.js -//META: script=resources/font-asserts.js -//META: script=resources/font-data.js -//META: script=resources/font-test-utils.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=resources/font-asserts.js +// META: script=resources/font-data.js +// META: script=resources/font-test-utils.js +// META: timeout=long font_access_test(async t => { const testData = getTestData(); @@ -10,9 +11,7 @@ font_access_test(async t => { testData.size, 1, 'Need a least one test font data.'); const testFont = testData.values().next().value; - const queryInput = { - postscriptNames: [testFont.postscriptName] - }; + const queryInput = {postscriptNames: [testFont.postscriptName]}; const fonts = await self.queryLocalFonts(queryInput); assert_equals( @@ -21,9 +20,7 @@ font_access_test(async t => { }, 'queryLocalFonts(): valid postscript name in QueryOptions'); font_access_test(async t => { - const queryInput = { - postscriptNames: ['invalid_postscript_name'] - }; + const queryInput = {postscriptNames: ['invalid_postscript_name']}; const fonts = await self.queryLocalFonts(queryInput); assert_equals( @@ -40,27 +37,23 @@ font_access_test(async t => { }, 'queryLocalFonts(): empty object for QueryOptions.postscriptNames'); font_access_test(async t => { - const queryInput = { - invalidFieldName: [] - }; + const queryInput = {invalidFieldName: []}; const fonts = await self.queryLocalFonts(queryInput); assert_greater_than_equal( fonts.length, 1, 'All available fonts should be returned when an invalid field name for ' + - 'QueryOptions is passed.'); + 'QueryOptions is passed.'); }, 'queryLocalFonts(): invalid QueryOptions field'); font_access_test(async t => { - const queryInput = { - postscriptNames: [] - }; + const queryInput = {postscriptNames: []}; const fonts = await self.queryLocalFonts(queryInput); assert_equals( fonts.length, 0, 'Fonts should not be selected when an empty list for ' + - 'QueryOptions.postscriptNames is passed.'); + 'QueryOptions.postscriptNames is passed.'); }, 'queryLocalFonts(): empty QueryOptions.postscriptNames list'); font_access_test(async t => { @@ -69,7 +62,7 @@ font_access_test(async t => { assert_greater_than_equal( fonts.length, 1, 'All available fonts should be returned when undefined is passed for ' + - 'input.'); + 'input.'); }, 'queryLocalFonts(): undefined QueryOptions'); const non_ascii_input = [ @@ -96,6 +89,6 @@ for (const test of non_ascii_input) { assert_equals( fonts.length, 0, 'Fonts should not be selected for non-ASCII character input: ' + - JSON.stringify(fonts)); + JSON.stringify(fonts)); }, `queryLocalFonts(): non-ASCII character input: ${JSON.stringify(test)}`); } \ No newline at end of file diff --git a/tests/wpt/tests/font-access/font_access_sorted.tentative.https.window.js b/tests/wpt/tests/font-access/font_access_sorted.tentative.https.window.js index 49933e17c87..4391c9270cc 100644 --- a/tests/wpt/tests/font-access/font_access_sorted.tentative.https.window.js +++ b/tests/wpt/tests/font-access/font_access_sorted.tentative.https.window.js @@ -1,7 +1,8 @@ -//META: script=/resources/testdriver.js -//META: script=/resources/testdriver-vendor.js -//META: script=resources/font-asserts.js -//META: script=resources/font-test-utils.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=resources/font-asserts.js +// META: script=resources/font-test-utils.js +// META: timeout=long 'use strict'; diff --git a/tests/wpt/tests/font-access/permissions-policy/local-fonts-allowed-by-permissions-policy.https.sub.html b/tests/wpt/tests/font-access/permissions-policy/local-fonts-allowed-by-permissions-policy.https.sub.html index ed3538f657c..4f63b6e0139 100644 --- a/tests/wpt/tests/font-access/permissions-policy/local-fonts-allowed-by-permissions-policy.https.sub.html +++ b/tests/wpt/tests/font-access/permissions-policy/local-fonts-allowed-by-permissions-policy.https.sub.html @@ -1,4 +1,5 @@ + diff --git a/tests/wpt/tests/font-access/permissions-policy/local-fonts-default-permissions-policy.https.sub.html b/tests/wpt/tests/font-access/permissions-policy/local-fonts-default-permissions-policy.https.sub.html index ce166b608e8..c0cfdc070d2 100644 --- a/tests/wpt/tests/font-access/permissions-policy/local-fonts-default-permissions-policy.https.sub.html +++ b/tests/wpt/tests/font-access/permissions-policy/local-fonts-default-permissions-policy.https.sub.html @@ -1,4 +1,5 @@ + diff --git a/tests/wpt/tests/font-access/permissions-policy/local-fonts-disabled-by-permissions-policy.https.sub.html b/tests/wpt/tests/font-access/permissions-policy/local-fonts-disabled-by-permissions-policy.https.sub.html index fed61515c3a..c9912c6dc3b 100644 --- a/tests/wpt/tests/font-access/permissions-policy/local-fonts-disabled-by-permissions-policy.https.sub.html +++ b/tests/wpt/tests/font-access/permissions-policy/local-fonts-disabled-by-permissions-policy.https.sub.html @@ -1,4 +1,5 @@ + diff --git a/tests/wpt/tests/font-access/resources/font-test-utils.js b/tests/wpt/tests/font-access/resources/font-test-utils.js index e183b35bfa0..9d2d915e2df 100644 --- a/tests/wpt/tests/font-access/resources/font-test-utils.js +++ b/tests/wpt/tests/font-access/resources/font-test-utils.js @@ -50,8 +50,8 @@ async function getTableData(fontBlob, numTables) { } async function getTag(blob, offset) { - return (new TextDecoder).decode( - await blob.slice(offset, offset + 4).arrayBuffer()); + return (new TextDecoder) + .decode(await blob.slice(offset, offset + 4).arrayBuffer()); } async function getUint16(blob, offset) { @@ -91,8 +91,7 @@ function isPlatformSupported() { function font_access_test(test_function, name, properties) { return promise_test(async (t) => { if (!isPlatformSupported()) { - await promise_rejects_dom( - t, 'NotSupportedError', self.queryLocalFonts()); + await promise_rejects_dom(t, 'NotSupportedError', self.queryLocalFonts()); return; } await test_driver.set_permission({name: 'local-fonts'}, 'granted'); diff --git a/tests/wpt/tests/html/rendering/the-details-element/details-autofocus-crash.html b/tests/wpt/tests/html/rendering/the-details-element/details-autofocus-crash.html new file mode 100644 index 00000000000..70a220feace --- /dev/null +++ b/tests/wpt/tests/html/rendering/the-details-element/details-autofocus-crash.html @@ -0,0 +1,25 @@ + + + + + + + + + + + + +
+ + + diff --git a/tests/wpt/tests/html/semantics/disabled-elements/disabled-event-dispatch-additional.tentative.html b/tests/wpt/tests/html/semantics/disabled-elements/disabled-event-dispatch-additional.tentative.html new file mode 100644 index 00000000000..8ef4e5ccc7e --- /dev/null +++ b/tests/wpt/tests/html/semantics/disabled-elements/disabled-event-dispatch-additional.tentative.html @@ -0,0 +1,74 @@ + + + + + + + + + + + + + +
+ + + hello world + child + +
+ + diff --git a/tests/wpt/tests/html/semantics/disabled-elements/disabled-event-dispatch.tentative.html b/tests/wpt/tests/html/semantics/disabled-elements/disabled-event-dispatch.tentative.html index 0b2b967bfb4..e2b8846fc3d 100644 --- a/tests/wpt/tests/html/semantics/disabled-elements/disabled-event-dispatch.tentative.html +++ b/tests/wpt/tests/html/semantics/disabled-elements/disabled-event-dispatch.tentative.html @@ -25,7 +25,7 @@ customElements.define('my-control', class extends HTMLElement { static get formAssociated() { return true; } }); -['mousedown', 'mouseup', 'pointerdown', 'pointerup', 'click', 'dblclick'].forEach(eventName => { +['mousedown', 'mouseup', 'pointerdown', 'pointerup', 'click'].forEach(eventName => { [true, false].forEach(clickChildElement => { for (const target of targetparent.children) { promise_test(async () => { @@ -39,18 +39,7 @@ customElements.define('my-control', class extends HTMLElement { let targetchild = target.firstElementChild; targetchild.addEventListener(eventName, () => childReceivedEvent = true); - const elementToClick = clickChildElement ? targetchild : target; - if (eventName === 'dblclick') { - await (new test_driver.Actions() - .pointerMove(1, 1, {origin: elementToClick}) - .pointerDown() - .pointerUp() - .pointerDown() - .pointerUp()) - .send(); - } else { - await test_driver.click(elementToClick); - } + await test_driver.click(clickChildElement ? targetchild : target); const parentShouldReceiveEvents = eventName.startsWith('pointer'); assert_equals(parentReceivedEvent, parentShouldReceiveEvents, diff --git a/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-different-crossorigin.html b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-different-crossorigin.html index f212926d58f..1ea46ffcc54 100644 --- a/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-different-crossorigin.html +++ b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-different-crossorigin.html @@ -15,7 +15,7 @@
- - + + - + + + + + + + + + + + + + + + + + + + + + + +

Long Animation Frame: UI events and renderStart

+
+ + diff --git a/tests/wpt/tests/pointerevents/pointerevent_after_target_appended.html b/tests/wpt/tests/pointerevents/pointerevent_after_target_appended.html index 6ac49a94974..5d73702aca8 100644 --- a/tests/wpt/tests/pointerevents/pointerevent_after_target_appended.html +++ b/tests/wpt/tests/pointerevents/pointerevent_after_target_appended.html @@ -161,7 +161,7 @@ addPromiseTestForNewChild("pointerdown", "pointer", [ "pointerover@parent", "pointerenter@parent", "pointerdown@parent", "(child-attached)", - "pointerover@child", "pointerenter@child", + "pointerout@parent", "pointerover@child", "pointerenter@child", "pointerup@child", "pointerdown@child", "pointerup@child", "pointerout@child", "pointerleave@child", "pointerleave@parent" @@ -169,7 +169,7 @@ addPromiseTestForNewChild("pointerup", "pointer", [ "pointerover@parent", "pointerenter@parent", "pointerdown@parent", "pointerup@parent", "(child-attached)", - "pointerover@child", "pointerenter@child", + "pointerout@parent", "pointerover@child", "pointerenter@child", "pointerdown@child", "pointerup@child", "pointerout@child", "pointerleave@child", "pointerleave@parent" ]); @@ -193,7 +193,7 @@ addPromiseTestForNewChild("mousedown", "mouse", [ "mouseover@parent", "mouseenter@parent", "mousedown@parent", "(child-attached)", - "mouseover@child", "mouseenter@child", + "mouseout@parent", "mouseover@child", "mouseenter@child", "mouseup@child", "mousedown@child", "mouseup@child", "mouseout@child", "mouseleave@child", "mouseleave@parent" @@ -201,7 +201,7 @@ addPromiseTestForNewChild("mouseup", "mouse", [ "mouseover@parent", "mouseenter@parent", "mousedown@parent", "mouseup@parent", "(child-attached)", - "mouseover@child", "mouseenter@child", + "mouseout@parent", "mouseover@child", "mouseenter@child", "mousedown@child", "mouseup@child", "mouseout@child", "mouseleave@child", "mouseleave@parent" ]); diff --git a/tests/wpt/tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html b/tests/wpt/tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html index b77d9e31e2c..d2fa87d333b 100644 --- a/tests/wpt/tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html +++ b/tests/wpt/tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html @@ -13,23 +13,15 @@

Pointer Events - lostpointercapture when capturing element is removed

-

- Test Description: - This test checks if lostpointercapture is fired at the document when the capturing node is removed from the document. - Complete the following actions: -
    -
  1. Press and hold left mouse button over "Set Capture" button. "gotpointercapture" should be logged inside of the black rectangle. -
  2. "lostpointercapture" should be logged inside of the black rectangle after a short delay. -
-

-

- - diff --git a/tests/wpt/tests/portals/csp/frame-ancestors.sub.html b/tests/wpt/tests/portals/csp/frame-ancestors.sub.html deleted file mode 100644 index 096ed00c7a8..00000000000 --- a/tests/wpt/tests/portals/csp/frame-ancestors.sub.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - Blocked portals are reported correctly - - - - - - diff --git a/tests/wpt/tests/portals/csp/frame-src.sub.html b/tests/wpt/tests/portals/csp/frame-src.sub.html deleted file mode 100644 index 13d9e79667f..00000000000 --- a/tests/wpt/tests/portals/csp/frame-src.sub.html +++ /dev/null @@ -1,49 +0,0 @@ - -Tests that portals respect the frame-src - - - - - diff --git a/tests/wpt/tests/portals/csp/resources/frame-src.sub.html b/tests/wpt/tests/portals/csp/resources/frame-src.sub.html deleted file mode 100644 index c4f742a6435..00000000000 --- a/tests/wpt/tests/portals/csp/resources/frame-src.sub.html +++ /dev/null @@ -1,4 +0,0 @@ - - -

Content Security Policy header containing "frame-src {{GET[frame_src_policy]}}"

- diff --git a/tests/wpt/tests/portals/csp/resources/frame-src.sub.html.sub.headers b/tests/wpt/tests/portals/csp/resources/frame-src.sub.html.sub.headers deleted file mode 100644 index d50520cd391..00000000000 --- a/tests/wpt/tests/portals/csp/resources/frame-src.sub.html.sub.headers +++ /dev/null @@ -1,2 +0,0 @@ -Content-Type: text/html; charset=UTF-8 -Content-Security-Policy: frame-src {{GET[frame_src_policy]}} diff --git a/tests/wpt/tests/portals/history/history-manipulation-inside-portal-with-subframes.html b/tests/wpt/tests/portals/history/history-manipulation-inside-portal-with-subframes.html deleted file mode 100644 index cb4c8d0f914..00000000000 --- a/tests/wpt/tests/portals/history/history-manipulation-inside-portal-with-subframes.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - diff --git a/tests/wpt/tests/portals/history/history-manipulation-inside-portal.html b/tests/wpt/tests/portals/history/history-manipulation-inside-portal.html deleted file mode 100644 index d4b0cf4db9e..00000000000 --- a/tests/wpt/tests/portals/history/history-manipulation-inside-portal.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - diff --git a/tests/wpt/tests/portals/history/resources/inner-iframe.html b/tests/wpt/tests/portals/history/resources/inner-iframe.html deleted file mode 100644 index 5c6daa22a55..00000000000 --- a/tests/wpt/tests/portals/history/resources/inner-iframe.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/history/resources/portal-harness.js b/tests/wpt/tests/portals/history/resources/portal-harness.js deleted file mode 100644 index fa8c761afb9..00000000000 --- a/tests/wpt/tests/portals/history/resources/portal-harness.js +++ /dev/null @@ -1,30 +0,0 @@ -// We don't have the test harness in this context, so we roll our own -// which communicates with our host which is actually running the tests. - -window.onload = async () => { - let urlParams = new URLSearchParams(window.location.search); - let testName = urlParams.get('testName'); - let testFn = window[testName]; - if (!testFn) { - window.portalHost.postMessage('Missing test: ' + testName); - return; - } - - // The document load event is not finished at this point, so navigations - // would be done with replacement. This interferes with our tests. We wait - // for the next task before navigating to avoid this. - await new Promise((resolve) => { window.setTimeout(resolve); }); - - try { - await testFn(); - window.portalHost.postMessage('Passed'); - } catch (e) { - window.portalHost.postMessage( - 'Failed: ' + e.name + ': ' + e.message); - } -}; - -function assert(condition, message) { - if (!condition) - throw new Error('Assertion failed: ' + message); -} diff --git a/tests/wpt/tests/portals/history/resources/portal-manipulate-history-with-subframes.sub.html b/tests/wpt/tests/portals/history/resources/portal-manipulate-history-with-subframes.sub.html deleted file mode 100644 index bab83b444fd..00000000000 --- a/tests/wpt/tests/portals/history/resources/portal-manipulate-history-with-subframes.sub.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - diff --git a/tests/wpt/tests/portals/history/resources/portal-manipulate-history.html b/tests/wpt/tests/portals/history/resources/portal-manipulate-history.html deleted file mode 100644 index 3e25f0e6f23..00000000000 --- a/tests/wpt/tests/portals/history/resources/portal-manipulate-history.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - diff --git a/tests/wpt/tests/portals/history/resources/run-test-in-portal.js b/tests/wpt/tests/portals/history/resources/run-test-in-portal.js deleted file mode 100644 index c982a1fac8e..00000000000 --- a/tests/wpt/tests/portals/history/resources/run-test-in-portal.js +++ /dev/null @@ -1,16 +0,0 @@ -// This is called from the portal host which is running with the test harness. -// This creates a portal and communicates with our ad hoc test harness in the -// portal context which performs the history manipulation in the portal. We -// confirm that the history manipulation works as expected in the portal. -async function runTestInPortal(portalSrc, testName) { - let portal = document.createElement('portal'); - portal.src = portalSrc + '?testName=' + testName; - let result = await new Promise((resolve) => { - portal.onmessage = (e) => { - resolve(e.data); - }; - document.body.appendChild(portal); - }); - - assert_equals(result, 'Passed'); -} diff --git a/tests/wpt/tests/portals/htmlportalelement-event-handler-content-attributes.html b/tests/wpt/tests/portals/htmlportalelement-event-handler-content-attributes.html deleted file mode 100644 index 0836c8c00b5..00000000000 --- a/tests/wpt/tests/portals/htmlportalelement-event-handler-content-attributes.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/idlharness.window.js b/tests/wpt/tests/portals/idlharness.window.js deleted file mode 100644 index b43d17dc562..00000000000 --- a/tests/wpt/tests/portals/idlharness.window.js +++ /dev/null @@ -1,18 +0,0 @@ -// META: script=/resources/WebIDLParser.js -// META: script=/resources/idlharness.js - -// https://wicg.github.io/portals/ - -'use strict'; - -idl_test( - ['portals'], - ['html', 'dom'], - async idl_array => { - idl_array.add_objects({ - HTMLPortalElement: ['document.createElement("portal")'], - PortalHost: ['window.portalHost'], - PortalActivateEvent: ['new PortalActivateEvent("portalactivate")'], - }); - } -); diff --git a/tests/wpt/tests/portals/no-portal-in-sandboxed-popup.html b/tests/wpt/tests/portals/no-portal-in-sandboxed-popup.html deleted file mode 100644 index b26b836467a..00000000000 --- a/tests/wpt/tests/portals/no-portal-in-sandboxed-popup.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/portal-activate-data.html b/tests/wpt/tests/portals/portal-activate-data.html deleted file mode 100644 index 54fdca5d8cd..00000000000 --- a/tests/wpt/tests/portals/portal-activate-data.html +++ /dev/null @@ -1,94 +0,0 @@ - -Tests passing of data along with portal activation - - - - - - - diff --git a/tests/wpt/tests/portals/portal-activate-default.html b/tests/wpt/tests/portals/portal-activate-default.html deleted file mode 100644 index b1a8feb1f4d..00000000000 --- a/tests/wpt/tests/portals/portal-activate-default.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/portal-activate-event-constructor.html b/tests/wpt/tests/portals/portal-activate-event-constructor.html deleted file mode 100644 index 1931e8fc865..00000000000 --- a/tests/wpt/tests/portals/portal-activate-event-constructor.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/portal-activate-event.html b/tests/wpt/tests/portals/portal-activate-event.html deleted file mode 100644 index 69d8a7c930e..00000000000 --- a/tests/wpt/tests/portals/portal-activate-event.html +++ /dev/null @@ -1,41 +0,0 @@ - -Tests that the PortalActivateEvent is dispatched when a portal is activated - - - diff --git a/tests/wpt/tests/portals/portal-non-http-navigation.html b/tests/wpt/tests/portals/portal-non-http-navigation.html deleted file mode 100644 index aa02c15efa9..00000000000 --- a/tests/wpt/tests/portals/portal-non-http-navigation.html +++ /dev/null @@ -1,37 +0,0 @@ - -Tests that portal don't navigate to non-http schemes. - - - - - diff --git a/tests/wpt/tests/portals/portal-onload-event.html b/tests/wpt/tests/portals/portal-onload-event.html deleted file mode 100644 index f6b97a814ed..00000000000 --- a/tests/wpt/tests/portals/portal-onload-event.html +++ /dev/null @@ -1,16 +0,0 @@ - -Tests that the load is dispatched when a portal finishes loading. - - - diff --git a/tests/wpt/tests/portals/portals-activate-empty-browsing-context.html b/tests/wpt/tests/portals/portals-activate-empty-browsing-context.html deleted file mode 100644 index 0c63e384977..00000000000 --- a/tests/wpt/tests/portals/portals-activate-empty-browsing-context.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/portals-activate-inside-iframe.html b/tests/wpt/tests/portals/portals-activate-inside-iframe.html deleted file mode 100644 index f4039540961..00000000000 --- a/tests/wpt/tests/portals/portals-activate-inside-iframe.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/portals-activate-inside-portal.html b/tests/wpt/tests/portals/portals-activate-inside-portal.html deleted file mode 100644 index 19b57b3e42e..00000000000 --- a/tests/wpt/tests/portals/portals-activate-inside-portal.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/portals-activate-network-error.html b/tests/wpt/tests/portals/portals-activate-network-error.html deleted file mode 100644 index 60ee5c902da..00000000000 --- a/tests/wpt/tests/portals/portals-activate-network-error.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/portals-activate-no-browsing-context.html b/tests/wpt/tests/portals/portals-activate-no-browsing-context.html deleted file mode 100644 index ccf1e9504be..00000000000 --- a/tests/wpt/tests/portals/portals-activate-no-browsing-context.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/portals-activate-resolution.html b/tests/wpt/tests/portals/portals-activate-resolution.html deleted file mode 100644 index 7094768a4f8..00000000000 --- a/tests/wpt/tests/portals/portals-activate-resolution.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/tests/wpt/tests/portals/portals-activate-twice.html b/tests/wpt/tests/portals/portals-activate-twice.html deleted file mode 100644 index 0eea5465a2b..00000000000 --- a/tests/wpt/tests/portals/portals-activate-twice.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/portals-activate-while-unloading.html b/tests/wpt/tests/portals/portals-activate-while-unloading.html deleted file mode 100644 index 5abb164b3ba..00000000000 --- a/tests/wpt/tests/portals/portals-activate-while-unloading.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/wpt/tests/portals/portals-adopt-predecessor.html b/tests/wpt/tests/portals/portals-adopt-predecessor.html deleted file mode 100644 index 04c61960627..00000000000 --- a/tests/wpt/tests/portals/portals-adopt-predecessor.html +++ /dev/null @@ -1,82 +0,0 @@ - -Tests that a portal can adopt its predecessor - - - diff --git a/tests/wpt/tests/portals/portals-api.html b/tests/wpt/tests/portals/portals-api.html deleted file mode 100644 index 79d2d526bdb..00000000000 --- a/tests/wpt/tests/portals/portals-api.html +++ /dev/null @@ -1,11 +0,0 @@ - -Portals API test - - - - - diff --git a/tests/wpt/tests/portals/portals-close-window.html b/tests/wpt/tests/portals/portals-close-window.html deleted file mode 100644 index e3a66c0bf10..00000000000 --- a/tests/wpt/tests/portals/portals-close-window.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/portals-cross-origin-load.sub.html b/tests/wpt/tests/portals/portals-cross-origin-load.sub.html deleted file mode 100644 index 04db38a8e9a..00000000000 --- a/tests/wpt/tests/portals/portals-cross-origin-load.sub.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/portals-focus.sub.html b/tests/wpt/tests/portals/portals-focus.sub.html deleted file mode 100644 index 54b4312be0a..00000000000 --- a/tests/wpt/tests/portals/portals-focus.sub.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - diff --git a/tests/wpt/tests/portals/portals-host-exposure.sub.html b/tests/wpt/tests/portals/portals-host-exposure.sub.html deleted file mode 100644 index fd3ac18f69d..00000000000 --- a/tests/wpt/tests/portals/portals-host-exposure.sub.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - diff --git a/tests/wpt/tests/portals/portals-host-hidden-after-activation.html b/tests/wpt/tests/portals/portals-host-hidden-after-activation.html deleted file mode 100644 index 9638a6c7c6a..00000000000 --- a/tests/wpt/tests/portals/portals-host-hidden-after-activation.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/portals-host-null.html b/tests/wpt/tests/portals/portals-host-null.html deleted file mode 100644 index e0f1d63743c..00000000000 --- a/tests/wpt/tests/portals/portals-host-null.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/portals-host-post-message.sub.html b/tests/wpt/tests/portals/portals-host-post-message.sub.html deleted file mode 100644 index d589235ec3b..00000000000 --- a/tests/wpt/tests/portals/portals-host-post-message.sub.html +++ /dev/null @@ -1,138 +0,0 @@ - -Test postMessage on PortalHost - - - - - - diff --git a/tests/wpt/tests/portals/portals-navigate-after-adoption.html b/tests/wpt/tests/portals/portals-navigate-after-adoption.html deleted file mode 100644 index 1ca1cfb79f3..00000000000 --- a/tests/wpt/tests/portals/portals-navigate-after-adoption.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - diff --git a/tests/wpt/tests/portals/portals-nested.html b/tests/wpt/tests/portals/portals-nested.html deleted file mode 100644 index b4b396ff8dd..00000000000 --- a/tests/wpt/tests/portals/portals-nested.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/portals-no-frame-crash.html b/tests/wpt/tests/portals/portals-no-frame-crash.html deleted file mode 100644 index cc94a772c34..00000000000 --- a/tests/wpt/tests/portals/portals-no-frame-crash.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/portals-post-message.sub.html b/tests/wpt/tests/portals/portals-post-message.sub.html deleted file mode 100644 index d556dd43d84..00000000000 --- a/tests/wpt/tests/portals/portals-post-message.sub.html +++ /dev/null @@ -1,189 +0,0 @@ - -Test postMessage on HTMLPortalElement - - - - - - - - - - - diff --git a/tests/wpt/tests/portals/portals-referrer-inherit-header.html b/tests/wpt/tests/portals/portals-referrer-inherit-header.html deleted file mode 100644 index 1fbd88893e4..00000000000 --- a/tests/wpt/tests/portals/portals-referrer-inherit-header.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/portals-referrer-inherit-header.html.headers b/tests/wpt/tests/portals/portals-referrer-inherit-header.html.headers deleted file mode 100644 index 7ffbf17d6be..00000000000 --- a/tests/wpt/tests/portals/portals-referrer-inherit-header.html.headers +++ /dev/null @@ -1 +0,0 @@ -Referrer-Policy: no-referrer diff --git a/tests/wpt/tests/portals/portals-referrer-inherit-meta.html b/tests/wpt/tests/portals/portals-referrer-inherit-meta.html deleted file mode 100644 index e77894cfa4d..00000000000 --- a/tests/wpt/tests/portals/portals-referrer-inherit-meta.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/tests/wpt/tests/portals/portals-referrer.html b/tests/wpt/tests/portals/portals-referrer.html deleted file mode 100644 index 4cd3b908958..00000000000 --- a/tests/wpt/tests/portals/portals-referrer.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/portals-rendering.html b/tests/wpt/tests/portals/portals-rendering.html deleted file mode 100644 index 229dacf4e69..00000000000 --- a/tests/wpt/tests/portals/portals-rendering.html +++ /dev/null @@ -1,22 +0,0 @@ - - -Portals rendering test - - - - diff --git a/tests/wpt/tests/portals/portals-repeated-activate.html b/tests/wpt/tests/portals/portals-repeated-activate.html deleted file mode 100644 index f2f36cb7682..00000000000 --- a/tests/wpt/tests/portals/portals-repeated-activate.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/portals-set-src-after-activate.html b/tests/wpt/tests/portals/portals-set-src-after-activate.html deleted file mode 100644 index e485ef4d51c..00000000000 --- a/tests/wpt/tests/portals/portals-set-src-after-activate.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - diff --git a/tests/wpt/tests/portals/predecessor-fires-unload.html b/tests/wpt/tests/portals/predecessor-fires-unload.html deleted file mode 100644 index cb6d98c01d0..00000000000 --- a/tests/wpt/tests/portals/predecessor-fires-unload.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/tests/wpt/tests/portals/references/portals-rendering.html b/tests/wpt/tests/portals/references/portals-rendering.html deleted file mode 100644 index 4a8414ab565..00000000000 --- a/tests/wpt/tests/portals/references/portals-rendering.html +++ /dev/null @@ -1,5 +0,0 @@ - -Portals rendering test - -
- diff --git a/tests/wpt/tests/portals/resources/attempt-portal-load.html b/tests/wpt/tests/portals/resources/attempt-portal-load.html deleted file mode 100644 index 183178006fa..00000000000 --- a/tests/wpt/tests/portals/resources/attempt-portal-load.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/blank-host.html b/tests/wpt/tests/portals/resources/blank-host.html deleted file mode 100644 index d9f3a61eb84..00000000000 --- a/tests/wpt/tests/portals/resources/blank-host.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/eval-portal.html b/tests/wpt/tests/portals/resources/eval-portal.html deleted file mode 100644 index a473501b014..00000000000 --- a/tests/wpt/tests/portals/resources/eval-portal.html +++ /dev/null @@ -1,10 +0,0 @@ - - diff --git a/tests/wpt/tests/portals/resources/focus-page-with-autofocus.html b/tests/wpt/tests/portals/resources/focus-page-with-autofocus.html deleted file mode 100644 index d498ef63355..00000000000 --- a/tests/wpt/tests/portals/resources/focus-page-with-autofocus.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - diff --git a/tests/wpt/tests/portals/resources/focus-page-with-button.html b/tests/wpt/tests/portals/resources/focus-page-with-button.html deleted file mode 100644 index 81ed5465ab1..00000000000 --- a/tests/wpt/tests/portals/resources/focus-page-with-button.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - diff --git a/tests/wpt/tests/portals/resources/focus-page-with-x-origin-iframe.sub.html b/tests/wpt/tests/portals/resources/focus-page-with-x-origin-iframe.sub.html deleted file mode 100644 index df7974e75bb..00000000000 --- a/tests/wpt/tests/portals/resources/focus-page-with-x-origin-iframe.sub.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - diff --git a/tests/wpt/tests/portals/resources/invalid.asis b/tests/wpt/tests/portals/resources/invalid.asis deleted file mode 100644 index 20f7c7f7e51..00000000000 --- a/tests/wpt/tests/portals/resources/invalid.asis +++ /dev/null @@ -1 +0,0 @@ -This is an invalid HTTP response used to produce a network error. diff --git a/tests/wpt/tests/portals/resources/open-blank-host.js b/tests/wpt/tests/portals/resources/open-blank-host.js deleted file mode 100644 index f7580bd1521..00000000000 --- a/tests/wpt/tests/portals/resources/open-blank-host.js +++ /dev/null @@ -1,14 +0,0 @@ -// Portal tests often need to create portals in a context other than the one -// in which the tests are running. This is because the host context may be -// discarded during the course of the test. - -// Opens a blank page for use as a portal host. -// Tests cannot simply use window.open() without a URL as about:blank may not -// host a portal. -async function openBlankPortalHost() { - let hostWindow = window.open('/portals/resources/blank-host.html'); - await new Promise((resolve) => { - hostWindow.addEventListener('load', resolve, {once: true}); - }); - return hostWindow; -} diff --git a/tests/wpt/tests/portals/resources/portal-activate-broadcastchannel.html b/tests/wpt/tests/portals/resources/portal-activate-broadcastchannel.html deleted file mode 100644 index b922afaec26..00000000000 --- a/tests/wpt/tests/portals/resources/portal-activate-broadcastchannel.html +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/tests/wpt/tests/portals/resources/portal-activate-data-portal.html b/tests/wpt/tests/portals/resources/portal-activate-data-portal.html deleted file mode 100644 index 0842ad82efa..00000000000 --- a/tests/wpt/tests/portals/resources/portal-activate-data-portal.html +++ /dev/null @@ -1,9 +0,0 @@ - - diff --git a/tests/wpt/tests/portals/resources/portal-activate-event-portal.html b/tests/wpt/tests/portals/resources/portal-activate-event-portal.html deleted file mode 100644 index 6de5aafca78..00000000000 --- a/tests/wpt/tests/portals/resources/portal-activate-event-portal.html +++ /dev/null @@ -1,21 +0,0 @@ - -Tests that the PortalActivateEvent is dispatched when a portal is activated - diff --git a/tests/wpt/tests/portals/resources/portal-activate-in-handler.html b/tests/wpt/tests/portals/resources/portal-activate-in-handler.html deleted file mode 100644 index 746ffa2b395..00000000000 --- a/tests/wpt/tests/portals/resources/portal-activate-in-handler.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/wpt/tests/portals/resources/portal-activate-inside-portal.html b/tests/wpt/tests/portals/resources/portal-activate-inside-portal.html deleted file mode 100644 index ff8bead3242..00000000000 --- a/tests/wpt/tests/portals/resources/portal-activate-inside-portal.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/portal-activate-twice-window-1.html b/tests/wpt/tests/portals/resources/portal-activate-twice-window-1.html deleted file mode 100644 index fbc5a6e93d9..00000000000 --- a/tests/wpt/tests/portals/resources/portal-activate-twice-window-1.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/portal-activate-twice-window-2.html b/tests/wpt/tests/portals/resources/portal-activate-twice-window-2.html deleted file mode 100644 index 6ba8dc58399..00000000000 --- a/tests/wpt/tests/portals/resources/portal-activate-twice-window-2.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/portal-close-window.html b/tests/wpt/tests/portals/resources/portal-close-window.html deleted file mode 100644 index a12af3cd7a9..00000000000 --- a/tests/wpt/tests/portals/resources/portal-close-window.html +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/tests/wpt/tests/portals/resources/portal-embed-and-activate.html b/tests/wpt/tests/portals/resources/portal-embed-and-activate.html deleted file mode 100644 index 04f15b7fda4..00000000000 --- a/tests/wpt/tests/portals/resources/portal-embed-and-activate.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/portals/resources/portal-host-cross-origin-navigate.sub.html b/tests/wpt/tests/portals/resources/portal-host-cross-origin-navigate.sub.html deleted file mode 100644 index 26f655a0dbf..00000000000 --- a/tests/wpt/tests/portals/resources/portal-host-cross-origin-navigate.sub.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/portal-host-hidden-after-activation-portal.html b/tests/wpt/tests/portals/resources/portal-host-hidden-after-activation-portal.html deleted file mode 100644 index 491d184f972..00000000000 --- a/tests/wpt/tests/portals/resources/portal-host-hidden-after-activation-portal.html +++ /dev/null @@ -1,14 +0,0 @@ - - diff --git a/tests/wpt/tests/portals/resources/portal-host-post-message-after-activate.html b/tests/wpt/tests/portals/resources/portal-host-post-message-after-activate.html deleted file mode 100644 index 7b03ac0294c..00000000000 --- a/tests/wpt/tests/portals/resources/portal-host-post-message-after-activate.html +++ /dev/null @@ -1,19 +0,0 @@ - - diff --git a/tests/wpt/tests/portals/resources/portal-host-post-message-navigate-1.html b/tests/wpt/tests/portals/resources/portal-host-post-message-navigate-1.html deleted file mode 100644 index a59144e7e11..00000000000 --- a/tests/wpt/tests/portals/resources/portal-host-post-message-navigate-1.html +++ /dev/null @@ -1,5 +0,0 @@ - - diff --git a/tests/wpt/tests/portals/resources/portal-host-post-message-navigate-2.html b/tests/wpt/tests/portals/resources/portal-host-post-message-navigate-2.html deleted file mode 100644 index 571c4f122e0..00000000000 --- a/tests/wpt/tests/portals/resources/portal-host-post-message-navigate-2.html +++ /dev/null @@ -1,4 +0,0 @@ - - diff --git a/tests/wpt/tests/portals/resources/portal-host-post-message-x-origin.html b/tests/wpt/tests/portals/resources/portal-host-post-message-x-origin.html deleted file mode 100644 index 6cbc7f4b884..00000000000 --- a/tests/wpt/tests/portals/resources/portal-host-post-message-x-origin.html +++ /dev/null @@ -1,4 +0,0 @@ - - diff --git a/tests/wpt/tests/portals/resources/portal-host-post-message.html b/tests/wpt/tests/portals/resources/portal-host-post-message.html deleted file mode 100644 index 1935ee898e9..00000000000 --- a/tests/wpt/tests/portals/resources/portal-host-post-message.html +++ /dev/null @@ -1,51 +0,0 @@ - - diff --git a/tests/wpt/tests/portals/resources/portal-host.html b/tests/wpt/tests/portals/resources/portal-host.html deleted file mode 100644 index e5772082364..00000000000 --- a/tests/wpt/tests/portals/resources/portal-host.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - diff --git a/tests/wpt/tests/portals/resources/portal-inside-iframe.html b/tests/wpt/tests/portals/resources/portal-inside-iframe.html deleted file mode 100644 index 5db75d5b5fd..00000000000 --- a/tests/wpt/tests/portals/resources/portal-inside-iframe.html +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/portal-post-message-after-activate-window.html b/tests/wpt/tests/portals/resources/portal-post-message-after-activate-window.html deleted file mode 100644 index 73d2c115587..00000000000 --- a/tests/wpt/tests/portals/resources/portal-post-message-after-activate-window.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/portal-post-message-before-activate-portal.html b/tests/wpt/tests/portals/resources/portal-post-message-before-activate-portal.html deleted file mode 100644 index d34875f981f..00000000000 --- a/tests/wpt/tests/portals/resources/portal-post-message-before-activate-portal.html +++ /dev/null @@ -1,24 +0,0 @@ - - diff --git a/tests/wpt/tests/portals/resources/portal-post-message-before-activate-window.html b/tests/wpt/tests/portals/resources/portal-post-message-before-activate-window.html deleted file mode 100644 index 6389829c7cc..00000000000 --- a/tests/wpt/tests/portals/resources/portal-post-message-before-activate-window.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/portal-post-message-during-activate-window.html b/tests/wpt/tests/portals/resources/portal-post-message-during-activate-window.html deleted file mode 100644 index 6e220277d9f..00000000000 --- a/tests/wpt/tests/portals/resources/portal-post-message-during-activate-window.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/portal-post-message-portal.html b/tests/wpt/tests/portals/resources/portal-post-message-portal.html deleted file mode 100644 index e83ae56e08f..00000000000 --- a/tests/wpt/tests/portals/resources/portal-post-message-portal.html +++ /dev/null @@ -1,29 +0,0 @@ - - diff --git a/tests/wpt/tests/portals/resources/portal-post-message-x-origin-portal.html b/tests/wpt/tests/portals/resources/portal-post-message-x-origin-portal.html deleted file mode 100644 index 57631f385c1..00000000000 --- a/tests/wpt/tests/portals/resources/portal-post-message-x-origin-portal.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/tests/wpt/tests/portals/resources/portal-repeated-activate-window.html b/tests/wpt/tests/portals/resources/portal-repeated-activate-window.html deleted file mode 100644 index e716034eff8..00000000000 --- a/tests/wpt/tests/portals/resources/portal-repeated-activate-window.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - diff --git a/tests/wpt/tests/portals/resources/portals-adopt-predecessor-portal.html b/tests/wpt/tests/portals/resources/portals-adopt-predecessor-portal.html deleted file mode 100644 index b838b38be16..00000000000 --- a/tests/wpt/tests/portals/resources/portals-adopt-predecessor-portal.html +++ /dev/null @@ -1,77 +0,0 @@ - - diff --git a/tests/wpt/tests/portals/resources/portals-adopt-predecessor.html b/tests/wpt/tests/portals/resources/portals-adopt-predecessor.html deleted file mode 100644 index 66d47d12ac2..00000000000 --- a/tests/wpt/tests/portals/resources/portals-adopt-predecessor.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/portals-nested-portal.html b/tests/wpt/tests/portals/resources/portals-nested-portal.html deleted file mode 100644 index 278b32eea06..00000000000 --- a/tests/wpt/tests/portals/resources/portals-nested-portal.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/portals-rendering-portal.html b/tests/wpt/tests/portals/resources/portals-rendering-portal.html deleted file mode 100644 index 31b3f4a9909..00000000000 --- a/tests/wpt/tests/portals/resources/portals-rendering-portal.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/postmessage-referrer.sub.html b/tests/wpt/tests/portals/resources/postmessage-referrer.sub.html deleted file mode 100644 index c3837dc79d8..00000000000 --- a/tests/wpt/tests/portals/resources/postmessage-referrer.sub.html +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/tests/wpt/tests/portals/resources/predecessor-fires-unload-watch-unload.html b/tests/wpt/tests/portals/resources/predecessor-fires-unload-watch-unload.html deleted file mode 100644 index f58da48ca1c..00000000000 --- a/tests/wpt/tests/portals/resources/predecessor-fires-unload-watch-unload.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/simple-portal-adopts-and-activates-predecessor.html b/tests/wpt/tests/portals/resources/simple-portal-adopts-and-activates-predecessor.html deleted file mode 100644 index 56bfd10f647..00000000000 --- a/tests/wpt/tests/portals/resources/simple-portal-adopts-and-activates-predecessor.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/simple-portal-adopts-predecessor.html b/tests/wpt/tests/portals/resources/simple-portal-adopts-predecessor.html deleted file mode 100644 index b5ea9f029d8..00000000000 --- a/tests/wpt/tests/portals/resources/simple-portal-adopts-predecessor.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/simple-portal.html b/tests/wpt/tests/portals/resources/simple-portal.html deleted file mode 100644 index 7d7b678cadc..00000000000 --- a/tests/wpt/tests/portals/resources/simple-portal.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/tests/wpt/tests/portals/resources/stash-utils.sub.js b/tests/wpt/tests/portals/resources/stash-utils.sub.js deleted file mode 100644 index 30efe836331..00000000000 --- a/tests/wpt/tests/portals/resources/stash-utils.sub.js +++ /dev/null @@ -1,43 +0,0 @@ -const STASH_RESPONDER = "wss://{{host}}:{{ports[wss][0]}}/stash_responder_blocking"; - -class StashUtils { - /** - * Sends a request to store (|key|, |tuple|) in Stash - * (https://web-platform-tests.org/tools/wptserve/docs/stash.html). - * @param {string} key A UUID that acts as a key that can be used to retrieve |value| later. - * @param {string} value Value to be stored in Stash. - * @returns {Promise} Promise that resolves once the server responds. - */ - static putValue(key, value) { - return new Promise(resolve => { - const ws = new WebSocket(STASH_RESPONDER); - ws.onopen = () => { - ws.send(JSON.stringify({action: 'set', key: key, value: value})); - }; - ws.onmessage = e => { - ws.close(); - resolve(); - }; - }); - } - - /** - * Retrieves value associated with |key| in Stash. If no value has been - * associated with |key| yet, the method waits for putValue to be called with - * |key|, and a value to be associated, before resolving the return promise. - * @param {string} key A UUID that uniquely identifies the value to retrieve. - * @returns {Promise} A promise that resolves with the value associated with |key|. - */ - static takeValue(key) { - return new Promise(resolve => { - const ws = new WebSocket(STASH_RESPONDER); - ws.onopen = () => { - ws.send(JSON.stringify({action: 'get', key: key})); - }; - ws.onmessage = e => { - ws.close(); - resolve(JSON.parse(e.data).value); - }; - }); - } -} diff --git a/tests/wpt/tests/portals/xfo/portals-xfo-deny.sub.html b/tests/wpt/tests/portals/xfo/portals-xfo-deny.sub.html deleted file mode 100644 index efc925276c9..00000000000 --- a/tests/wpt/tests/portals/xfo/portals-xfo-deny.sub.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - diff --git a/tests/wpt/tests/portals/xfo/portals-xfo-sameorigin.html b/tests/wpt/tests/portals/xfo/portals-xfo-sameorigin.html deleted file mode 100644 index 24824767826..00000000000 --- a/tests/wpt/tests/portals/xfo/portals-xfo-sameorigin.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - diff --git a/tests/wpt/tests/portals/xfo/resources/xfo-deny.asis b/tests/wpt/tests/portals/xfo/resources/xfo-deny.asis deleted file mode 100644 index 7779830852a..00000000000 --- a/tests/wpt/tests/portals/xfo/resources/xfo-deny.asis +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 200 OK -Content-Type: text/html -X-Frame-Options: DENY - - - diff --git a/tests/wpt/tests/portals/xfo/resources/xfo-sameorigin.asis b/tests/wpt/tests/portals/xfo/resources/xfo-sameorigin.asis deleted file mode 100644 index 8f3982bd841..00000000000 --- a/tests/wpt/tests/portals/xfo/resources/xfo-sameorigin.asis +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 200 OK -Content-Type: text/html -X-Frame-Options: SAMEORIGIN - - - diff --git a/tests/wpt/tests/resources/chromium/fake-serial.js b/tests/wpt/tests/resources/chromium/fake-serial.js index e1e4d57e3ee..29c8168fb59 100644 --- a/tests/wpt/tests/resources/chromium/fake-serial.js +++ b/tests/wpt/tests/resources/chromium/fake-serial.js @@ -239,8 +239,10 @@ class FakeSerialPort { this.writable_ = undefined; break; case SerialPortFlushMode.kTransmit: - this.reader_.cancel(); - this.reader_ = undefined; + if (this.reader_) { + this.reader_.cancel(); + this.reader_ = undefined; + } this.readable_ = undefined; break; } diff --git a/tests/wpt/tests/sanitizer-api/support/testcases.sub.js b/tests/wpt/tests/sanitizer-api/support/testcases.sub.js index 9081ad2aa21..ad083a8d13b 100644 --- a/tests/wpt/tests/sanitizer-api/support/testcases.sub.js +++ b/tests/wpt/tests/sanitizer-api/support/testcases.sub.js @@ -1,88 +1,502 @@ const testcases = [ - {config_input: {}, value: "test", result: "test", message: "string"}, - {config_input: {}, value: "bla", result: "bla", message: "html fragment"}, - {config_input: {}, value: "test", result: "test", message: "document"}, - {config_input: {}, value: "
test", result: "
test
", message: "html without close tag"}, - {config_input: {}, value: "", + result: "", + message: "scripts for default configs", + }, + { + config_input: {}, + value: "hello", + result: "hello", + message: "script not as root", + }, + { + config_input: {}, + value: "
hello", + result: "
hello
", + message: "script deeper in the tree", + }, + { + config_input: {}, + value: "

Click.

", + result: "

Click.

", + message: "onclick scripts", + }, + { + config_input: {}, + value: "<p>text</p>", + result: "&lt;p&gt;text&lt;/p&gt;", + message: "plaintext", + }, + { + config_input: {}, + value: "<xmp>TEXT</xmp>", + result: "TEXT", + message: "xmp", + }, + { + config_input: { test: 123 }, + value: "test", + result: "test", + message: "invalid config_input", + }, + { + config_input: { dropElements: [] }, + value: "test", + result: "test", + message: "empty dropElements list", + }, + { + config_input: { dropElements: ["div"] }, + value: "<div>test</div><p>bla", + result: "<p>bla</p>", + message: "test html without close tag with dropElements list ['div']", + }, + { + config_input: {}, + value: "<custom-element>test</custom-element>bla", + result: "bla", + message: "default behavior for custom elements", + }, + { + config_input: { allowCustomElements: true }, + value: "<custom-element>test</custom-element>bla", + result: "testbla", + message: "allow custom elements", + }, + { + config_input: { + allowCustomElements: true, + allowElements: ["custom-element"], + }, + value: "<custom-element>test</custom-element>bla", + result: "<custom-element>test</custom-element>bla", + message: "allow custom elements with allow elements", + }, + { + config_input: { allowCustomElements: false }, + value: "<custom-element>test</custom-element>bla", + result: "bla", + message: "disallow custom elements", + }, + { + config_input: { + dropElements: ["custom-element"], + allowCustomElements: true, + }, + value: "<custom-element>test</custom-element>bla", + result: "bla", + message: 'allow custom elements with drop list contains ["custom-element"]', + }, + { + config_input: { dropElements: ["script"] }, + value: "<script>alert('i am a test')</script>", + result: "", + message: 'test script with ["script"] as dropElements list', + }, + { + config_input: { dropElements: ["test-element", "i"] }, + value: "<div>balabala<i>test</i></div><test-element>t</test-element>", + result: "<div>balabala</div>", + message: 'dropElements list ["test-element", "i"]}', + }, + { + config_input: { dropElements: ["dl", "p"] }, + value: "<div>balabala<i>i</i><p>t</p></div>", + result: "<div>balabala<i>i</i></div>", + message: 'dropElements list ["dl", "p"]}', + }, + { + config_input: { allowElements: ["p"] }, + value: "<div>test<div>p</div>tt<p>div</p></div>", + result: "testptt<p>div</p>", + message: 'allowElements list ["p"]', + }, + { + config_input: { dropElements: ["div"], allowElements: ["div"] }, + value: "<div>test</div><p>bla", + result: "bla", + message: "allowElements list has no influence to dropElements", + }, + { + config_input: { dropAttributes: [{ name: "style", elements: ["p"] }] }, + value: + "<p style='color: black'>Click.</p><div style='color: white'>div</div>", + result: '<p>Click.</p><div style="color: white">div</div>', + message: 'dropAttributes list {"style": ["p"]} with style attribute', + }, // {config_input: {dropAttributes: [{name: "*": ["a"]}}, value: "<a id='a' style='color: black'>Click.</a><div style='color: white'>div</div>", result: "<a>Click.</a><div style=\"color: white\">div</div>", message: "dropAttributes list {\"*\": [\"a\"]} with style attribute"}, - {config_input: {dropAttributes: []}, value: "<p id='test'>Click.</p>", result: "<p id=\"test\">Click.</p>", message: "empty dropAttributes list with id attribute"}, - {config_input: {dropAttributes: [{name: "id", elements: "*"}]}, value: "<p id='test'>Click.</p>", result: "<p>Click.</p>", message: "dropAttributes list {\"id\": [\"*\"]} with id attribute"}, - {config_input: {dropAttributes: [{name: "data-attribute-with-dashes", elements: "*"}]}, value: "<p id='p' data-attribute-with-dashes='123'>Click.</p><script>document.getElementById('p').dataset.attributeWithDashes=123;</script>", result: "<p id=\"p\">Click.</p>", message: "dropAttributes list {\"data-attribute-with-dashes\": [\"*\"]} with dom dataset js access"}, - {config_input: {allowAttributes: [{name: "id", elements: ["div"]}]}, value: "<p id='p'>P</p><div id='div'>DIV</div>", result: "<p>P</p><div id=\"div\">DIV</div>", message: "allowAttributes list {\"id\": [\"div\"]} with id attribute"}, - {config_input: {allowAttributes: [{name: "id", elements: "*"}]}, value: "<p id='test' onclick='a= 123'>Click.</p>", result: "<p id=\"test\">Click.</p>", message: "allowAttributes list {\"id\": [\"*\"]} with id attribute and onclick scripts"}, + { + config_input: { dropAttributes: [] }, + value: "<p id='test'>Click.</p>", + result: '<p id="test">Click.</p>', + message: "empty dropAttributes list with id attribute", + }, + { + config_input: { dropAttributes: [{ name: "id", elements: "*" }] }, + value: "<p id='test'>Click.</p>", + result: "<p>Click.</p>", + message: 'dropAttributes list {"id": ["*"]} with id attribute', + }, + { + config_input: { + dropAttributes: [{ name: "data-attribute-with-dashes", elements: "*" }], + }, + value: + "<p id='p' data-attribute-with-dashes='123'>Click.</p><script>document.getElementById('p').dataset.attributeWithDashes=123;</script>", + result: '<p id="p">Click.</p>', + message: + 'dropAttributes list {"data-attribute-with-dashes": ["*"]} with dom dataset js access', + }, + { + config_input: { allowAttributes: [{ name: "id", elements: ["div"] }] }, + value: "<p id='p'>P</p><div id='div'>DIV</div>", + result: '<p>P</p><div id="div">DIV</div>', + message: 'allowAttributes list {"id": ["div"]} with id attribute', + }, + { + config_input: { allowAttributes: [{ name: "id", elements: "*" }] }, + value: "<p id='test' onclick='a= 123'>Click.</p>", + result: '<p id="test">Click.</p>', + message: + 'allowAttributes list {"id": ["*"]} with id attribute and onclick scripts', + }, // {config_input: {allowAttributes: {"*": ["a"]}}, value: "<a id='a' style='color: black'>Click.</a><div style='color: white'>div</div>", result: "<a id=\"a\" style=\"color: black\">Click.</a><div>div</div>", message: "allowAttributes list {\"*\": [\"a\"]} with style attribute"}, - {config_input: {dropAttributes: [{name: "style", elements: "*"}], allowAttributes: [{name: "style", elements: "*"}]}, value: "<p style='color: black'>Click.</p>", result: "<p>Click.</p>", message: "allowAttributes list has no influence to dropAttributes"}, - {config_input: {allowElements: ["template", "div"]}, value: "<template><script>test</script><div>hello</div></template>", result: "<template><div>hello</div></template>", message: "Template element"}, - {config_input: {}, value: "<a href='javascript:evil.com'>Click.</a>", result: "<a>Click.</a>", message: "HTMLAnchorElement with javascript protocal"}, - {config_input: {}, value: "<a href=' javascript:evil.com'>Click.</a>", result: "<a>Click.</a>", message: "HTMLAnchorElement with javascript protocal start with space"}, - {config_input: {}, value: "<a href='http:evil.com'>Click.</a>", result: "<a href=\"http:evil.com\">Click.</a>", message: "HTMLAnchorElement"}, - {config_input: {}, value: "<area href='javascript:evil.com'>Click.</area>", result: "<area>Click.", message: "HTMLAreaElement with javascript protocal"}, - {config_input: {}, value: "<area href=' javascript:evil.com'>Click.</area>", result: "<area>Click.", message: "HTMLAreaElement with javascript protocal start with space"}, - {config_input: {}, value: "<area href='http:evil.com'>Click.</area>", result: "<area href=\"http:evil.com\">Click.", message: "HTMLAreaElement"}, - {config_input: {}, value: "<form action='javascript:evil.com'>Click.</form>", result: "<form>Click.</form>", message: "HTMLFormElement with javascript action"}, - {config_input: {}, value: "<form action=' javascript:evil.com'>Click.</form>", result: "<form>Click.</form>", message: "HTMLFormElement with javascript action start with space"}, - {config_input: {}, value: "<form action='http:evil.com'>Click.</form>", result: "<form action=\"http:evil.com\">Click.</form>", message: "HTMLFormElement"}, - {config_input: {}, value: "<input formaction='javascript:evil.com'>Click.</input>", result: "<input>Click.", message: "HTMLInputElement with javascript formaction"}, - {config_input: {}, value: "<input formaction=' javascript:evil.com'>Click.</input>", result: "<input>Click.", message: "HTMLInputElement with javascript formaction start with space"}, - {config_input: {}, value: "<input formaction='http:evil.com'>Click.</input>", result: "<input formaction=\"http:evil.com\">Click.", message: "HTMLInputElement"}, - {config_input: {}, value: "<button formaction='javascript:evil.com'>Click.</button>", result: "<button>Click.</button>", message: "HTMLButtonElement with javascript formaction"}, - {config_input: {}, value: "<button formaction=' javascript:evil.com'>Click.</button>", result: "<button>Click.</button>", message: "HTMLButtonElement with javascript formaction start with space"}, - {config_input: {}, value: "<button formaction='http:evil.com'>Click.</button>", result: "<button formaction=\"http:evil.com\">Click.</button>", message: "HTMLButtonElement"}, - {config_input: {}, value: "<p>Some text</p></body><!-- 1 --></html><!-- 2 --><p>Some more text</p>", result: "<p>Some text</p><p>Some more text</p>", message: "malformed HTML"}, - {config_input: {}, value: "<p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>", result: "<p>Some text</p><p>Some more text</p>", message: "HTML with comments; comments not allowed"}, - {config_input: {allowComments: true}, value: "<p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>", result: "<p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>", message: "HTML with comments; allowComments"}, - {config_input: {allowComments: false}, value: "<p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>", result: "<p>Some text</p><p>Some more text</p>", message: "HTML with comments; !allowComments"}, - {config_input: {}, value: "<p>comment<!-- hello -->in<!-- </p> -->text</p>", result: "<p>commentintext</p>", message: "HTML with comments deeper in the tree"}, - {config_input: {allowComments: true}, value: "<p>comment<!-- hello -->in<!-- </p> -->text</p>", result: "<p>comment<!-- hello -->in<!-- </p> -->text</p>", message: "HTML with comments deeper in the tree, allowComments"}, - {config_input: {allowComments: false}, value: "<p>comment<!-- hello -->in<!-- </p> -->text</p>", result: "<p>commentintext</p>", message: "HTML with comments deeper in the tree, !allowComments"}, - {config_input: {allowElements: ["svg"]}, value: "<svg></svg>", result: "", message: "Unknown HTML names (HTMLUnknownElement instances) should not match elements parsed as non-HTML namespaces."}, - {config_input: {allowElements: ["div", "svg"]}, value: "<div><svg></svg></div>", result: "<div></div>", message: "Unknown HTML names (HTMLUnknownElement instances) should not match elements parsed as non-HTML namespaces when nested."}, + { + config_input: { + dropAttributes: [{ name: "style", elements: "*" }], + allowAttributes: [{ name: "style", elements: "*" }], + }, + value: "<p style='color: black'>Click.</p>", + result: "<p>Click.</p>", + message: "allowAttributes list has no influence to dropAttributes", + }, + { + config_input: { allowElements: ["template", "div"] }, + value: "<template><script>test</script><div>hello</div></template>", + result: "<template><div>hello</div></template>", + message: "Template element", + }, + { + config_input: {}, + value: "<a href='javascript:evil.com'>Click.</a>", + result: "<a>Click.</a>", + message: "HTMLAnchorElement with javascript protocal", + }, + { + config_input: {}, + value: "<a href=' javascript:evil.com'>Click.</a>", + result: "<a>Click.</a>", + message: "HTMLAnchorElement with javascript protocal start with space", + }, + { + config_input: {}, + value: "<a href='http:evil.com'>Click.</a>", + result: '<a href="http:evil.com">Click.</a>', + message: "HTMLAnchorElement", + }, + { + config_input: {}, + value: "<area href='javascript:evil.com'>Click.</area>", + result: "<area>Click.", + message: "HTMLAreaElement with javascript protocal", + }, + { + config_input: {}, + value: "<area href=' javascript:evil.com'>Click.</area>", + result: "<area>Click.", + message: "HTMLAreaElement with javascript protocal start with space", + }, + { + config_input: {}, + value: "<area href='http:evil.com'>Click.</area>", + result: '<area href="http:evil.com">Click.', + message: "HTMLAreaElement", + }, + { + config_input: {}, + value: "<form action='javascript:evil.com'>Click.</form>", + result: "<form>Click.</form>", + message: "HTMLFormElement with javascript action", + }, + { + config_input: {}, + value: "<form action=' javascript:evil.com'>Click.</form>", + result: "<form>Click.</form>", + message: "HTMLFormElement with javascript action start with space", + }, + { + config_input: {}, + value: "<form action='http:evil.com'>Click.</form>", + result: '<form action="http:evil.com">Click.</form>', + message: "HTMLFormElement", + }, + { + config_input: {}, + value: "<input formaction='javascript:evil.com'>Click.</input>", + result: "<input>Click.", + message: "HTMLInputElement with javascript formaction", + }, + { + config_input: {}, + value: "<input formaction=' javascript:evil.com'>Click.</input>", + result: "<input>Click.", + message: "HTMLInputElement with javascript formaction start with space", + }, + { + config_input: {}, + value: "<input formaction='http:evil.com'>Click.</input>", + result: '<input formaction="http:evil.com">Click.', + message: "HTMLInputElement", + }, + { + config_input: {}, + value: "<button formaction='javascript:evil.com'>Click.</button>", + result: "<button>Click.</button>", + message: "HTMLButtonElement with javascript formaction", + }, + { + config_input: {}, + value: "<button formaction=' javascript:evil.com'>Click.</button>", + result: "<button>Click.</button>", + message: "HTMLButtonElement with javascript formaction start with space", + }, + { + config_input: {}, + value: "<button formaction='http:evil.com'>Click.</button>", + result: '<button formaction="http:evil.com">Click.</button>', + message: "HTMLButtonElement", + }, + { + config_input: {}, + value: + "<p>Some text</p></body><!-- 1 --></html><!-- 2 --><p>Some more text</p>", + result: "<p>Some text</p><p>Some more text</p>", + message: "malformed HTML", + }, + { + config_input: {}, + value: "<p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>", + result: "<p>Some text</p><p>Some more text</p>", + message: "HTML with comments; comments not allowed", + }, + { + config_input: { allowComments: true }, + value: "<p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>", + result: "<p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>", + message: "HTML with comments; allowComments", + }, + { + config_input: { allowComments: false }, + value: "<p>Some text</p><!-- 1 --><!-- 2 --><p>Some more text</p>", + result: "<p>Some text</p><p>Some more text</p>", + message: "HTML with comments; !allowComments", + }, + { + config_input: {}, + value: "<p>comment<!-- hello -->in<!-- </p> -->text</p>", + result: "<p>commentintext</p>", + message: "HTML with comments deeper in the tree", + }, + { + config_input: { allowComments: true }, + value: "<p>comment<!-- hello -->in<!-- </p> -->text</p>", + result: "<p>comment<!-- hello -->in<!-- </p> -->text</p>", + message: "HTML with comments deeper in the tree, allowComments", + }, + { + config_input: { allowComments: false }, + value: "<p>comment<!-- hello -->in<!-- </p> -->text</p>", + result: "<p>commentintext</p>", + message: "HTML with comments deeper in the tree, !allowComments", + }, + { + config_input: { allowElements: ["svg"] }, + value: "<svg></svg>", + result: "", + message: + "Unknown HTML names (HTMLUnknownElement instances) should not match elements parsed as non-HTML namespaces.", + }, + { + config_input: { allowElements: ["div", "svg"] }, + value: "<div><svg></svg></div>", + result: "<div></div>", + message: + "Unknown HTML names (HTMLUnknownElement instances) should not match elements parsed as non-HTML namespaces when nested.", + }, // Case normalization (actually: lack of) - {config_input: {dropElements: ["I", "DL"]}, value: "<div>balabala<dl>test</dl></div>", result: "<div>balabala<dl>test</dl></div>", message: "dropElements list [\"I\", \"DL\"]}"}, - {config_input: {dropElements: ["i", "dl"]}, value: "<div>balabala<dl>test</dl></div>", result: "<div>balabala</div>", message: "dropElements list [\"i\", \"dl\"]}"}, - {config_input: {dropElements: ["i", "dl"]}, value: "<DIV>balabala<DL>test</DL></DIV>", result: "<div>balabala</div>", message: "dropElements list [\"i\", \"dl\"]} with uppercase HTML"}, - {config_input: {dropAttributes: [{name: "ID", elements: "*"}]}, value: "<p id=\"test\">Click.</p>", result: "<p id=\"test\">Click.</p>", message: "dropAttributes list {\"ID\": [\"*\"]} with id attribute"}, - {config_input: {dropAttributes: [{name: "ID", elements: "*"}]}, value: "<p ID=\"test\">Click.</p>", result: "<p id=\"test\">Click.</p>", message: "dropAttributes list {\"ID\": [\"*\"]} with ID attribute"}, - {config_input: {dropAttributes: [{name: "id", elements: "*"}]}, value: "<p ID=\"test\">Click.</p>", result: "<p>Click.</p>", message: "dropAttributes list {\"id\": [\"*\"]} with ID attribute"}, + { + config_input: { dropElements: ["I", "DL"] }, + value: "<div>balabala<dl>test</dl></div>", + result: "<div>balabala<dl>test</dl></div>", + message: 'dropElements list ["I", "DL"]}', + }, + { + config_input: { dropElements: ["i", "dl"] }, + value: "<div>balabala<dl>test</dl></div>", + result: "<div>balabala</div>", + message: 'dropElements list ["i", "dl"]}', + }, + { + config_input: { dropElements: ["i", "dl"] }, + value: "<DIV>balabala<DL>test</DL></DIV>", + result: "<div>balabala</div>", + message: 'dropElements list ["i", "dl"]} with uppercase HTML', + }, + { + config_input: { dropAttributes: [{ name: "ID", elements: "*" }] }, + value: '<p id="test">Click.</p>', + result: '<p id="test">Click.</p>', + message: 'dropAttributes list {"ID": ["*"]} with id attribute', + }, + { + config_input: { dropAttributes: [{ name: "ID", elements: "*" }] }, + value: '<p ID="test">Click.</p>', + result: '<p id="test">Click.</p>', + message: 'dropAttributes list {"ID": ["*"]} with ID attribute', + }, + { + config_input: { dropAttributes: [{ name: "id", elements: "*" }] }, + value: '<p ID="test">Click.</p>', + result: "<p>Click.</p>", + message: 'dropAttributes list {"id": ["*"]} with ID attribute', + }, // allowUnknownMarkup for elements (with and without) - {config_input: {dropElements: [123, "test", "i", "custom-element"]}, value: "<div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>", result: "<div>balabala</div>", message: "dropElements with unknown elements and without allowUnknownMarkup"}, - {config_input: {blockElements: [123, "test", "i", "custom-element"]}, value: "<div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>", result: "<div>balabalatest</div>", message: "blockElements with unknown elements and without allowUnknownMarkup"}, - {config_input: {allowElements: ["p", "test"]}, value: "<div>test<div>p</div>tt<p>div</p></div><test>test</test>", result: "testptt<p>div</p>", message: "allowElements with unknown elements and without allowUnknownMarkup"}, - {config_input: {dropElements: [123, "test", "i", "custom-element"], allowUnknownMarkup: true}, value: "<div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>", result: "<div>balabala</div>", message: "dropElements with unknown elements and with allowUnknownMarkup"}, - {config_input: {blockElements: [123, "test", "i", "custom-element"], allowUnknownMarkup: true}, value: "<div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>", result: "<div>balabalatest</div>t", message: "blockElements with unknown elements and with allowUnknownMarkup"}, - {config_input: {allowElements: ["p", "test"], allowUnknownMarkup: true}, value: "<div>test<div>p</div>tt<p>div</p><test>test</test></div>", result: "testptt<p>div</p><test>test</test>", message: "allowElements with unknown elements and with allowUnknownMarkup"}, + { + config_input: { dropElements: [123, "test", "i", "custom-element"] }, + value: + "<div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>", + result: "<div>balabala</div>", + message: + "dropElements with unknown elements and without allowUnknownMarkup", + }, + { + config_input: { blockElements: [123, "test", "i", "custom-element"] }, + value: + "<div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>", + result: "<div>balabalatest</div>", + message: + "blockElements with unknown elements and without allowUnknownMarkup", + }, + { + config_input: { allowElements: ["p", "test"] }, + value: "<div>test<div>p</div>tt<p>div</p></div><test>test</test>", + result: "testptt<p>div</p>", + message: + "allowElements with unknown elements and without allowUnknownMarkup", + }, + { + config_input: { + dropElements: [123, "test", "i", "custom-element"], + allowUnknownMarkup: true, + }, + value: + "<div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>", + result: "<div>balabala</div>", + message: "dropElements with unknown elements and with allowUnknownMarkup", + }, + { + config_input: { + blockElements: [123, "test", "i", "custom-element"], + allowUnknownMarkup: true, + }, + value: + "<div>balabala<i>test</i></div><test>t</test><custom-element>custom-element</custom-element>", + result: "<div>balabalatest</div>t", + message: "blockElements with unknown elements and with allowUnknownMarkup", + }, + { + config_input: { allowElements: ["p", "test"], allowUnknownMarkup: true }, + value: "<div>test<div>p</div>tt<p>div</p><test>test</test></div>", + result: "testptt<p>div</p><test>test</test>", + message: "allowElements with unknown elements and with allowUnknownMarkup", + }, // allowUnknownMarkup for attributes (with and without) - {config_input: {allowAttributes: [{name: "hello", elements: "*"}, {name: "world", elements: ["b"]}]}, value: "<div hello='1' world='2'><b hello='3' world='4'>", result: "<div><b></b></div>", message: "allowAttributes unknown attributes and without allowUnknownMarkup"}, - {config_input: {allowAttributes: [{name: "hello", elements: "*"}, {name: "world", elements: ["b"]}], allowUnknownMarkup: true}, value: "<div hello='1' world='2'><b hello='3' world='4'>", result: "<div hello=\"1\"><b hello=\"3\" world=\"4\"></b></div>", message: "allowAttributes unknown attributes and with allowUnknownMarkup"}, - {config_input: {dropAttributes: [{name: "hello", elements: "*"}, {name:"world", elements: ["b"]}]}, value: "<div hello='1' world='2'><b hello='3' world='4'>", result: "<div><b></b></div>", message: "dropAttributes unknown attributes and without allowUnknownMarkup"}, - {config_input: {dropAttributes: [{name: "hello", elements: "*"}, {name:"world", elements: ["b"]}], allowUnknownMarkup: true}, value: "<div hello='1' world='2'><b hello='3' world='4'>", result: "<div><b></b></div>", message: "dropAttributes unknown attributes and with allowUnknownMarkup"}, + { + config_input: { + allowAttributes: [ + { name: "hello", elements: "*" }, + { name: "world", elements: ["b"] }, + ], + }, + value: "<div hello='1' world='2'><b hello='3' world='4'>", + result: "<div><b></b></div>", + message: + "allowAttributes unknown attributes and without allowUnknownMarkup", + }, + { + config_input: { + allowAttributes: [ + { name: "hello", elements: "*" }, + { name: "world", elements: ["b"] }, + ], + allowUnknownMarkup: true, + }, + value: "<div hello='1' world='2'><b hello='3' world='4'>", + result: '<div hello="1"><b hello="3" world="4"></b></div>', + message: "allowAttributes unknown attributes and with allowUnknownMarkup", + }, + { + config_input: { + dropAttributes: [ + { name: "hello", elements: "*" }, + { name: "world", elements: ["b"] }, + ], + }, + value: "<div hello='1' world='2'><b hello='3' world='4'>", + result: "<div><b></b></div>", + message: "dropAttributes unknown attributes and without allowUnknownMarkup", + }, + { + config_input: { + dropAttributes: [ + { name: "hello", elements: "*" }, + { name: "world", elements: ["b"] }, + ], + allowUnknownMarkup: true, + }, + value: "<div hello='1' world='2'><b hello='3' world='4'>", + result: "<div><b></b></div>", + message: "dropAttributes unknown attributes and with allowUnknownMarkup", + }, ]; diff --git a/tests/wpt/tests/serial/serialPort-disconnect-during-abort.https.any.js b/tests/wpt/tests/serial/serialPort-disconnect-during-abort.https.any.js new file mode 100644 index 00000000000..6df1513c5cb --- /dev/null +++ b/tests/wpt/tests/serial/serialPort-disconnect-during-abort.https.any.js @@ -0,0 +1,29 @@ +// META: script=/resources/test-only-api.js +// META: script=/serial/resources/common.js +// META: script=resources/automation.js + +serial_test(async (t, fake) => { + const {port, fakePort} = await getFakeSerialPort(fake); + await port.open({baudRate: 9600}); + + assert_true(port.writable instanceof WritableStream); + const writer = port.writable.getWriter(); + + await fakePort.readable(); + + // Simulate disconnection error. + fakePort.simulateDisconnectOnWrite(); + + // Much larger than default bufferSize so that the write doesn't complete + // synchronously. + const data = new Uint8Array(1024); + const writePromise = writer.write(data); + + // writer.abort is rejected with NetworkError due to simulated disconnection. + await promise_rejects_dom(t, 'NetworkError', writer.abort('Aborting')); + + // writePromise is rejected with "Aborting" due to writer.abort. + await promise_rejects_exactly(t, 'Aborting', writePromise); + + await port.close(); +}, 'Disconnect error during abort works correctly'); diff --git a/tests/wpt/tests/speculation-rules/prefetch/document-rules.https.html b/tests/wpt/tests/speculation-rules/prefetch/document-rules.https.html index 070037704ff..805f1cfbc36 100644 --- a/tests/wpt/tests/speculation-rules/prefetch/document-rules.https.html +++ b/tests/wpt/tests/speculation-rules/prefetch/document-rules.https.html @@ -183,10 +183,10 @@ assert_equals(await isUrlPrefetched(url_2), 0); }, 'test selector_matches with :root'); - // 'selector_matches' should never match with a link inside a shadow tree - // because the scoping root used when matching is always the document. + // 'selector_matches' should use the shadowRoot as the scoping root when + // matching links inside a shadow tree. subsetTestByKey('selectorMatchesInShadowTree', promise_test, async t => { - insertDocumentRule({ selector_matches: 'a.important-link' }); + insertDocumentRule({ selector_matches: ':scope a.important-link' }); // Create shadow root. const shadowHost = document.createElement('div'); @@ -198,7 +198,7 @@ link.className = 'important-link'; await new Promise(resolve => t.step_timeout(resolve, 2000)); - assert_equals(await isUrlPrefetched(url), 0); + assert_equals(await isUrlPrefetched(url), 1); }, 'test selector_matches with link inside shadow tree'); subsetTestByKey('selectorMatchesDisplayNone', promise_test, async t => { diff --git a/tests/wpt/tests/speculation-rules/prerender/cross-origin-iframe.html b/tests/wpt/tests/speculation-rules/prerender/cross-origin-iframe.html index 8982ee28ae0..0fc92fcce1c 100644 --- a/tests/wpt/tests/speculation-rules/prerender/cross-origin-iframe.html +++ b/tests/wpt/tests/speculation-rules/prerender/cross-origin-iframe.html @@ -7,6 +7,8 @@ This file cannot be upstreamed to WPT until: expects that they are not loaded during prerendering. --> <title>Load a cross-origin document in a prerendered iframe</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -30,7 +32,7 @@ promise_test(async t => { once: true }); }); - const url = `resources/cross-origin-iframe.html?uid=${uid}`; + const url = `resources/cross-origin-iframe.html?uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/cross-origin-isolated.https.html b/tests/wpt/tests/speculation-rules/prerender/cross-origin-isolated.https.html index 1d64592b194..9d5d8b36930 100644 --- a/tests/wpt/tests/speculation-rules/prerender/cross-origin-isolated.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/cross-origin-isolated.https.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Allow crossOriginIsolated in prerendered page</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -21,7 +23,7 @@ promise_test(async t => { testChannel.addEventListener('message', e => resolve(e.data), {once: true}); }); - startPrerendering(`resources/cross-origin-isolated.https.html?uid=${uid}`); + startPrerendering(`resources/cross-origin-isolated.https.html?uid=${uid}&target_hint=${getTargetHint()}`); assert_true(await gotMessage); }, 'Allow crossOriginIsolated in prerendered page'); </script> diff --git a/tests/wpt/tests/speculation-rules/prerender/csp-script-src-elem-inline-speculation-rules.html b/tests/wpt/tests/speculation-rules/prerender/csp-script-src-elem-inline-speculation-rules.html index 62689184ba9..7f33c32793b 100644 --- a/tests/wpt/tests/speculation-rules/prerender/csp-script-src-elem-inline-speculation-rules.html +++ b/tests/wpt/tests/speculation-rules/prerender/csp-script-src-elem-inline-speculation-rules.html @@ -1,4 +1,6 @@ <!DOCTYPE html> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/common/utils.js"></script> <script src="/resources/testharness.js"></script> @@ -17,7 +19,7 @@ promise_test(async t => { // Open the test runner in a popup - it will prerender itself, record the // test results, and send them back to this harness. const url = - `resources/csp-script-src-elem-inline-speculation-rules.html?key=${key}`; + `resources/csp-script-src-elem-inline-speculation-rules.html?key=${key}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); // Wait until the test sends us the results. diff --git a/tests/wpt/tests/speculation-rules/prerender/csp-script-src-inline-speculation-rules.html b/tests/wpt/tests/speculation-rules/prerender/csp-script-src-inline-speculation-rules.html index 6c3a817f761..1d5b35c30fb 100644 --- a/tests/wpt/tests/speculation-rules/prerender/csp-script-src-inline-speculation-rules.html +++ b/tests/wpt/tests/speculation-rules/prerender/csp-script-src-inline-speculation-rules.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <meta name="timeout" content="long"> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <script src="/common/utils.js"></script> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -17,7 +19,7 @@ promise_test(async t => { // Open the test runner in a popup - it will prerender itself, record the // test results, and send them back to this harness. const url = - `resources/csp-script-src-inline-speculation-rules.html?key=${key}`; + `resources/csp-script-src-inline-speculation-rules.html?key=${key}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); // Wait until the test sends us the results. diff --git a/tests/wpt/tests/speculation-rules/prerender/csp-script-src-self.html b/tests/wpt/tests/speculation-rules/prerender/csp-script-src-self.html index 46fbfd72fd0..86cf9def4a5 100644 --- a/tests/wpt/tests/speculation-rules/prerender/csp-script-src-self.html +++ b/tests/wpt/tests/speculation-rules/prerender/csp-script-src-self.html @@ -1,4 +1,6 @@ <!DOCTYPE html> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/common/utils.js"></script> <script src="/resources/testharness.js"></script> @@ -17,7 +19,7 @@ promise_test(async t => { // Open the test runner in a popup - it will prerender itself, record the // test results, and send them back to this harness. const url = - `resources/csp-script-src-self.html?key=${key}`; + `resources/csp-script-src-self.html?key=${key}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); // Wait until the test sends us the results. diff --git a/tests/wpt/tests/speculation-rules/prerender/csp-script-src-strict-dynamic.html b/tests/wpt/tests/speculation-rules/prerender/csp-script-src-strict-dynamic.html index d84ea3e435b..d5d80794011 100644 --- a/tests/wpt/tests/speculation-rules/prerender/csp-script-src-strict-dynamic.html +++ b/tests/wpt/tests/speculation-rules/prerender/csp-script-src-strict-dynamic.html @@ -1,4 +1,6 @@ <!DOCTYPE html> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/common/utils.js"></script> <script src="/resources/testharness.js"></script> @@ -17,7 +19,7 @@ promise_test(async t => { // Open the test runner in a popup - it will prerender itself, record the // test results, and send them back to this harness. const url = - `resources/csp-script-src-strict-dynamic.html?key=${key}`; + `resources/csp-script-src-strict-dynamic.html?key=${key}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); // Wait until the test sends us the results. diff --git a/tests/wpt/tests/speculation-rules/prerender/csp-script-src-unsafe-inline.html b/tests/wpt/tests/speculation-rules/prerender/csp-script-src-unsafe-inline.html index ea2879bc72c..b9b3092a128 100644 --- a/tests/wpt/tests/speculation-rules/prerender/csp-script-src-unsafe-inline.html +++ b/tests/wpt/tests/speculation-rules/prerender/csp-script-src-unsafe-inline.html @@ -1,4 +1,6 @@ <!DOCTYPE html> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/common/utils.js"></script> <script src="/resources/testharness.js"></script> @@ -17,7 +19,7 @@ promise_test(async t => { // Open the test runner in a popup - it will prerender itself, record the // test results, and send them back to this harness. const url = - `resources/csp-script-src-unsafe-inline.html?key=${key}`; + `resources/csp-script-src-unsafe-inline.html?key=${key}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); // Wait until the test sends us the results. diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/audio-setSinkId.https.html b/tests/wpt/tests/speculation-rules/prerender/resources/audio-setSinkId.https.html index f53e2f9a8b3..1121b20915f 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/audio-setSinkId.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/resources/audio-setSinkId.https.html @@ -6,15 +6,15 @@ <audio controls id="beat" src="./bear-av1-opus.mp4" loop></audio> <script> -const params = new URLSearchParams(location.search); - // The main test page (restriction-audio-setSinkId.https.html) loads the // initiator page, then the initiator page will prerender itself with the // `prerendering` parameter. +const params = new URLSearchParams(location.search); const isPrerendering = params.has('prerendering'); if (!isPrerendering) { - loadInitiatorPage(); + const rule_extras = {'target_hint': getTargetHint()}; + loadInitiatorPage(rule_extras); } else { const prerenderEventCollector = new PrerenderEventCollector(); diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/background-fetch.https.html b/tests/wpt/tests/speculation-rules/prerender/resources/background-fetch.https.html index 3f1c072d108..659a821e358 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/background-fetch.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/resources/background-fetch.https.html @@ -5,15 +5,15 @@ <script src="/speculation-rules/prerender/resources/deferred-promise-utils.js"></script> <script> -const params = new URLSearchParams(location.search); - // The main test page (restriction-background-fetch.https.html) loads the // initiator page, then the initiator page will prerender itself with the // `prerendering` parameter. +const params = new URLSearchParams(location.search); const isPrerendering = params.has('prerendering'); if (!isPrerendering) { - loadInitiatorPage(); + const rule_extras = {'target_hint': getTargetHint()}; + loadInitiatorPage(rule_extras); } else { async function loadPrerenderPage() { const prerenderEventCollector = new PrerenderEventCollector(); diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/background-sync.https.html b/tests/wpt/tests/speculation-rules/prerender/resources/background-sync.https.html index f11a951818a..dd452aa3451 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/background-sync.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/resources/background-sync.https.html @@ -5,15 +5,15 @@ <script src="/speculation-rules/prerender/resources/deferred-promise-utils.js"></script> <script> -const params = new URLSearchParams(location.search); - // The main test page (restriction-background-sync.tentative.https.html) // loads the initiator page, then the initiator page will prerender itself // with the `prerendering` parameter. +const params = new URLSearchParams(location.search); const isPrerendering = params.has('prerendering'); if (!isPrerendering) { - loadInitiatorPage(); + const rule_extras = {'target_hint': getTargetHint()}; + loadInitiatorPage(rule_extras); } else { async function loadPrerenderPage() { const prerenderEventCollector = new PrerenderEventCollector(); diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/battery-status.https.html b/tests/wpt/tests/speculation-rules/prerender/resources/battery-status.https.html index eb611175381..dc1e745cbe6 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/battery-status.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/resources/battery-status.https.html @@ -6,13 +6,13 @@ <script src="/speculation-rules/prerender/resources/deferred-promise-utils.js"></script> <script> -const params = new URLSearchParams(location.search); - // The main test page (restriction-battery-status.html) loads the initiator // page, then the initiator page will prerender itself with the `prerendering` // parameter. +const params = new URLSearchParams(location.search); if (!params.has('prerendering')) { - loadInitiatorPage(); + const rule_extras = {'target_hint': getTargetHint()}; + loadInitiatorPage(rule_extras); } else { const prerenderEventCollector = new PrerenderEventCollector(); prerenderEventCollector.start(navigator.getBattery(), 'navigator.getBattery'); diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/cross-origin-iframe.html b/tests/wpt/tests/speculation-rules/prerender/resources/cross-origin-iframe.html index 21ccc0ca1b2..10a3b62f0ec 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/cross-origin-iframe.html +++ b/tests/wpt/tests/speculation-rules/prerender/resources/cross-origin-iframe.html @@ -48,7 +48,8 @@ async function main() { // `prerendering` parameter. const params = new URLSearchParams(location.search); if (!params.has('prerendering')) { - loadInitiatorPage(); + const rule_extras = {'target_hint': getTargetHint()}; + loadInitiatorPage(rule_extras); } else { main(); } diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/csp-script-src.js b/tests/wpt/tests/speculation-rules/prerender/resources/csp-script-src.js index 866acaa09ba..6107819a369 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/csp-script-src.js +++ b/tests/wpt/tests/speculation-rules/prerender/resources/csp-script-src.js @@ -3,6 +3,9 @@ const params = new URLSearchParams(location.search); // Take a key used for storing a test result in the server. const key = params.get('key'); +// Take a target hint to decide a target context for prerendering. +const rule_extras = {'target_hint': getTargetHint()}; + // Speculation rules injection is blocked in the csp-script-src 'self' test. const block = location.pathname.endsWith('csp-script-src-self.html'); @@ -37,7 +40,7 @@ if (!run_test) { }); } - startPrerendering(url.toString()); + startPrerendering(url.toString(), rule_extras); // Wait until the prerendered page signals us it's ready to close. nextValueFromServer(done_key).then(() => { diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/generic-sensor.https.html b/tests/wpt/tests/speculation-rules/prerender/resources/generic-sensor.https.html index 63dc2aca99c..26f4ac7dcdc 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/generic-sensor.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/resources/generic-sensor.https.html @@ -13,7 +13,8 @@ const params = new URLSearchParams(location.search); const isPrerendering = params.has('prerendering'); if (!isPrerendering) { - loadInitiatorPage(); + const rule_extras = {'target_hint': getTargetHint()}; + loadInitiatorPage(rule_extras); } else { const sensorName = params.get('sensorName'); const sensorType = window[sensorName]; diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/media-autoplay-attribute.html b/tests/wpt/tests/speculation-rules/prerender/resources/media-autoplay-attribute.html index ebef5b725df..c14df771544 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/media-autoplay-attribute.html +++ b/tests/wpt/tests/speculation-rules/prerender/resources/media-autoplay-attribute.html @@ -13,7 +13,8 @@ const params = new URLSearchParams(location.search); const isPrerendering = params.has('prerendering'); if (!isPrerendering) { - loadInitiatorPage(); + const rule_extras = {'target_hint': getTargetHint()}; + loadInitiatorPage(rule_extras); } else { const mediaType = params.get('type'); const media = document.getElementById(mediaType); diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/media-device-info.https.html b/tests/wpt/tests/speculation-rules/prerender/resources/media-device-info.https.html index 09e85e77b18..14d2ff78c99 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/media-device-info.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/resources/media-device-info.https.html @@ -14,7 +14,8 @@ const params = new URLSearchParams(location.search); const isPrerendering = params.has('prerendering'); if (!isPrerendering) { - loadInitiatorPage(); + const rule_extras = {'target_hint': getTargetHint()}; + loadInitiatorPage(rule_extras); } else { const prerenderEventCollector = new PrerenderEventCollector(); prerenderEventCollector.start( diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/media-devices-access.https.html b/tests/wpt/tests/speculation-rules/prerender/resources/media-devices-access.https.html index 462ce53e1b9..6739605f03b 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/media-devices-access.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/resources/media-devices-access.https.html @@ -13,6 +13,7 @@ const params = new URLSearchParams(location.search); const isPrerendering = params.has('prerendering'); if (!isPrerendering) { + const rule_extras = {'target_hint': getTargetHint()}; loadInitiatorPage(); } else { const prerenderEventCollector = new PrerenderEventCollector(); diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/media-play.html b/tests/wpt/tests/speculation-rules/prerender/resources/media-play.html index 48cd3beb3b2..f4c0af9579c 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/media-play.html +++ b/tests/wpt/tests/speculation-rules/prerender/resources/media-play.html @@ -13,7 +13,8 @@ const params = new URLSearchParams(location.search); const isPrerendering = params.has('prerendering'); if (!isPrerendering) { - loadInitiatorPage(); + const rule_extras = {'target_hint': getTargetHint()}; + loadInitiatorPage(rule_extras); } else { const mediaType = params.get('type'); const media = document.getElementById(mediaType); diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/utils.js b/tests/wpt/tests/speculation-rules/prerender/resources/utils.js index 62b3b3225cd..687f6a43982 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/utils.js +++ b/tests/wpt/tests/speculation-rules/prerender/resources/utils.js @@ -102,7 +102,10 @@ async function writeValueToServer(key, value) { // Loads the initiator page, and navigates to the prerendered page after it // receives the 'readyToActivate' message. -function loadInitiatorPage() { +// +// `rule_extras` provides additional parameters for the speculation rule used +// to trigger prerendering. +function loadInitiatorPage(rule_extras = {}) { // Used to communicate with the prerendering page. const prerenderChannel = new PrerenderChannel('prerender-channel'); window.addEventListener('unload', () => { @@ -125,11 +128,15 @@ function loadInitiatorPage() { url.searchParams.append('prerendering', ''); // Prerender a page that notifies the initiator page of the page's ready to be // activated via the 'readyToActivate'. - startPrerendering(url.toString()); + startPrerendering(url.toString(), rule_extras); // Navigate to the prerendered page after being informed. readyToActivate.then(() => { - window.location = url.toString(); + if (rule_extras['target_hint'] === '_blank') { + window.open(url.toString(), '_blank', 'noopener'); + } else { + window.location = url.toString(); + } }).catch(e => { const testChannel = new PrerenderChannel('test-channel'); testChannel.postMessage( @@ -427,3 +434,15 @@ function failTest(reason, uid) { bc.postMessage({result: 'FAILED', reason}); bc.close(); } + +// Retrieves a target hint from URLSearchParams of the current window and +// returns it. Throw an Error if it doesn't have the valid target hint param. +function getTargetHint() { + const params = new URLSearchParams(window.location.search); + const target_hint = params.get('target_hint'); + if (target_hint === null) + throw new Error('window.location does not have a target hint param'); + if (target_hint !== '_self' && target_hint !== '_blank') + throw new Error('window.location does not have a valid target hint param'); + return target_hint; +} diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/web-xr-immersive-vr-session.https.html b/tests/wpt/tests/speculation-rules/prerender/resources/web-xr-immersive-vr-session.https.html index d043c88cdb5..decb33657a6 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/web-xr-immersive-vr-session.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/resources/web-xr-immersive-vr-session.https.html @@ -5,15 +5,15 @@ <script src="/speculation-rules/prerender/resources/deferred-promise-utils.js"></script> <script> -const params = new URLSearchParams(location.search); - // The main test page (restriction-web-xr-immersive-vr-session.https.html) loads // the initiator page, then the initiator page will prerender itself with the // `prerendering` parameter. +const params = new URLSearchParams(location.search); const isPrerendering = params.has('prerendering'); if (!isPrerendering) { - loadInitiatorPage(); + const rule_extras = {'target_hint': getTargetHint()}; + loadInitiatorPage(rule_extras); } else { const prerenderEventCollector = new PrerenderEventCollector(); prerenderEventCollector.start( diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/web-xr-inline-session.https.html b/tests/wpt/tests/speculation-rules/prerender/resources/web-xr-inline-session.https.html index 8f3e01134af..cde1f15a2ae 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/web-xr-inline-session.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/resources/web-xr-inline-session.https.html @@ -5,15 +5,15 @@ <script src="/speculation-rules/prerender/resources/deferred-promise-utils.js"></script> <script> -const params = new URLSearchParams(location.search); - // The main test page (restriction-web-xr-inline-session.https.html) loads the // initiator page, then the initiator page will prerender itself with the // `prerendering` parameter. +const params = new URLSearchParams(location.search); const isPrerendering = params.has('prerendering'); if (!isPrerendering) { - loadInitiatorPage(); + const rule_extras = {'target_hint': getTargetHint()}; + loadInitiatorPage(rule_extras); } else { const prerenderEventCollector = new PrerenderEventCollector(); prerenderEventCollector.start( diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-audio-setSinkId-with-invalid-sinkId.https.tentative.html b/tests/wpt/tests/speculation-rules/prerender/restriction-audio-setSinkId-with-invalid-sinkId.https.tentative.html index 136c2c1c2fb..f4a362894c8 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-audio-setSinkId-with-invalid-sinkId.https.tentative.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-audio-setSinkId-with-invalid-sinkId.https.tentative.html @@ -2,6 +2,8 @@ <title> Access to the setSinkId of the Audio API with an invalid value is deferred </title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -26,7 +28,7 @@ promise_test(async t => { }); }); - const url = `resources/audio-setSinkId.https.html?sinkId=invalid&uid=${uid}`; + const url = `resources/audio-setSinkId.https.html?sinkId=invalid&uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-audio-setSinkId.https.tentative.html b/tests/wpt/tests/speculation-rules/prerender/restriction-audio-setSinkId.https.tentative.html index ba5c0e820ae..a3b6db50418 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-audio-setSinkId.https.tentative.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-audio-setSinkId.https.tentative.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Access to the setSinkId of the Audio API is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -24,7 +26,7 @@ promise_test(async t => { }); }); - const url = `resources/audio-setSinkId.https.html?sinkId=default&uid=${uid}`; + const url = `resources/audio-setSinkId.https.html?sinkId=default&uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-background-fetch.https.html b/tests/wpt/tests/speculation-rules/prerender/restriction-background-fetch.https.html index 40b3aa2eea8..466e886dcb9 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-background-fetch.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-background-fetch.https.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Access to the Background Fetch API is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -42,7 +44,7 @@ promise_test(async t => { t.add_cleanup(() => registration.unregister()); await wait_for_state(t, registration.installing, 'activated'); - const url = `resources/background-fetch.https.html?uid=${uid}`; + const url = `resources/background-fetch.https.html?uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-background-sync.tentative.https.html b/tests/wpt/tests/speculation-rules/prerender/restriction-background-sync.tentative.https.html index a6dcde2e96f..53dbb56d99f 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-background-sync.tentative.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-background-sync.tentative.https.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Access to the Background Sync API is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -42,7 +44,7 @@ promise_test(async t => { t.add_cleanup(() => registration.unregister()); await wait_for_state(t, registration.installing, 'activated'); - const url = `resources/background-sync.https.html?uid=${uid}`; + const url = `resources/background-sync.https.html?uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-battery-status.https.html b/tests/wpt/tests/speculation-rules/prerender/restriction-battery-status.https.html index 920ff24571b..995b3d85d9e 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-battery-status.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-battery-status.https.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Access to the Battery Status API is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -22,7 +24,7 @@ promise_test(async t => { once: true }); }); - const url = `resources/battery-status.https.html?uid=${uid}`; + const url = `resources/battery-status.https.html?uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-media-auto-play-attribute.html b/tests/wpt/tests/speculation-rules/prerender/restriction-media-auto-play-attribute.html index 210709f10e1..10db174db9f 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-media-auto-play-attribute.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-media-auto-play-attribute.html @@ -5,6 +5,8 @@ that media resources are not loaded during prerendering, but it's possible the spec will allow loading and only disallow playback. --> <title>Access to the Autoplay of the Media is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -29,7 +31,7 @@ function RunTest(type, description) { once: true }); }); - const url = `resources/media-autoplay-attribute.html?type=${type}&uid=${uid}`; + const url = `resources/media-autoplay-attribute.html?type=${type}&uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-media-camera.https.html b/tests/wpt/tests/speculation-rules/prerender/restriction-media-camera.https.html index 2955c3b767c..5435c737ccd 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-media-camera.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-media-camera.https.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Access to the Camera of the user media device is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -23,7 +25,7 @@ promise_test(async t => { once: true }); }); - const url = `resources/media-devices-access.https.html?video=true&uid=${uid}`; + const url = `resources/media-devices-access.https.html?video=true&uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); // According to spec, gUM will resolve only if the window has focus. window.focus(); diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-media-device-info.https.html b/tests/wpt/tests/speculation-rules/prerender/restriction-media-device-info.https.html index a26528f6eaa..f725145aa15 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-media-device-info.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-media-device-info.https.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Access to the Media Device Info is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -22,7 +24,7 @@ promise_test(async t => { once: true }); }); - const url = `resources/media-device-info.https.html?uid=${uid}`; + const url = `resources/media-device-info.https.html?uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-media-microphone.https.html b/tests/wpt/tests/speculation-rules/prerender/restriction-media-microphone.https.html index a4971db08b9..36607ed95e6 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-media-microphone.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-media-microphone.https.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Access to the Microphone of the user media device is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -23,7 +25,7 @@ promise_test(async t => { once: true }); }); - const url = `resources/media-devices-access.https.html?&audio=true&uid=${uid}`; + const url = `resources/media-devices-access.https.html?&audio=true&uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); // According to spec, gUM will resolve only if the window has focus. window.focus(); diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-media-play.html b/tests/wpt/tests/speculation-rules/prerender/restriction-media-play.html index aa4030284dd..3db8c22c417 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-media-play.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-media-play.html @@ -5,6 +5,8 @@ that media resources are not loaded during prerendering, but it's possible the spec will allow loading and only disallow playback. --> <title>Access to the Play of the Media is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -30,7 +32,7 @@ function RunTest(type, description) { }); }); - const url = `resources/media-play.html?type=${type}&uid=${uid}`; + const url = `resources/media-play.html?type=${type}&uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-screen-capture.https.html b/tests/wpt/tests/speculation-rules/prerender/restriction-screen-capture.https.html index 4390522b51e..f1ad821a003 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-screen-capture.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-screen-capture.https.html @@ -13,10 +13,6 @@ <script> setup(() => assertSpeculationRulesIsSupported()); -const params = new URLSearchParams(window.location.search); -const target_hint = params.get('target_hint'); -const rule_extras = {target_hint}; - promise_test(async t => { const uid = token(); const bc = new PrerenderChannel('prerender-channel', uid); @@ -32,6 +28,7 @@ promise_test(async t => { // Start prerendering a page that attempts to invoke the Screen Capture API. // This API is activated-gated so it's expected to fail: // https://wicg.github.io/nav-speculation/prerendering.html#implicitly-restricted + const rule_extras = {'target_hint': getTargetHint()}; startPrerendering( `resources/screen-capture.https.html?uid=${uid}`, rule_extras); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-accelerometer.https.html b/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-accelerometer.https.html index 098c54d9b9b..72e3e86bce8 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-accelerometer.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-accelerometer.https.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Access to the Accelerometer API is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -31,7 +33,7 @@ promise_test(async t => { once: true }); }); - const url = `resources/generic-sensor.https.html?sensorName=Accelerometer&uid=${uid}`; + const url = `resources/generic-sensor.https.html?sensorName=Accelerometer&uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-ambient-light-sensor.https.html b/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-ambient-light-sensor.https.html index 8c0d6adc367..b398c4bd6c4 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-ambient-light-sensor.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-ambient-light-sensor.https.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Access to the Ambient Light Sensor API is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -31,7 +33,7 @@ promise_test(async t => { once: true }); }); - const url = `resources/generic-sensor.https.html?sensorName=AmbientLightSensor&uid=${uid}`; + const url = `resources/generic-sensor.https.html?sensorName=AmbientLightSensor&uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-gyroscope.https.html b/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-gyroscope.https.html index 5bc71d2237b..48e018e0189 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-gyroscope.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-gyroscope.https.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Access to the Gyroscope API is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -31,7 +33,7 @@ promise_test(async t => { once: true }); }); - const url = `resources/generic-sensor.https.html?sensorName=Gyroscope&uid=${uid}`; + const url = `resources/generic-sensor.https.html?sensorName=Gyroscope&uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-magnetometer.https.html b/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-magnetometer.https.html index 3f870b252df..928a73f5720 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-magnetometer.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-sensor-magnetometer.https.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Access to the Magnetometer API is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -31,7 +33,7 @@ promise_test(async t => { once: true }); }); - const url = `resources/generic-sensor.https.html?sensorName=Magnetometer&uid=${uid}`; + const url = `resources/generic-sensor.https.html?sensorName=Magnetometer&uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-web-xr-immersive-vr-session.https.html b/tests/wpt/tests/speculation-rules/prerender/restriction-web-xr-immersive-vr-session.https.html index 1db22e213ef..094bdbd1a0f 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-web-xr-immersive-vr-session.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-web-xr-immersive-vr-session.https.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Access to the WebXR immersive-vr session API is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -24,7 +26,7 @@ promise_test(async t => { }); }); - const url = `resources/web-xr-immersive-vr-session.https.html?uid=${uid}`; + const url = `resources/web-xr-immersive-vr-session.https.html?uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/speculation-rules/prerender/restriction-web-xr-inline-session.https.html b/tests/wpt/tests/speculation-rules/prerender/restriction-web-xr-inline-session.https.html index d3dd5569ad8..398f2cb5049 100644 --- a/tests/wpt/tests/speculation-rules/prerender/restriction-web-xr-inline-session.https.html +++ b/tests/wpt/tests/speculation-rules/prerender/restriction-web-xr-inline-session.https.html @@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Access to the WebXR inline session API is deferred</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -24,7 +26,7 @@ promise_test(async t => { }); }); - const url = `resources/web-xr-inline-session.https.html?uid=${uid}`; + const url = `resources/web-xr-inline-session.https.html?uid=${uid}&target_hint=${getTargetHint()}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; diff --git a/tests/wpt/tests/svg-aam/name/comp_host_language_label.html b/tests/wpt/tests/svg-aam/name/comp_host_language_label.html new file mode 100644 index 00000000000..81f9dab2e6b --- /dev/null +++ b/tests/wpt/tests/svg-aam/name/comp_host_language_label.html @@ -0,0 +1,71 @@ +<!doctype html> +<html> +<head> + <title>Name Comp: Host Language Label</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/resources/testdriver.js"></script> + <script src="/resources/testdriver-vendor.js"></script> + <script src="/resources/testdriver-actions.js"></script> + <script src="/wai-aria/scripts/aria-utils.js"></script> +</head> +<body> + +<h1>SVG-AAM: Label Tests</h1> + +<p>Tests SVG-specific host language label rules (title element and xlink:title attr) in <a href="https://w3c.github.io/svg-aam/#mapping_additional_nd">SVG-AAM §8.1 Name and Description</a>, but note the open issues in <a href="https://github.com/w3c/svg-aam/issues/31">SVG-AAM #31</a>. + + +<h2>SVG * > title</h2> +<svg viewbox="0 0 300 100"> + <circle cx="26" cy="26" r="25" data-expectedlabel="circle label" data-testname="circle > title" class="ex"><title>circle label</title></circle> + <rect x="60" y="1" width="50" height="50" data-expectedlabel="rect label" data-testname="rect > title" class="ex"><title>rect label</title></rect> + <polygon points="100,100 150,25 150,75 200,0" fill="none" stroke="black" data-expectedlabel="polygon label" data-testname="polygon > title" class="ex"><title>polygon label</title></polygon> +</svg><br> +<svg viewbox="0 0 200 90"> + <g fill="white" stroke="green" stroke-width="5" data-expectedlabel="group label" data-testname="g > title" class="ex"> + <title>group label</title> + <circle cx="40" cy="40" r="25" /> + <circle cx="60" cy="60" r="25" /> + </g> +</svg> +<br> + + +<h2>SVG a[xlink:title][href]</h2> +<svg viewbox="0 0 300 100"> + <a href="#" data-expectedlabel="circle link label" xlink:title="circle link label" data-testname="[xlink:title][href] > circle" class="ex"><circle cx="26" cy="26" r="25"></circle></a> + <a href="#" data-expectedlabel="rect link label" xlink:title="rect link label" data-testname="[xlink:title][href] > rect" class="ex"><rect x="60" y="1" width="50" height="50"></rect></a> + <a href="#" data-expectedlabel="polygon link label" xlink:title="polygon link label" data-testname="[xlink:title][href] > polygon" class="ex"><polygon points="100,100 150,25 150,75 200,0" fill="none" stroke="black"></polygon></a> +</svg><br> +<svg viewbox="0 0 200 90"> + <a href="#" data-expectedlabel="group link label" xlink:title="group link label" data-testname="[xlink:title][href] > g" class="ex"> + <g fill="white" stroke="green" stroke-width="5"> + <circle cx="40" cy="40" r="25" /> + <circle cx="60" cy="60" r="25" /> + </g> + </a> +</svg> +<br> + +<h2>SVG a[xlink:title][xlink:href]:not([href])</h2> +<svg viewbox="0 0 300 100"> + <a xlink:href="#" data-expectedlabel="circle link label" xlink:title="circle link label" data-testname="[xlink:title][xlink:href] > circle" class="ex"><circle cx="26" cy="26" r="25"></circle></a> + <a xlink:href="#" data-expectedlabel="rect link label" xlink:title="rect link label" data-testname="[xlink:title][xlink:href] > rect" class="ex"><rect x="60" y="1" width="50" height="50"></rect></a> + <a xlink:href="#" data-expectedlabel="polygon link label" xlink:title="polygon link label" data-testname="[xlink:title][xlink:href] > polygon" class="ex"><polygon points="100,100 150,25 150,75 200,0" fill="none" stroke="black"></polygon></a> +</svg><br> +<svg viewbox="0 0 200 90"> + <a xlink:href="#" data-expectedlabel="group link label" xlink:title="group link label" data-testname="[xlink:title][xlink:href] > g" class="ex"> + <g fill="white" stroke="green" stroke-width="5"> + <circle cx="40" cy="40" r="25" /> + <circle cx="60" cy="60" r="25" /> + </g> + </a> +</svg> +<br> + +<script> +AriaUtils.verifyLabelsBySelector(".ex"); +</script> +</body> +</html> diff --git a/tests/wpt/tests/svg-aam/role/roles-generic.html b/tests/wpt/tests/svg-aam/role/roles-generic.html new file mode 100644 index 00000000000..e7fe9f33de5 --- /dev/null +++ b/tests/wpt/tests/svg-aam/role/roles-generic.html @@ -0,0 +1,47 @@ +<!doctype html> +<html> +<head> + <title>SVG-AAM Generic Role Verification Tests</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/resources/testdriver.js"></script> + <script src="/resources/testdriver-vendor.js"></script> + <script src="/resources/testdriver-actions.js"></script> + <script src="/wai-aria/scripts/aria-utils.js"></script> +</head> +<body> + + +<p>Tests ONLY the default <code>generic</code> mappings defined in <a href="https://w3c.github.io/svg-aam/#include_elements">SVG-AAM: 5.1.2 Including Elements in the Accessibility Tree</a>.</p> + +<h2>Simple Elements</h2> +<!-- Note: adding an inoccuous label, tabindex, or some other accessible marker may cause the computedrole result to change. --> +<svg> + <!-- Some elements skipped: never-rendered elements can return unpredicable/undefined/unspecified values for computedrole. --> + <circle data-testname="el-circle" class="ex-generic"></circle> + <ellipse data-testname="el-ellipse" class="ex-generic"></ellipse> + <foreignObject data-testname="el-foreignObject" class="ex-generic"></foreignObject> + <g data-testname="el-g" class="ex-generic"></g> + + <!-- [sic] included here b/c the spec says unlabeled, unrendered images are generic, but the spec is wrong. --> + <!-- Once https://github.com/w3c/svg-aam/issues/32 is resolved, this test can be moved to another file. --> + <image data-testname="el-image" data-expectedrole="image" class="ex"></image> + + <line data-testname="el-line" class="ex-generic"></line> + <!-- skipped: mesh --> + <path data-testname="el-path" class="ex-generic"></path> + <polygon data-testname="el-polygon" class="ex-generic"></polygon> + <polyline data-testname="el-polyline" class="ex-generic"></polyline> + <rect data-testname="el-rect" class="ex-generic"></rect> + <!-- blocked: textPath -> https://w3c.github.io/svg-aam/#textpath-tspan-mappings-issue--> + <!-- blocked: tspan -> https://w3c.github.io/svg-aam/#textpath-tspan-mappings-issue --> + <!-- skipped: use --> +</svg> + +<script> +AriaUtils.verifyGenericRolesBySelector(".ex-generic"); +AriaUtils.verifyRolesBySelector(".ex"); +</script> + +</body> +</html> \ No newline at end of file diff --git a/tests/wpt/tests/svg-aam/role/roles.html b/tests/wpt/tests/svg-aam/role/roles.html new file mode 100644 index 00000000000..cc104662bdb --- /dev/null +++ b/tests/wpt/tests/svg-aam/role/roles.html @@ -0,0 +1,107 @@ +<!doctype html> +<html> +<head> + <title>SVG-AAM Role Verification Tests</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/resources/testdriver.js"></script> + <script src="/resources/testdriver-vendor.js"></script> + <script src="/resources/testdriver-actions.js"></script> + <script src="/wai-aria/scripts/aria-utils.js"></script> +</head> +<body> + + +<p>Tests the mappings defined in <a href="https://w3c.github.io/svg-aam/#mapping_role_table">SVG-AAM: 6.2 Element Mapping</a>.<p> + +<h2>Simple Elements With aria-label to Ensure Tree Inclusion</h2> +<svg> + <!-- Some elements skipped: never-rendered elements can return unpredicable/undefined/unspecified values for computedrole. --> + <a href="#" data-testname="el-a[href]" data-expectedrole="link" aria-label="label" class="ex">x</a> + <a xlink:href="#" data-testname="el-a[xlink:href]" data-expectedrole="link" aria-label="label" class="ex">x</a> + <!-- skipped: animate --> + <!-- skipped: animateMotion --> + <!-- skipped: animateTransform --> + <!-- blocked: audio -> https://github.com/w3c/html-aam/issues/511 --> + <!-- todo: canvas -> follow HTML --> + <!-- blocked: circle -> https://github.com/w3c/svg-aam/issues/24 --> + <!-- n/a: clipPath --> + <!-- n/a: cursor --> + <!-- n/a: defs --> + <!-- n/a: desc --> + <!-- n/a: discard --> + <!-- blocked: ellipse -> https://github.com/w3c/svg-aam/issues/24 --> + <!-- n/a: feBlend --> + <!-- n/a: feColorMatrix --> + <!-- n/a: feComponentTransfer --> + <!-- n/a: feComposite --> + <!-- n/a: feConvolveMatrix --> + <!-- n/a: feDiffuseLighting --> + <!-- n/a: feDisplacementMap --> + <!-- n/a: feDistantLight --> + <!-- n/a: feDropShadow --> + <!-- n/a: feFlood --> + <!-- n/a: feFuncA --> + <!-- n/a: feFuncB --> + <!-- n/a: feFuncG --> + <!-- n/a: feFuncR --> + <!-- n/a: feGaussianBlur --> + <!-- n/a: feImage --> + <!-- n/a: feMerge --> + <!-- n/a: feMergeNode --> + <!-- n/a: feMorphology --> + <!-- n/a: feOffset --> + <!-- n/a: fePointLight --> + <!-- n/a: feSpecularLighting --> + <!-- n/a: feSpotLight --> + <!-- n/a: feTile --> + <!-- n/a: feTurbulence --> + <!-- n/a: filter --> + <!-- todo: foreignObject (spec says `group` role if rendered and labeled) --> + <g fill="white" stroke="green" stroke-width="2" data-testname="el-g" data-expectedrole="group" aria-label="label" class="ex"> + <circle cx="40" cy="40" r="25" /> + </g> + <!-- n/a: hatch --> + <!-- n/a: hatchPath --> + <!-- todo: iframe -> follow HTML --> + <image data-testname="el-image" data-expectedrole="image" aria-label="label" class="ex" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="></image> + <!-- blocked: line -> https://github.com/w3c/svg-aam/issues/24 --> + <!-- n/a: linearGradient --> + <!-- n/a: marker --> + <!-- n/a: mask --> + <!-- todo: mesh (spec says `image` role if rendered and labeled) --> + <!-- n/a: meshPatch --> + <!-- n/a: meshRow --> + <!-- n/a: metadata --> + <!-- n/a: mpath --> + <!-- blocked: path -> https://github.com/w3c/svg-aam/issues/24 --> + <!-- n/a: pattern --> + <!-- blocked: polygon -> https://github.com/w3c/svg-aam/issues/24 --> + <!-- blocked: polyline -> https://github.com/w3c/svg-aam/issues/24 --> + <!-- n/a: radialGradient --> + <!-- blocked: rect -> https://github.com/w3c/svg-aam/issues/24 --> + <!-- n/a: script --> + <!-- n/a: set --> + <!-- n/a: solidColor --> + <!-- todo: source -> follow HTML --> + <!-- n/a: stop --> + <!-- n/a: style --> + <!-- blocked: svg -> https://github.com/w3c/svg-aam/issues/18 --> + <!-- n/a: switch --> + <!-- blocked: symbol -> https://github.com/w3c/svg-aam/issues/24 --> + <!-- blocked: text -> https://github.com/w3c/svg-aam/issues/33 --> + <!-- blocked: textPath -> https://w3c.github.io/svg-aam/#textpath-tspan-mappings-issue--> + <!-- n/a: title --> + <!-- todo: track -> follow HTML --> + <!-- blocked: tspan -> https://w3c.github.io/svg-aam/#textpath-tspan-mappings-issue --> + <!-- blocked: use -> https://github.com/w3c/svg-aam/issues/24 --> + <!-- todo: video -> follow HTML --> + <!-- n/a: view --> +</svg> + +<script> +AriaUtils.verifyRolesBySelector(".ex"); +</script> + +</body> +</html> \ No newline at end of file diff --git a/tests/wpt/tests/svg/animations/svgangle-animation-unitType.html b/tests/wpt/tests/svg/animations/svgangle-animation-unitType.html new file mode 100644 index 00000000000..fc306360c0f --- /dev/null +++ b/tests/wpt/tests/svg/animations/svgangle-animation-unitType.html @@ -0,0 +1,83 @@ +<!doctype html> +<html> +<meta charset="utf-8"> +<title>Test change of unit type for SVGAngle animation.</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/SVGAnimationTestCase-testharness.js"></script> + +<svg> +</svg> + +<script> +var rootSVGElement = document.querySelector("svg"); + +// Setup test document +var defs = createSVGElement("defs"); + +var marker = createSVGElement("marker"); +marker.setAttribute("id", "marker"); +marker.setAttribute("viewBox", "0 0 10 10"); +marker.setAttribute("markerWidth", "4"); +marker.setAttribute("markerHeight", "3"); +marker.setAttribute("markerUnits", "strokeWidth"); +marker.setAttribute("refX", "1"); +marker.setAttribute("refY", "5"); +marker.setAttribute("orient", "0deg"); +defs.appendChild(marker); + +var polyline = createSVGElement("polyline"); +polyline.setAttribute("id", "polyline"); +polyline.setAttribute("points", "0,0 10,5 0,10 1,5"); +polyline.setAttribute("fill", "green"); +marker.appendChild(polyline); + +var path = createSVGElement("path"); +path.setAttribute("id", "path"); +path.setAttribute("d", "M45,50 L55,50"); +path.setAttribute("stroke-width","10"); +path.setAttribute("stroke", "green"); +path.setAttribute("marker-end", "url(#marker)"); +path.setAttribute("onclick", "executeTest()"); + +var animate = createSVGElement("animate"); +animate.setAttribute("id", "animation"); +animate.setAttribute("attributeName", "orient"); +animate.setAttribute("begin", "0s"); +animate.setAttribute("dur", "4s"); +animate.setAttribute("from", "0deg"); +animate.setAttribute("to", "200grad"); +marker.appendChild(animate); +rootSVGElement.appendChild(defs); +rootSVGElement.appendChild(path); + +// Setup animation test +function sample1() { + // Check initial/end conditions + assert_equals(marker.orientAngle.baseVal.unitType, SVGAngle.SVG_ANGLETYPE_DEG); + assert_equals(marker.orientAngle.animVal.unitType, SVGAngle.SVG_ANGLETYPE_DEG); +} + +function sample2() { + assert_equals(marker.orientAngle.baseVal.unitType, SVGAngle.SVG_ANGLETYPE_DEG); + assert_equals(marker.orientAngle.animVal.unitType, SVGAngle.SVG_ANGLETYPE_DEG); +} + +function sample3() { + assert_equals(marker.orientAngle.baseVal.unitType, SVGAngle.SVG_ANGLETYPE_DEG); + assert_equals(marker.orientAngle.animVal.unitType, SVGAngle.SVG_ANGLETYPE_GRAD); +} + +smil_async_test((t) => { + const expectedValues = [ + // [animationId, time, sampleCallback] + ["animation", 0.0, sample1], + ["animation", 2.0, sample2], + ["animation", 3.999, sample3], + ["animation", 4.001, sample1] + ]; + + runAnimationTest(t, expectedValues); +}); + +</script> diff --git a/tests/wpt/tests/svg/animations/svglengthlist-animation-unitType.html b/tests/wpt/tests/svg/animations/svglengthlist-animation-unitType.html new file mode 100644 index 00000000000..0dcb8a7962f --- /dev/null +++ b/tests/wpt/tests/svg/animations/svglengthlist-animation-unitType.html @@ -0,0 +1,88 @@ +<!doctype html> +<html> +<meta charset="utf-8"> +<title>Test change of unit type for SVGLengthList animation.</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/SVGAnimationTestCase-testharness.js"></script> + +<svg> +</svg> + +<script> +var rootSVGElement = document.querySelector("svg"); + +// Setup test document +var text = createSVGElement("text"); +text.setAttribute("id", "text"); +text.textContent = "ABCD"; +text.setAttribute("dx", "50 70 90 110"); +text.setAttribute("y", "50"); +text.setAttribute("onclick", "executeTest()"); +rootSVGElement.appendChild(text); + +var animate = createSVGElement("animate"); +animate.setAttribute("id", "animation"); +animate.setAttribute("attributeName", "dx"); +animate.setAttribute("begin", "0s"); +animate.setAttribute("dur", "4s"); +animate.setAttribute("from", "50px 70px 90px 100px"); +animate.setAttribute("to", "60% 90% 120% 150%"); +text.appendChild(animate); + +// Setup animation test +function sample1() { + assert_equals(text.dx.animVal.numberOfItems, 4); + assert_equals(text.dx.animVal[0].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); + assert_equals(text.dx.animVal[1].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); + assert_equals(text.dx.animVal[2].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); + assert_equals(text.dx.animVal[3].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); + + assert_equals(text.dx.baseVal.numberOfItems, 4); + assert_equals(text.dx.baseVal[0].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); + assert_equals(text.dx.baseVal[1].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); + assert_equals(text.dx.baseVal[2].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); + assert_equals(text.dx.baseVal[3].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); +} + +function sample2() { + assert_equals(text.dx.animVal.numberOfItems, 4); + assert_equals(text.dx.animVal[0].unitType, SVGLength.SVG_LENGTHTYPE_PX); + assert_equals(text.dx.animVal[1].unitType, SVGLength.SVG_LENGTHTYPE_PX); + assert_equals(text.dx.animVal[2].unitType, SVGLength.SVG_LENGTHTYPE_PX); + assert_equals(text.dx.animVal[3].unitType, SVGLength.SVG_LENGTHTYPE_PX); + + assert_equals(text.dx.baseVal.numberOfItems, 4); + assert_equals(text.dx.baseVal[0].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); + assert_equals(text.dx.baseVal[1].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); + assert_equals(text.dx.baseVal[2].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); + assert_equals(text.dx.baseVal[3].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); +} + +function sample3() { + assert_equals(text.dx.animVal.numberOfItems, 4); + assert_equals(text.dx.animVal[0].unitType, SVGLength.SVG_LENGTHTYPE_PERCENTAGE); + assert_equals(text.dx.animVal[1].unitType, SVGLength.SVG_LENGTHTYPE_PERCENTAGE); + assert_equals(text.dx.animVal[2].unitType, SVGLength.SVG_LENGTHTYPE_PERCENTAGE); + assert_equals(text.dx.animVal[3].unitType, SVGLength.SVG_LENGTHTYPE_PERCENTAGE); + + assert_equals(text.dx.baseVal.numberOfItems, 4); + assert_equals(text.dx.baseVal[0].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); + assert_equals(text.dx.baseVal[1].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); + assert_equals(text.dx.baseVal[2].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); + assert_equals(text.dx.baseVal[3].unitType, SVGLength.SVG_LENGTHTYPE_NUMBER); +} + +smil_async_test((t) => { + const expectedValues = [ + // [animationId, time, sampleCallback] + ["animation", 0.0, sample1], + ["animation", 2.0, sample2], + ["animation", 3.999, sample3], + ["animation", 4.001, sample1] + ]; + + runAnimationTest(t, expectedValues); +}); + +</script> diff --git a/tests/wpt/tests/tools/ci/requirements_tc.txt b/tests/wpt/tests/tools/ci/requirements_tc.txt index 63250b63d3a..c5b8c81e9fa 100644 --- a/tests/wpt/tests/tools/ci/requirements_tc.txt +++ b/tests/wpt/tests/tools/ci/requirements_tc.txt @@ -1,4 +1,4 @@ pygithub==2.1.1 pyyaml==6.0.1 requests==2.31.0 -taskcluster==56.0.2 +taskcluster==58.0.0 diff --git a/tests/wpt/tests/tools/ci/tc/taskgraph.py b/tests/wpt/tests/tools/ci/tc/taskgraph.py index d270dad460c..54542ef0f83 100644 --- a/tests/wpt/tests/tools/ci/tc/taskgraph.py +++ b/tests/wpt/tests/tools/ci/tc/taskgraph.py @@ -67,6 +67,10 @@ def resolve_chunks(task_data): return [task_data] rv = [] total_chunks = task_data["chunks"] + if "chunks-override" in task_data: + override = task_data["chunks-override"].get(task_data["vars"]["test-type"]) + if override is not None: + total_chunks = override for i in range(1, total_chunks + 1): chunk_data = deepcopy(task_data) chunk_data["chunks"] = {"id": i, diff --git a/tests/wpt/tests/tools/ci/tc/tasks/test.yml b/tests/wpt/tests/tools/ci/tc/tasks/test.yml index ce0b27bc3f3..163e15c185c 100644 --- a/tests/wpt/tests/tools/ci/tc/tasks/test.yml +++ b/tests/wpt/tests/tools/ci/tc/tasks/test.yml @@ -112,6 +112,8 @@ components: privileged: true scopes: - "docker-worker:capability:privileged" + chunks-override: + testharness: 20 tox-python3_7: env: diff --git a/tests/wpt/tests/tools/ci/tc/tests/test_valid.py b/tests/wpt/tests/tools/ci/tc/tests/test_valid.py index 4181425666f..544c187affa 100644 --- a/tests/wpt/tests/tools/ci/tc/tests/test_valid.py +++ b/tests/wpt/tests/tools/ci/tc/tests/test_valid.py @@ -285,6 +285,10 @@ def test_verify_payload(): 'wpt-firefox_android-nightly-testharness-14', 'wpt-firefox_android-nightly-testharness-15', 'wpt-firefox_android-nightly-testharness-16', + 'wpt-firefox_android-nightly-testharness-17', + 'wpt-firefox_android-nightly-testharness-18', + 'wpt-firefox_android-nightly-testharness-19', + 'wpt-firefox_android-nightly-testharness-20', 'wpt-firefox-stable-reftest-1', 'wpt-firefox-stable-reftest-2', 'wpt-firefox-stable-reftest-3', diff --git a/tests/wpt/tests/tools/requirements_tests.txt b/tests/wpt/tests/tools/requirements_tests.txt index 1df3b7ee9e8..15e826c73c1 100644 --- a/tests/wpt/tests/tools/requirements_tests.txt +++ b/tests/wpt/tests/tools/requirements_tests.txt @@ -2,5 +2,5 @@ httpx[http2]==0.24.1 json-e==4.5.3 jsonschema==4.17.3 pyyaml==6.0.1 -taskcluster==56.0.2 +taskcluster==58.0.0 mozterm==1.0.0 diff --git a/tests/wpt/tests/tools/webdriver/webdriver/bidi/error.py b/tests/wpt/tests/tools/webdriver/webdriver/bidi/error.py index 7b688dd1a6c..75505ea88da 100644 --- a/tests/wpt/tests/tools/webdriver/webdriver/bidi/error.py +++ b/tests/wpt/tests/tools/webdriver/webdriver/bidi/error.py @@ -63,6 +63,10 @@ class NoSuchHandleException(BidiException): error_code = "no such handle" +class NoSuchHistoryEntryException(BidiException): + error_code = "no such history entry" + + class NoSuchNodeException(BidiException): error_code = "no such node" diff --git a/tests/wpt/tests/tools/webdriver/webdriver/bidi/modules/browsing_context.py b/tests/wpt/tests/tools/webdriver/webdriver/bidi/modules/browsing_context.py index 15aa26b4427..e0371a79ecd 100644 --- a/tests/wpt/tests/tools/webdriver/webdriver/bidi/modules/browsing_context.py +++ b/tests/wpt/tests/tools/webdriver/webdriver/bidi/modules/browsing_context.py @@ -7,9 +7,7 @@ from ..undefined import UNDEFINED, Undefined class ElementOptions(Dict[str, Any]): - def __init__( - self, element: Mapping[str, Any] - ): + def __init__(self, element: Mapping[str, Any]): self["type"] = "element" self["element"] = element @@ -31,6 +29,14 @@ class OriginOptions(Enum): VIEWPORT = "viewport" +class FormatOptions(Dict[str, Any]): + def __init__(self, type: str, quality: Optional[float] = None): + dict.__init__(self, type=type) + + if quality is not None: + self["quality"] = quality + + class BrowsingContext(BidiModule): @command def activate(self, context: str) -> Mapping[str, Any]: @@ -42,12 +48,14 @@ class BrowsingContext(BidiModule): context: str, clip: Optional[ClipOptions] = None, origin: Optional[OriginOptions] = None, + format: Optional[FormatOptions] = None, ) -> Mapping[str, Any]: params: MutableMapping[str, Any] = {"context": context} + if format is not None: + params["format"] = format if clip is not None: params["clip"] = clip - if origin is not None: params["origin"] = origin @@ -203,3 +211,7 @@ class BrowsingContext(BidiModule): params["devicePixelRatio"] = device_pixel_ratio return params + + @command + def traverse_history(self, context: str, delta: int) -> Mapping[str, Any]: + return {"context": context, "delta": delta} diff --git a/tests/wpt/tests/tools/wpt/android.py b/tests/wpt/tests/tools/wpt/android.py index c99acf37738..1061181485d 100644 --- a/tests/wpt/tests/tools/wpt/android.py +++ b/tests/wpt/tests/tools/wpt/android.py @@ -15,7 +15,7 @@ here = os.path.abspath(os.path.dirname(__file__)) wpt_root = os.path.abspath(os.path.join(here, os.pardir, os.pardir)) -NDK_VERSION = "r23c" +NDK_VERSION = "r25c" CMDLINE_TOOLS_VERSION_STRING = "11.0" CMDLINE_TOOLS_VERSION = "9644228" diff --git a/tests/wpt/tests/tools/wpt/run.py b/tests/wpt/tests/tools/wpt/run.py index c5012af122f..7bac4355829 100644 --- a/tests/wpt/tests/tools/wpt/run.py +++ b/tests/wpt/tests/tools/wpt/run.py @@ -395,17 +395,18 @@ class FirefoxAndroid(BrowserSetup): device_serial=device_serial, prompt=kwargs["prompt"]) - if "ADB_PATH" not in os.environ: - adb_path = os.path.join(android.get_paths(None)["sdk"], - "platform-tools", - "adb") - os.environ["ADB_PATH"] = adb_path - adb_path = os.environ["ADB_PATH"] + if kwargs["adb_binary"] is None: + if "ADB_PATH" not in os.environ: + adb_path = os.path.join(android.get_paths(None)["sdk"], + "platform-tools", + "adb") + os.environ["ADB_PATH"] = adb_path + kwargs["adb_binary"] = os.environ["ADB_PATH"] - self._logcat = AndroidLogcat(adb_path, base_path=kwargs["logcat_dir"]) + self._logcat = AndroidLogcat(kwargs["adb_binary"], base_path=kwargs["logcat_dir"]) for device_serial in kwargs["device_serial"]: - device = mozdevice.ADBDeviceFactory(adb=adb_path, + device = mozdevice.ADBDeviceFactory(adb=kwargs["adb_binary"], device=device_serial) self._logcat.start(device_serial) if self.browser.apk_path: diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/edge.py b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/edge.py index c6936e77b24..5b49545a38a 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/edge.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/edge.py @@ -95,7 +95,7 @@ class EdgeBrowser(WebDriverBrowser): return [self.webdriver_binary, f"--port={self.port}"] + self.webdriver_args -def run_info_extras(**kwargs): +def run_info_extras(logger, **kwargs): osReleaseCommand = r"(Get-ItemProperty 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion').ReleaseId" osBuildCommand = r"(Get-ItemProperty 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion').BuildLabEx" try: diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/epiphany.py b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/epiphany.py index 912173a52e4..562b2dce2c0 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/epiphany.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/epiphany.py @@ -71,5 +71,5 @@ def env_options(): return {} -def run_info_extras(**kwargs): +def run_info_extras(logger, **kwargs): return {"webkit_port": "gtk"} diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox.py b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox.py index e5e784e6aa4..0cb5ff5d104 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox.py @@ -193,7 +193,7 @@ def env_options(): "supports_debugger": True} -def run_info_extras(**kwargs): +def run_info_extras(logger, **kwargs): def get_bool_pref_if_exists(pref): for key, value in kwargs.get('extra_prefs', []): diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox_android.py b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox_android.py index 1937d97c401..6ebe4a69054 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox_android.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox_android.py @@ -1,6 +1,8 @@ # mypy: allow-untyped-defs import os +import subprocess +import re from mozrunner import FennecEmulatorRunner, get_app_context @@ -14,6 +16,7 @@ from ..executors.executormarionette import (MarionetteTestharnessExecutor, # no from .base import (Browser, ExecutorBrowser) from .firefox import (get_timeout_multiplier, # noqa: F401 + run_info_browser_version, run_info_extras as fx_run_info_extras, update_properties, # noqa: F401 executor_kwargs as fx_executor_kwargs, # noqa: F401 @@ -87,14 +90,45 @@ def env_extras(**kwargs): return [] -def run_info_extras(**kwargs): - rv = fx_run_info_extras(**kwargs) +def run_info_extras(logger, **kwargs): + rv = fx_run_info_extras(logger, **kwargs) package = kwargs["package_name"] rv.update({"e10s": True if package is not None and "geckoview" in package else False, "headless": False}) + + if kwargs["browser_version"] is None: + rv.update(run_info_browser_version(**kwargs)) + + if rv.get("browser_version") is None: + # If we didn't get the browser version from the apk, try to get it from adb dumpsys + rv["browser_version"] = get_package_browser_version(logger, + kwargs["adb_binary"], + kwargs["package_name"]) + return rv +def get_package_browser_version(logger, adb_binary, package_name): + if adb_binary is None: + logger.warning("Couldn't run adb to get Firefox Android version number") + return None + try: + completed = subprocess.run([adb_binary, "shell", "dumpsys", "package", package_name], + check=True, + capture_output=True, + encoding="utf8") + except subprocess.CalledProcessError as e: + logger.warning(f"adb failed with return code {e.returncode}\nCaptured stderr:\n{e.stderr}") + return None + + version_name_re = re.compile(r"^\s+versionName=(.*)") + for line in completed.stdout.splitlines(): + m = version_name_re.match(line) + if m is not None: + return m.group(1) + logger.warning("Failed to find versionName property in dumpsys output") + + def env_options(): return {"server_host": "127.0.0.1", "supports_debugger": True} diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/safari.py b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/safari.py index 40f5f54859f..44d289c7e34 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/safari.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/safari.py @@ -69,7 +69,7 @@ def env_options(): return {} -def run_info_extras(**kwargs): +def run_info_extras(logger, **kwargs): webdriver_binary = kwargs["webdriver_binary"] rv = {} diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/webkit.py b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/webkit.py index cecfbe4e27a..a3e8d1361c3 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/webkit.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/webkit.py @@ -72,7 +72,7 @@ def env_options(): return {} -def run_info_extras(**kwargs): +def run_info_extras(logger, **kwargs): return {"webkit_port": kwargs["webkit_port"]} diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/webkitgtk_minibrowser.py b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/webkitgtk_minibrowser.py index 355ffe35979..29a95638877 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/webkitgtk_minibrowser.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/webkitgtk_minibrowser.py @@ -76,7 +76,7 @@ def env_options(): return {} -def run_info_extras(**kwargs): +def run_info_extras(logger, **kwargs): return {"webkit_port": "gtk"} diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/executors/base.py b/tests/wpt/tests/tools/wptrunner/wptrunner/executors/base.py index e89b57b57ac..7ef9c9b54cb 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/executors/base.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/executors/base.py @@ -760,7 +760,10 @@ class CallbackHandler: except AttributeError as e: # If we fail to get an attribute from the protocol presumably that's a # ProtocolPart we don't implement - if getattr(e, "obj") == self.protocol: + # AttributeError got an obj property in Python 3.10, for older versions we + # fall back to looking at the error message. + if ((hasattr(e, "obj") and getattr(e, "obj") == self.protocol) or + "'{self.protocol.__class__.__name__}' has no attribute" in str(e)): raise NotImplementedError from e except self.unimplemented_exc: self.logger.warning("Action %s not implemented" % action) diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/executors/executormarionette.py b/tests/wpt/tests/tools/wptrunner/wptrunner/executors/executormarionette.py index 1f183f1ba47..8d60f1ed3c4 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/executors/executormarionette.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/executors/executormarionette.py @@ -1037,8 +1037,14 @@ class MarionetteRefTestExecutor(RefTestExecutor): self.implementation_kwargs = {} if reftest_internal: self.implementation_kwargs["screenshot"] = reftest_screenshot - self.implementation_kwargs["chrome_scope"] = (browser_version is not None and - int(browser_version.split(".")[0]) < 82) + self.implementation_kwargs["chrome_scope"] = False + # Older versions of Gecko require switching to chrome scope to run refests + if browser_version is not None: + try: + major_version = int(browser_version.split(".")[0]) + self.implementation_kwargs["chrome_scope"] = major_version < 82 + except ValueError: + pass self.close_after_done = close_after_done self.has_window = False self.original_pref_values = {} diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/products.py b/tests/wpt/tests/tools/wptrunner/wptrunner/products.py index 5b26557aa17..c81396f3dd3 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/products.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/products.py @@ -31,7 +31,7 @@ class Product: self.env_options = getattr(module, data["env_options"])() self.get_env_extras = getattr(module, data["env_extras"]) self.run_info_extras = (getattr(module, data["run_info_extras"]) - if "run_info_extras" in data else lambda **kwargs:{}) + if "run_info_extras" in data else lambda product, **kwargs:{}) self.get_timeout_multiplier = getattr(module, data["timeout_multiplier"]) self.executor_classes = {} diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/wptrunner.py b/tests/wpt/tests/tools/wptrunner/wptrunner/wptrunner.py index b9e5190105c..d65369b380d 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/wptrunner.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/wptrunner.py @@ -52,7 +52,7 @@ def setup_logging(*args, **kwargs): def get_loader(test_paths: wptcommandline.TestPaths, product: products.Product, **kwargs: Any) -> Tuple[testloader.TestQueueBuilder, testloader.TestLoader]: - run_info_extras = product.run_info_extras(**kwargs) + run_info_extras = product.run_info_extras(logger, **kwargs) base_run_info = wpttest.get_run_info(kwargs["run_info"], product.name, browser_version=kwargs.get("browser_version"), diff --git a/tests/wpt/tests/url/resources/urltestdata.json b/tests/wpt/tests/url/resources/urltestdata.json index 287a84b467a..69767a20db9 100644 --- a/tests/wpt/tests/url/resources/urltestdata.json +++ b/tests/wpt/tests/url/resources/urltestdata.json @@ -9529,5 +9529,160 @@ "pathname": "", "search": "", "hash": "" + }, + "Scheme relative path starting with multiple slashes", + { + "input": "///test", + "base": "http://example.org/", + "href": "http://test/", + "protocol": "http:", + "username": "", + "password": "", + "host": "test", + "hostname": "test", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "///\\//\\//test", + "base": "http://example.org/", + "href": "http://test/", + "protocol": "http:", + "username": "", + "password": "", + "host": "test", + "hostname": "test", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "///example.org/path", + "base": "http://example.org/", + "href": "http://example.org/path", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/path", + "search": "", + "hash": "" + }, + { + "input": "///example.org/../path", + "base": "http://example.org/", + "href": "http://example.org/path", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/path", + "search": "", + "hash": "" + }, + { + "input": "///example.org/../../", + "base": "http://example.org/", + "href": "http://example.org/", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "///example.org/../path/../../", + "base": "http://example.org/", + "href": "http://example.org/", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "///example.org/../path/../../path", + "base": "http://example.org/", + "href": "http://example.org/path", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/path", + "search": "", + "hash": "" + }, + { + "input": "/\\/\\//example.org/../path", + "base": "http://example.org/", + "href": "http://example.org/path", + "protocol": "http:", + "username": "", + "password": "", + "host": "example.org", + "hostname": "example.org", + "port": "", + "pathname": "/path", + "search": "", + "hash": "" + }, + { + "input": "///abcdef/../", + "base": "file:///", + "href": "file:///", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "/", + "search": "", + "hash": "" + }, + { + "input": "/\\//\\/a/../", + "base": "file:///", + "href": "file://////", + "protocol": "file:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "////", + "search": "", + "hash": "" + }, + { + "input": "//a/../", + "base": "file:///", + "href": "file://a/", + "protocol": "file:", + "username": "", + "password": "", + "host": "a", + "hostname": "a", + "port": "", + "pathname": "/", + "search": "", + "hash": "" } ] diff --git a/tests/wpt/tests/urlpattern/resources/urlpattern-hasregexpgroups-tests.js b/tests/wpt/tests/urlpattern/resources/urlpattern-hasregexpgroups-tests.js new file mode 100644 index 00000000000..4be886e4a53 --- /dev/null +++ b/tests/wpt/tests/urlpattern/resources/urlpattern-hasregexpgroups-tests.js @@ -0,0 +1,18 @@ +test(() => { + assert_implements('hasRegExpGroups' in URLPattern.prototype, "hasRegExpGroups is not implemented"); + assert_false(new URLPattern({}).hasRegExpGroups, "match-everything pattern"); + for (let component of ['protocol', 'username', 'password', 'hostname', 'port', 'pathname', 'search', 'hash']) { + assert_false(new URLPattern({[component]: '*'}).hasRegExpGroups, `wildcard in ${component}`); + assert_false(new URLPattern({[component]: ':foo'}).hasRegExpGroups, `segment wildcard in ${component}`); + assert_false(new URLPattern({[component]: ':foo?'}).hasRegExpGroups, `optional segment wildcard in ${component}`); + assert_true(new URLPattern({[component]: ':foo(hi)'}).hasRegExpGroups, `named regexp group in ${component}`); + assert_true(new URLPattern({[component]: '(hi)'}).hasRegExpGroups, `anonymous regexp group in ${component}`); + if (component !== 'protocol' && component !== 'port') { + // These components are more narrow in what they accept in any case. + assert_false(new URLPattern({[component]: 'a-{:hello}-z-*-a'}).hasRegExpGroups, `wildcards mixed in with fixed text and wildcards in ${component}`); + assert_true(new URLPattern({[component]: 'a-(hi)-z-(lo)-a'}).hasRegExpGroups, `regexp groups mixed in with fixed text and wildcards in ${component}`); + } + } + assert_false(new URLPattern({pathname: '/a/:foo/:baz?/b/*'}).hasRegExpGroups, "complex pathname with no regexp"); + assert_true(new URLPattern({pathname: '/a/:foo/:baz([a-z]+)?/b/*'}).hasRegExpGroups, "complex pathname with regexp"); +}, ''); diff --git a/tests/wpt/tests/urlpattern/urlpattern-hasregexpgroups.any.js b/tests/wpt/tests/urlpattern/urlpattern-hasregexpgroups.any.js new file mode 100644 index 00000000000..33133d2511b --- /dev/null +++ b/tests/wpt/tests/urlpattern/urlpattern-hasregexpgroups.any.js @@ -0,0 +1,2 @@ +// META: global=window,worker +// META: script=resources/urlpattern-hasregexpgroups-tests.js diff --git a/tests/wpt/tests/web-animations/animation-model/animation-types/property-list.js b/tests/wpt/tests/web-animations/animation-model/animation-types/property-list.js index 32b857c30ed..39a92c7498d 100644 --- a/tests/wpt/tests/web-animations/animation-model/animation-types/property-list.js +++ b/tests/wpt/tests/web-animations/animation-model/animation-types/property-list.js @@ -1435,6 +1435,12 @@ const gCSSProperties2 = { types: [ ] }, + 'view-transition-name': { + // https://drafts.csswg.org/css-view-transitions/#propdef-view-transition-name + types: [ + { type: 'discrete', options: [ [ 'none', 'header' ] ] }, + ] + }, 'visibility': { // https://drafts.csswg.org/css2/visufx.html#propdef-visibility types: [ 'visibility' ] diff --git a/tests/wpt/tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content.html b/tests/wpt/tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content.html index 659a69c8664..70f5d8e32ca 100644 --- a/tests/wpt/tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content.html +++ b/tests/wpt/tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content.html @@ -68,7 +68,7 @@ function allSamplesAtOne(audiobuffer, location) { for (var i = 0; i < buf.length; i++) { // The convolver can introduce a slight numerical error. if (Math.abs(buf[i] - 1.0) > 0.0001) { - assert_true(false, `Invalid value at index ${i}, expecte close to 1.0, found ${buf[i]} when ${location}`) + assert_true(false, `Invalid value at index ${i}, expected close to 1.0, found ${buf[i]} when ${location}`) return Promise.reject(); } } diff --git a/tests/wpt/tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/active-processing.https.html b/tests/wpt/tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/active-processing.https.html index 7b8c1295c69..25565b76866 100644 --- a/tests/wpt/tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/active-processing.https.html +++ b/tests/wpt/tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/active-processing.https.html @@ -27,7 +27,7 @@ let numberOfChannels = 7; // Number of frames in the AudioBuffer. Fairly arbitrary, but should - // probablybe more than one render quantum and significantly less than + // probably be more than one render quantum and significantly less than // |renderLength|. let bufferFrames = 131; diff --git a/tests/wpt/tests/webdriver/tests/bidi/__init__.py b/tests/wpt/tests/webdriver/tests/bidi/__init__.py index fd2f704d3e5..9c976d4a674 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/__init__.py +++ b/tests/wpt/tests/webdriver/tests/bidi/__init__.py @@ -20,8 +20,9 @@ def recursive_compare(expected: Any, actual: Any) -> None: if type(expected) is dict: # Actual dict can have more keys as part of the forwards-compat design. - assert expected.keys() <= actual.keys(), \ - f"Key set should be present: {set(expected.keys()) - set(actual.keys())}" + assert ( + expected.keys() <= actual.keys() + ), f"Key set should be present: {set(expected.keys()) - set(actual.keys())}" for key in expected.keys(): recursive_compare(expected[key], actual[key]) return @@ -88,7 +89,8 @@ async def get_device_pixel_ratio(bidi_session, context: str) -> float: return window.devicePixelRatio; }""", target=ContextTarget(context["context"]), - await_promise=False) + await_promise=False, + ) return result["value"] @@ -122,6 +124,22 @@ async def get_viewport_dimensions(bidi_session, context: str): return remote_mapping_to_dict(result["value"]) +async def get_document_dimensions(bidi_session, context: str): + expression = """ + ({ + height: document.documentElement.scrollHeight, + width: document.documentElement.scrollWidth, + }); + """ + result = await bidi_session.script.evaluate( + expression=expression, + target=ContextTarget(context["context"]), + await_promise=False, + ) + + return remote_mapping_to_dict(result["value"]) + + def remote_mapping_to_dict(js_object) -> Dict: obj = {} for key, value in js_object: diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/__init__.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/__init__.py index 18f64fb5189..32d44104d51 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/__init__.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/__init__.py @@ -1,6 +1,7 @@ from math import floor from ... import ( get_device_pixel_ratio, + get_document_dimensions, get_element_dimensions, get_viewport_dimensions, remote_mapping_to_dict, @@ -72,6 +73,18 @@ async def get_physical_viewport_dimensions(bidi_session, context): return (floor(viewport["width"] * dpr), floor(viewport["height"] * dpr)) +async def get_physical_document_dimensions(bidi_session, context): + """Get the physical dimensions of the context's document. + + :param bidi_session: BiDiSession + :param context: Browsing context ID + :returns: Tuple of (int, int) containing document width, document height. + """ + document = await get_document_dimensions(bidi_session, context) + dpr = await get_device_pixel_ratio(bidi_session, context) + return (floor(document["width"] * dpr), floor(document["height"] * dpr)) + + async def get_reference_screenshot(bidi_session, inline, context, html): """Get the reference screenshot for the given context and html. diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/clip.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/clip.py index 1916cb9b7fa..4e37c4714c3 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/clip.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/clip.py @@ -1,8 +1,12 @@ import pytest -from tests.support.image import png_dimensions + +import webdriver.bidi.error as error from webdriver.bidi.modules.browsing_context import ElementOptions, BoxOptions from webdriver.bidi.modules.script import ContextTarget +from tests.support.image import png_dimensions + + from . import ( get_element_coordinates, get_physical_element_dimensions, @@ -65,7 +69,7 @@ async def test_clip_element(bidi_session, top_context, inline, compare_png_bidi) assert comparison.equal() -async def test_clip_viewport(bidi_session, top_context, inline, compare_png_bidi): +async def test_clip_box(bidi_session, top_context, inline, compare_png_bidi): url = inline("<input>") await bidi_session.browsing_context.navigate( context=top_context["context"], url=url, wait="complete" @@ -150,9 +154,7 @@ async def test_clip_viewport(bidi_session, top_context, inline, compare_png_bidi assert comparison.equal() -async def test_clip_viewport_scroll_to( - bidi_session, top_context, inline, compare_png_bidi -): +async def test_clip_box_scroll_to(bidi_session, top_context, inline, compare_png_bidi): element_styles = "background-color: black; width: 50px; height:50px;" # Render an element inside of viewport for the reference. @@ -208,7 +210,7 @@ async def test_clip_viewport_scroll_to( assert comparison.equal() -async def test_clip_viewport_partially_visible( +async def test_clip_box_partially_visible( bidi_session, top_context, inline, compare_png_bidi ): viewport_dimensions = await get_viewport_dimensions(bidi_session, top_context) @@ -259,3 +261,44 @@ async def test_clip_viewport_partially_visible( comparison = await compare_png_bidi(reference_data, new_data) assert comparison.equal() + + +async def test_clip_box_outside_of_window_viewport(bidi_session, top_context): + viewport_dimensions = await get_viewport_dimensions(bidi_session, top_context) + + with pytest.raises(error.UnableToCaptureScreenException): + await bidi_session.browsing_context.capture_screenshot( + context=top_context["context"], + clip=BoxOptions( + x=viewport_dimensions["width"], + y=viewport_dimensions["height"], + width=1, + height=1, + ), + ) + + +async def test_clip_element_outside_of_window_viewport( + bidi_session, top_context, inline +): + viewport_dimensions = await get_viewport_dimensions(bidi_session, top_context) + + element_styles = "background-color: black; width: 50px; height:50px;" + # Render element outside of viewport. + url = inline( + f"""<div style="{element_styles} margin-top: {viewport_dimensions["height"]}px"></div>""" + ) + await bidi_session.browsing_context.navigate( + context=top_context["context"], url=url, wait="complete" + ) + element = await bidi_session.script.evaluate( + await_promise=False, + expression="document.querySelector('div')", + target=ContextTarget(top_context["context"]), + ) + + with pytest.raises(error.UnableToCaptureScreenException): + await bidi_session.browsing_context.capture_screenshot( + context=top_context["context"], + clip=ElementOptions(element=element), + ) diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/format.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/format.py new file mode 100644 index 00000000000..7401d94a3ec --- /dev/null +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/format.py @@ -0,0 +1,39 @@ +import pytest + +from webdriver.bidi.modules.browsing_context import FormatOptions + + +@pytest.mark.asyncio +async def test_format_type(bidi_session, top_context, inline): + await bidi_session.browsing_context.navigate( + context=top_context["context"], + url=inline("<div style='margin-top:2000px'>foo</div>"), + wait="complete") + + png_screenshot = await bidi_session.browsing_context.capture_screenshot( + context=top_context["context"], + format=FormatOptions(type="image/png")) + jpeg_screenshot = await bidi_session.browsing_context.capture_screenshot( + context=top_context["context"], + format=FormatOptions(type="image/jpeg")) + + assert png_screenshot != jpeg_screenshot + + +@pytest.mark.asyncio +async def test_format_quality(bidi_session, top_context, inline): + await bidi_session.browsing_context.navigate( + context=top_context["context"], + url=inline("<div style='margin-top:2000px'>foo</div>"), + wait="complete") + + jpeg_quality_screenshot = await bidi_session.browsing_context.capture_screenshot( + context=top_context["context"], + format=FormatOptions(type="image/jpeg",quality=0.1)) + jpeg_high_quality_screenshot = await bidi_session.browsing_context.capture_screenshot( + context=top_context["context"], + format=FormatOptions(type="image/jpeg",quality=1)) + + assert jpeg_quality_screenshot != jpeg_high_quality_screenshot + + assert len(jpeg_high_quality_screenshot) > len(jpeg_quality_screenshot) diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/invalid.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/invalid.py index 9eb459afb5d..58481c4e7ad 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/invalid.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/invalid.py @@ -1,9 +1,11 @@ import pytest -from ... import get_viewport_dimensions - import webdriver.bidi.error as error -from webdriver.bidi.modules.browsing_context import ElementOptions, BoxOptions +from webdriver.bidi.modules.browsing_context import ( + BoxOptions, + ElementOptions, + FormatOptions, +) from webdriver.bidi.modules.script import ContextTarget pytestmark = pytest.mark.asyncio @@ -83,7 +85,7 @@ async def test_params_clip_element_sharedId_invalid_value(bidi_session, top_cont @pytest.mark.parametrize("value", [None, False, "foo", {}, []]) -async def test_params_clip_viewport_x_invalid_type(bidi_session, top_context, value): +async def test_params_clip_box_x_invalid_type(bidi_session, top_context, value): with pytest.raises(error.InvalidArgumentException): await bidi_session.browsing_context.capture_screenshot( context=top_context["context"], @@ -92,7 +94,7 @@ async def test_params_clip_viewport_x_invalid_type(bidi_session, top_context, va @pytest.mark.parametrize("value", [None, False, "foo", {}, []]) -async def test_params_clip_viewport_y_invalid_type(bidi_session, top_context, value): +async def test_params_clip_box_y_invalid_type(bidi_session, top_context, value): with pytest.raises(error.InvalidArgumentException): await bidi_session.browsing_context.capture_screenshot( context=top_context["context"], @@ -101,9 +103,7 @@ async def test_params_clip_viewport_y_invalid_type(bidi_session, top_context, va @pytest.mark.parametrize("value", [None, False, "foo", {}, []]) -async def test_params_clip_viewport_width_invalid_type( - bidi_session, top_context, value -): +async def test_params_clip_box_width_invalid_type(bidi_session, top_context, value): with pytest.raises(error.InvalidArgumentException): await bidi_session.browsing_context.capture_screenshot( context=top_context["context"], @@ -112,9 +112,7 @@ async def test_params_clip_viewport_width_invalid_type( @pytest.mark.parametrize("value", [None, False, "foo", {}, []]) -async def test_params_clip_viewport_height_invalid_type( - bidi_session, top_context, value -): +async def test_params_clip_box_height_invalid_type(bidi_session, top_context, value): with pytest.raises(error.InvalidArgumentException): await bidi_session.browsing_context.capture_screenshot( context=top_context["context"], @@ -122,7 +120,7 @@ async def test_params_clip_viewport_height_invalid_type( ) -async def test_params_clip_viewport_dimensions_invalid_value(bidi_session, top_context): +async def test_params_clip_box_dimensions_invalid_value(bidi_session, top_context): with pytest.raises(error.UnableToCaptureScreenException): await bidi_session.browsing_context.capture_screenshot( context=top_context["context"], @@ -130,44 +128,15 @@ async def test_params_clip_viewport_dimensions_invalid_value(bidi_session, top_c ) -async def test_params_clip_viewport_outside_of_window_viewport( - bidi_session, top_context -): - viewport_dimensions = await get_viewport_dimensions(bidi_session, top_context) - - with pytest.raises(error.UnableToCaptureScreenException): +async def test_params_origin_invalid_value(bidi_session, top_context): + with pytest.raises(error.InvalidArgumentException): await bidi_session.browsing_context.capture_screenshot( - context=top_context["context"], - clip=BoxOptions( - x=viewport_dimensions["width"], - y=viewport_dimensions["height"], - width=1, - height=1, - ), + context=top_context["context"], origin="page" ) -async def test_params_clip_element_outside_of_window_viewport( - bidi_session, top_context, inline -): - viewport_dimensions = await get_viewport_dimensions(bidi_session, top_context) - - element_styles = "background-color: black; width: 50px; height:50px;" - # Render element outside of viewport. - url = inline( - f"""<div style="{element_styles} margin-top: {viewport_dimensions["height"]}px"></div>""" - ) - await bidi_session.browsing_context.navigate( - context=top_context["context"], url=url, wait="complete" - ) - element = await bidi_session.script.evaluate( - await_promise=False, - expression="document.querySelector('div')", - target=ContextTarget(top_context["context"]), - ) - - with pytest.raises(error.UnableToCaptureScreenException): +async def test_params_format_invalid_value(bidi_session, top_context): + with pytest.raises(error.InvalidArgumentException): await bidi_session.browsing_context.capture_screenshot( - context=top_context["context"], - clip=ElementOptions(element=element), + context=top_context["context"], format=FormatOptions(type="image/invalid") ) diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/origin.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/origin.py new file mode 100644 index 00000000000..7161d363363 --- /dev/null +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/origin.py @@ -0,0 +1,56 @@ +import pytest + +from tests.support.image import png_dimensions + +from . import get_physical_document_dimensions, get_physical_viewport_dimensions + + +@pytest.mark.asyncio +async def test_origin(bidi_session, top_context, inline): + await bidi_session.browsing_context.navigate( + context=top_context["context"], + url=inline("<div style='margin-top:2000px'>foo</div>"), + wait="complete", + ) + + viewport_dimensions = await get_physical_viewport_dimensions( + bidi_session, top_context + ) + document_dimensions = await get_physical_document_dimensions( + bidi_session, top_context + ) + assert not viewport_dimensions == document_dimensions + + document_screenshot = await bidi_session.browsing_context.capture_screenshot( + context=top_context["context"], origin="document" + ) + viewport_screenshot = await bidi_session.browsing_context.capture_screenshot( + context=top_context["context"], origin="viewport" + ) + + assert png_dimensions(document_screenshot) == document_dimensions + assert png_dimensions(viewport_screenshot) == viewport_dimensions + + +@pytest.mark.asyncio +@pytest.mark.parametrize("origin", ["document", "viewport"]) +async def test_origin_consistency(bidi_session, top_context, inline, origin): + await bidi_session.browsing_context.navigate( + context=top_context["context"], + url=inline("<div style='margin-top:2000px'>foo</div>"), + wait="complete", + ) + screenshot_a = await bidi_session.browsing_context.capture_screenshot( + context=top_context["context"], origin=origin + ) + + await bidi_session.browsing_context.navigate( + context=top_context["context"], + url=inline("<div style='margin-top:2000px'>foo</div>"), + wait="complete", + ) + screenshot_b = await bidi_session.browsing_context.capture_screenshot( + context=top_context["context"], origin=origin + ) + + assert screenshot_a == screenshot_b diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/traverse_history/__init__.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/traverse_history/__init__.py new file mode 100644 index 00000000000..12278315491 --- /dev/null +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/traverse_history/__init__.py @@ -0,0 +1,4 @@ +async def get_url_for_context(bidi_session, context): + contexts = await bidi_session.browsing_context.get_tree(root=context) + + return contexts[0]["url"] diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/traverse_history/context.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/traverse_history/context.py new file mode 100644 index 00000000000..7635c0e9ddd --- /dev/null +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/traverse_history/context.py @@ -0,0 +1,66 @@ +import pytest + +import webdriver.bidi.error as error + +from . import get_url_for_context + + +pytestmark = pytest.mark.asyncio + + +async def test_params_context_invalid_value(bidi_session): + with pytest.raises(error.NoSuchFrameException): + await bidi_session.browsing_context.traverse_history(context="foo", delta=1) + + +async def test_top_level_contexts(bidi_session, top_context, new_tab, inline): + pages = [ + inline("<div>page 1</div>"), + inline("<div>page 2</div>"), + ] + for page in pages: + for context in [top_context["context"], new_tab["context"]]: + await bidi_session.browsing_context.navigate( + context=context, url=page, wait="complete" + ) + assert await get_url_for_context(bidi_session, context) == page + + await bidi_session.browsing_context.traverse_history( + context=new_tab["context"], delta=-1 + ) + + assert await get_url_for_context(bidi_session, top_context["context"]) == pages[1] + assert await get_url_for_context(bidi_session, new_tab["context"]) == pages[0] + + +@pytest.mark.parametrize("domain", ["", "alt"], ids=["same_origin", "cross_origin"]) +async def test_iframe(bidi_session, new_tab, inline, domain): + iframe_url_1 = inline("page 1") + page_url = inline(f"<iframe src='{iframe_url_1}'></iframe>", domain=domain) + + await bidi_session.browsing_context.navigate( + context=new_tab["context"], url=page_url, wait="complete" + ) + assert await get_url_for_context(bidi_session, new_tab["context"]) == page_url + + contexts = await bidi_session.browsing_context.get_tree(root=new_tab["context"]) + iframe_context = contexts[0]["children"][0] + + iframe_url_2 = inline("page 2") + await bidi_session.browsing_context.navigate( + context=iframe_context["context"], url=iframe_url_2, wait="complete" + ) + assert ( + await get_url_for_context(bidi_session, iframe_context["context"]) + == iframe_url_2 + ) + + await bidi_session.browsing_context.traverse_history( + context=iframe_context["context"], delta=-1 + ) + + assert await get_url_for_context(bidi_session, new_tab["context"]) == page_url + assert ( + await get_url_for_context(bidi_session, iframe_context["context"]) + == iframe_url_1 + ) diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/traverse_history/delta.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/traverse_history/delta.py new file mode 100644 index 00000000000..05f4d99544f --- /dev/null +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/traverse_history/delta.py @@ -0,0 +1,162 @@ +from pathlib import Path + +import pytest + +import webdriver.bidi.error as error +from webdriver.bidi.modules.script import ContextTarget + +from . import get_url_for_context + + +pytestmark = pytest.mark.asyncio + + +@pytest.mark.parametrize("value", [-2, 1]) +async def test_delta_invalid_value(bidi_session, new_tab, inline, value): + page = inline("<div>page 1</div>") + await bidi_session.browsing_context.navigate( + context=new_tab["context"], url=page, wait="complete" + ) + assert await get_url_for_context(bidi_session, new_tab["context"]) == page + + with pytest.raises(error.NoSuchHistoryEntryException): + await bidi_session.browsing_context.traverse_history( + context=new_tab["context"], delta=value + ) + + +async def test_delta_0(bidi_session, new_tab, inline): + page = inline("<div>page 1</div>") + await bidi_session.browsing_context.navigate( + context=new_tab["context"], url=page, wait="complete" + ) + assert await get_url_for_context(bidi_session, new_tab["context"]) == page + + await bidi_session.browsing_context.traverse_history( + context=new_tab["context"], delta=0 + ) + + # Check that url didn't change + assert await get_url_for_context(bidi_session, new_tab["context"]) == page + + +async def test_delta_forward_and_back(bidi_session, new_tab, inline): + pages = [ + inline("<div>page 1</div>"), + inline("<div>page 2</div>"), + inline("<div>page 3</div>"), + ] + for page in pages: + await bidi_session.browsing_context.navigate( + context=new_tab["context"], url=page, wait="complete" + ) + assert await get_url_for_context(bidi_session, new_tab["context"]) == page + + await bidi_session.browsing_context.traverse_history( + context=new_tab["context"], delta=-2 + ) + + assert await get_url_for_context(bidi_session, new_tab["context"]) == pages[0] + + await bidi_session.browsing_context.traverse_history( + context=new_tab["context"], delta=2 + ) + + assert await get_url_for_context(bidi_session, new_tab["context"]) == pages[2] + + +async def test_navigate_in_the_same_document(bidi_session, new_tab, url): + page_url = "/webdriver/tests/bidi/browsing_context/support/empty.html" + pages = [ + url(page_url), + url(page_url + "#foo"), + url(page_url + "#bar"), + ] + for page in pages: + await bidi_session.browsing_context.navigate( + context=new_tab["context"], url=page, wait="complete" + ) + assert await get_url_for_context(bidi_session, new_tab["context"]) == page + + await bidi_session.browsing_context.traverse_history( + context=new_tab["context"], delta=-1 + ) + + assert await get_url_for_context(bidi_session, new_tab["context"]) == pages[1] + + await bidi_session.browsing_context.traverse_history( + context=new_tab["context"], delta=1 + ) + + assert await get_url_for_context(bidi_session, new_tab["context"]) == pages[2] + + +async def test_history_push_state(bidi_session, new_tab, url): + page_url = url("/webdriver/tests/bidi/browsing_context/support/empty.html") + await bidi_session.browsing_context.navigate( + context=new_tab["context"], url=page_url, wait="complete" + ) + assert await get_url_for_context(bidi_session, new_tab["context"]) == page_url + + pages = [ + f"{page_url}#foo", + f"{page_url}#bar", + ] + for page in pages: + await bidi_session.script.call_function( + function_declaration="""(url) => { + history.pushState(null, null, url); + }""", + arguments=[ + {"type": "string", "value": page}, + ], + await_promise=False, + target=ContextTarget(new_tab["context"]), + ) + assert await get_url_for_context(bidi_session, new_tab["context"]) == page + + await bidi_session.browsing_context.traverse_history( + context=new_tab["context"], delta=-1 + ) + + assert await get_url_for_context(bidi_session, new_tab["context"]) == pages[0] + + await bidi_session.browsing_context.traverse_history( + context=new_tab["context"], delta=1 + ) + + assert await get_url_for_context(bidi_session, new_tab["context"]) == pages[1] + + +@pytest.mark.parametrize( + "pages", + [ + ["data:text/html,<p>foo</p>", "data:text/html,<p>bar</p>"], + [ + f"{Path(__file__).parents[1].as_uri()}/support/empty.html", + f"{Path(__file__).parents[1].as_uri()}/support/other.html", + ], + ], + ids=[ + "data url", + "file url", + ], +) +async def test_navigate_special_protocols(bidi_session, new_tab, pages): + for page in pages: + await bidi_session.browsing_context.navigate( + context=new_tab["context"], url=page, wait="complete" + ) + assert await get_url_for_context(bidi_session, new_tab["context"]) == page + + await bidi_session.browsing_context.traverse_history( + context=new_tab["context"], delta=-1 + ) + + assert await get_url_for_context(bidi_session, new_tab["context"]) == pages[0] + + await bidi_session.browsing_context.traverse_history( + context=new_tab["context"], delta=1 + ) + + assert await get_url_for_context(bidi_session, new_tab["context"]) == pages[1] diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/traverse_history/invalid.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/traverse_history/invalid.py new file mode 100644 index 00000000000..abb0d69c937 --- /dev/null +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/traverse_history/invalid.py @@ -0,0 +1,29 @@ +import pytest + +import webdriver.bidi.error as error + + +pytestmark = pytest.mark.asyncio + + +MAX_INT = 9007199254740991 +MIN_INT = -MAX_INT + + +@pytest.mark.parametrize("value", [None, False, 42, {}, []]) +async def test_params_context_invalid_type(bidi_session, value): + with pytest.raises(error.InvalidArgumentException): + await bidi_session.browsing_context.traverse_history( + context=value, + delta=1 + ) + + +@pytest.mark.parametrize( + "value", [None, False, "foo", 1.5, MIN_INT - 1, MAX_INT + 1, {}, []] +) +async def test_params_delta_invalid_type(bidi_session, top_context, value): + with pytest.raises(error.InvalidArgumentException): + await bidi_session.browsing_context.traverse_history( + context=top_context["context"], delta=value + ) diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/user_prompt_closed/user_prompt_closed.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/user_prompt_closed/user_prompt_closed.py index d22363dd092..68a0eed1922 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/user_prompt_closed/user_prompt_closed.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/user_prompt_closed/user_prompt_closed.py @@ -216,7 +216,7 @@ async def test_subscribe_to_one_context( context=new_context["context"] ) - event = await wait_for_future_safe(s) + event = await wait_for_future_safe(on_prompt_closed) assert event == { "context": new_context["context"], diff --git a/tests/wpt/tests/webdriver/tests/classic/get_element_text/get.py b/tests/wpt/tests/webdriver/tests/classic/get_element_text/get.py index 2a2363c0528..547152b2a72 100644 --- a/tests/wpt/tests/webdriver/tests/classic/get_element_text/get.py +++ b/tests/wpt/tests/webdriver/tests/classic/get_element_text/get.py @@ -102,6 +102,42 @@ def test_read_element_text(session, inline): assert_success(result, "oo") +@pytest.mark.parametrize("text, inner_html, expected", [ + ("cheese", "<slot><span>foo</span>bar</slot>", "cheese"), + ("cheese", "<slot><span>foo</span></slot>bar", "cheesebar"), + ("cheese", "<slot><span style=\"display: none\">foo</span>bar</slot>", "cheese"), + ("", "<slot><span>foo</span>bar</slot>", "foobar"), + ("", "<slot><span>foo</span></slot>bar", "foobar"), + ("", "<slot><span style=\"display: none\">foo</span>bar</slot>", "bar"), +], ids=[ + "custom visible", + "custom outside", + "custom hidden", + "default visible", + "default outside", + "default hidden", +]) +def test_shadow_root_slot(session, inline, text, inner_html, expected): + session.url = inline(f""" + <test-container>{text}</test-container> + <script> + class TestContainer extends HTMLElement {{ + connectedCallback() {{ + const shadow = this.attachShadow({{ mode: "open" }}); + shadow.innerHTML = "{inner_html}"; + }} + }} + + customElements.define("test-container", TestContainer); + </script> + """) + + element = session.find.css("test-container", all=False) + + result = get_element_text(session, element.id) + assert_success(result, expected) + + def test_pretty_print_xml(session, inline): session.url = inline("<xml><foo>che<bar>ese</bar></foo></xml>", doctype="xml") diff --git a/tests/wpt/tests/webnn/resources/test_data/exp.json b/tests/wpt/tests/webnn/resources/test_data/exp.json index 886729f2e8a..8a86edec3b8 100644 --- a/tests/wpt/tests/webnn/resources/test_data/exp.json +++ b/tests/wpt/tests/webnn/resources/test_data/exp.json @@ -6,30 +6,30 @@ "x": { "shape": [24], "data": [ - 1.5401084737753479, - 12.774433809954473, - 61.46073034406041, - 30.371593690722648, - -23.07019138708837, - 6.286732075092644, - 24.049592392056553, - 59.17023846672603, - -72.39779325866608, - 76.17325870390891, - 42.745124211838345, - 31.50150770254453, - 15.485609808293518, - -11.397760090390022, - 50.36123123038939, - -83.05469409695672, - 24.110038122659418, - -28.330545051670825, - -53.749036944957986, - -78.11921866998134, - -83.41683875349166, - -89.72063026731117, - -68.90046001676907, - -71.89803038543928 + 0.342143655338516, + -3.3109650690636583, + -3.696757542725746, + -5.105378072825206, + 5.471040383543361, + -0.06790750193598072, + 2.7373435551676373, + -3.547075850060808, + 5.3392248393586215, + -1.2636781380561768, + -0.9162953518691133, + -9.088432637604779, + -4.016050813135332, + 4.670352907446356, + 7.326991954708756, + 8.294342869341662, + -7.3454139558670795, + -0.9275799995316945, + -1.7085379363808997, + -9.737379277450184, + -1.9747875652397973, + 8.203150154065185, + -7.267597492286808, + -3.5890684093944714 ], "type": "float32" } @@ -38,30 +38,30 @@ "name": "output", "shape": [24], "data": [ - 4.665096282958984, - 353074.40625, - 4.92103607186909e+26, - 15495851933696, - 9.566272773930962e-11, - 537.3943481445312, - 27835916288, - 4.980902673917305e+25, - 3.614401801447914e-32, - 1.2067705660062333e+33, - 3664138167604216000, - 47965678862336, - 5312696, - 0.000011220586202398408, - 7.440557948065475e+21, - 8.507544403157469e-37, - 29570371584, - 4.968216051233487e-13, - 4.54034731570652e-24, - 1.1837368161912076e-34, - 5.922797145303594e-37, - 1.0834951830036632e-39, - 1.1937427251244527e-30, - 5.957731569649706e-32 + 1.4079625606536865, + 0.03648095205426216, + 0.024803820997476578, + 0.006064045242965221, + 237.70733642578125, + 0.9343469142913818, + 15.44589900970459, + 0.02880876138806343, + 208.35113525390625, + 0.2826126217842102, + 0.39999815821647644, + 0.00011296502634650096, + 0.018024004995822906, + 106.73540496826172, + 1520.8004150390625, + 4001.173583984375, + 0.0006455459515564144, + 0.3955096900463104, + 0.18113042414188385, + 0.0000590350573475007, + 0.1387907862663269, + 3652.4365234375, + 0.0006977862794883549, + 0.02762405201792717 ], "type": "float32" } @@ -72,30 +72,30 @@ "x": { "shape": [4, 6], "data": [ - 1.5401084737753479, - 12.774433809954473, - 61.46073034406041, - 30.371593690722648, - -23.07019138708837, - 6.286732075092644, - 24.049592392056553, - 59.17023846672603, - -72.39779325866608, - 76.17325870390891, - 42.745124211838345, - 31.50150770254453, - 15.485609808293518, - -11.397760090390022, - 50.36123123038939, - -83.05469409695672, - 24.110038122659418, - -28.330545051670825, - -53.749036944957986, - -78.11921866998134, - -83.41683875349166, - -89.72063026731117, - -68.90046001676907, - -71.89803038543928 + 0.342143655338516, + -3.3109650690636583, + -3.696757542725746, + -5.105378072825206, + 5.471040383543361, + -0.06790750193598072, + 2.7373435551676373, + -3.547075850060808, + 5.3392248393586215, + -1.2636781380561768, + -0.9162953518691133, + -9.088432637604779, + -4.016050813135332, + 4.670352907446356, + 7.326991954708756, + 8.294342869341662, + -7.3454139558670795, + -0.9275799995316945, + -1.7085379363808997, + -9.737379277450184, + -1.9747875652397973, + 8.203150154065185, + -7.267597492286808, + -3.5890684093944714 ], "type": "float32" } @@ -104,30 +104,30 @@ "name": "output", "shape": [4, 6], "data": [ - 4.665096282958984, - 353074.40625, - 4.92103607186909e+26, - 15495851933696, - 9.566272773930962e-11, - 537.3943481445312, - 27835916288, - 4.980902673917305e+25, - 3.614401801447914e-32, - 1.2067705660062333e+33, - 3664138167604216000, - 47965678862336, - 5312696, - 0.000011220586202398408, - 7.440557948065475e+21, - 8.507544403157469e-37, - 29570371584, - 4.968216051233487e-13, - 4.54034731570652e-24, - 1.1837368161912076e-34, - 5.922797145303594e-37, - 1.0834951830036632e-39, - 1.1937427251244527e-30, - 5.957731569649706e-32 + 1.4079625606536865, + 0.03648095205426216, + 0.024803820997476578, + 0.006064045242965221, + 237.70733642578125, + 0.9343469142913818, + 15.44589900970459, + 0.02880876138806343, + 208.35113525390625, + 0.2826126217842102, + 0.39999815821647644, + 0.00011296502634650096, + 0.018024004995822906, + 106.73540496826172, + 1520.8004150390625, + 4001.173583984375, + 0.0006455459515564144, + 0.3955096900463104, + 0.18113042414188385, + 0.0000590350573475007, + 0.1387907862663269, + 3652.4365234375, + 0.0006977862794883549, + 0.02762405201792717 ], "type": "float32" } @@ -138,30 +138,30 @@ "x": { "shape": [2, 3, 4], "data": [ - 1.5401084737753479, - 12.774433809954473, - 61.46073034406041, - 30.371593690722648, - -23.07019138708837, - 6.286732075092644, - 24.049592392056553, - 59.17023846672603, - -72.39779325866608, - 76.17325870390891, - 42.745124211838345, - 31.50150770254453, - 15.485609808293518, - -11.397760090390022, - 50.36123123038939, - -83.05469409695672, - 24.110038122659418, - -28.330545051670825, - -53.749036944957986, - -78.11921866998134, - -83.41683875349166, - -89.72063026731117, - -68.90046001676907, - -71.89803038543928 + 0.342143655338516, + -3.3109650690636583, + -3.696757542725746, + -5.105378072825206, + 5.471040383543361, + -0.06790750193598072, + 2.7373435551676373, + -3.547075850060808, + 5.3392248393586215, + -1.2636781380561768, + -0.9162953518691133, + -9.088432637604779, + -4.016050813135332, + 4.670352907446356, + 7.326991954708756, + 8.294342869341662, + -7.3454139558670795, + -0.9275799995316945, + -1.7085379363808997, + -9.737379277450184, + -1.9747875652397973, + 8.203150154065185, + -7.267597492286808, + -3.5890684093944714 ], "type": "float32" } @@ -170,30 +170,30 @@ "name": "output", "shape": [2, 3, 4], "data": [ - 4.665096282958984, - 353074.40625, - 4.92103607186909e+26, - 15495851933696, - 9.566272773930962e-11, - 537.3943481445312, - 27835916288, - 4.980902673917305e+25, - 3.614401801447914e-32, - 1.2067705660062333e+33, - 3664138167604216000, - 47965678862336, - 5312696, - 0.000011220586202398408, - 7.440557948065475e+21, - 8.507544403157469e-37, - 29570371584, - 4.968216051233487e-13, - 4.54034731570652e-24, - 1.1837368161912076e-34, - 5.922797145303594e-37, - 1.0834951830036632e-39, - 1.1937427251244527e-30, - 5.957731569649706e-32 + 1.4079625606536865, + 0.03648095205426216, + 0.024803820997476578, + 0.006064045242965221, + 237.70733642578125, + 0.9343469142913818, + 15.44589900970459, + 0.02880876138806343, + 208.35113525390625, + 0.2826126217842102, + 0.39999815821647644, + 0.00011296502634650096, + 0.018024004995822906, + 106.73540496826172, + 1520.8004150390625, + 4001.173583984375, + 0.0006455459515564144, + 0.3955096900463104, + 0.18113042414188385, + 0.0000590350573475007, + 0.1387907862663269, + 3652.4365234375, + 0.0006977862794883549, + 0.02762405201792717 ], "type": "float32" } @@ -204,30 +204,30 @@ "x": { "shape": [2, 2, 2, 3], "data": [ - 1.5401084737753479, - 12.774433809954473, - 61.46073034406041, - 30.371593690722648, - -23.07019138708837, - 6.286732075092644, - 24.049592392056553, - 59.17023846672603, - -72.39779325866608, - 76.17325870390891, - 42.745124211838345, - 31.50150770254453, - 15.485609808293518, - -11.397760090390022, - 50.36123123038939, - -83.05469409695672, - 24.110038122659418, - -28.330545051670825, - -53.749036944957986, - -78.11921866998134, - -83.41683875349166, - -89.72063026731117, - -68.90046001676907, - -71.89803038543928 + 0.342143655338516, + -3.3109650690636583, + -3.696757542725746, + -5.105378072825206, + 5.471040383543361, + -0.06790750193598072, + 2.7373435551676373, + -3.547075850060808, + 5.3392248393586215, + -1.2636781380561768, + -0.9162953518691133, + -9.088432637604779, + -4.016050813135332, + 4.670352907446356, + 7.326991954708756, + 8.294342869341662, + -7.3454139558670795, + -0.9275799995316945, + -1.7085379363808997, + -9.737379277450184, + -1.9747875652397973, + 8.203150154065185, + -7.267597492286808, + -3.5890684093944714 ], "type": "float32" } @@ -236,30 +236,30 @@ "name": "output", "shape": [2, 2, 2, 3], "data": [ - 4.665096282958984, - 353074.40625, - 4.92103607186909e+26, - 15495851933696, - 9.566272773930962e-11, - 537.3943481445312, - 27835916288, - 4.980902673917305e+25, - 3.614401801447914e-32, - 1.2067705660062333e+33, - 3664138167604216000, - 47965678862336, - 5312696, - 0.000011220586202398408, - 7.440557948065475e+21, - 8.507544403157469e-37, - 29570371584, - 4.968216051233487e-13, - 4.54034731570652e-24, - 1.1837368161912076e-34, - 5.922797145303594e-37, - 1.0834951830036632e-39, - 1.1937427251244527e-30, - 5.957731569649706e-32 + 1.4079625606536865, + 0.03648095205426216, + 0.024803820997476578, + 0.006064045242965221, + 237.70733642578125, + 0.9343469142913818, + 15.44589900970459, + 0.02880876138806343, + 208.35113525390625, + 0.2826126217842102, + 0.39999815821647644, + 0.00011296502634650096, + 0.018024004995822906, + 106.73540496826172, + 1520.8004150390625, + 4001.173583984375, + 0.0006455459515564144, + 0.3955096900463104, + 0.18113042414188385, + 0.0000590350573475007, + 0.1387907862663269, + 3652.4365234375, + 0.0006977862794883549, + 0.02762405201792717 ], "type": "float32" } @@ -270,30 +270,30 @@ "x": { "shape": [2, 1, 4, 1, 3], "data": [ - 1.5401084737753479, - 12.774433809954473, - 61.46073034406041, - 30.371593690722648, - -23.07019138708837, - 6.286732075092644, - 24.049592392056553, - 59.17023846672603, - -72.39779325866608, - 76.17325870390891, - 42.745124211838345, - 31.50150770254453, - 15.485609808293518, - -11.397760090390022, - 50.36123123038939, - -83.05469409695672, - 24.110038122659418, - -28.330545051670825, - -53.749036944957986, - -78.11921866998134, - -83.41683875349166, - -89.72063026731117, - -68.90046001676907, - -71.89803038543928 + 0.342143655338516, + -3.3109650690636583, + -3.696757542725746, + -5.105378072825206, + 5.471040383543361, + -0.06790750193598072, + 2.7373435551676373, + -3.547075850060808, + 5.3392248393586215, + -1.2636781380561768, + -0.9162953518691133, + -9.088432637604779, + -4.016050813135332, + 4.670352907446356, + 7.326991954708756, + 8.294342869341662, + -7.3454139558670795, + -0.9275799995316945, + -1.7085379363808997, + -9.737379277450184, + -1.9747875652397973, + 8.203150154065185, + -7.267597492286808, + -3.5890684093944714 ], "type": "float32" } @@ -302,30 +302,30 @@ "name": "output", "shape": [2, 1, 4, 1, 3], "data": [ - 4.665096282958984, - 353074.40625, - 4.92103607186909e+26, - 15495851933696, - 9.566272773930962e-11, - 537.3943481445312, - 27835916288, - 4.980902673917305e+25, - 3.614401801447914e-32, - 1.2067705660062333e+33, - 3664138167604216000, - 47965678862336, - 5312696, - 0.000011220586202398408, - 7.440557948065475e+21, - 8.507544403157469e-37, - 29570371584, - 4.968216051233487e-13, - 4.54034731570652e-24, - 1.1837368161912076e-34, - 5.922797145303594e-37, - 1.0834951830036632e-39, - 1.1937427251244527e-30, - 5.957731569649706e-32 + 1.4079625606536865, + 0.03648095205426216, + 0.024803820997476578, + 0.006064045242965221, + 237.70733642578125, + 0.9343469142913818, + 15.44589900970459, + 0.02880876138806343, + 208.35113525390625, + 0.2826126217842102, + 0.39999815821647644, + 0.00011296502634650096, + 0.018024004995822906, + 106.73540496826172, + 1520.8004150390625, + 4001.173583984375, + 0.0006455459515564144, + 0.3955096900463104, + 0.18113042414188385, + 0.0000590350573475007, + 0.1387907862663269, + 3652.4365234375, + 0.0006977862794883549, + 0.02762405201792717 ], "type": "float32" } diff --git a/tests/wpt/tests/websockets/opening-handshake/006.html b/tests/wpt/tests/websockets/opening-handshake/006.html new file mode 100644 index 00000000000..304069037cc --- /dev/null +++ b/tests/wpt/tests/websockets/opening-handshake/006.html @@ -0,0 +1,58 @@ +<!doctype html> +<title>WebSockets: Serialized connection attempts</title> +<meta name="timeout" content="long"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="../constants.sub.js"></script> +<meta name="variant" content="?default"> +<meta name="variant" content="?wss"> +<div id="log"></div> +<script> +async_test(function(t) { + const paths = ['/invalid1', '/invalid2', '/invalid3', '/echo']; // /echo is valid + let currentTestIndex = 0; + let isPreviousConnectionClosed = true; + + function testNextPath() { + if (currentTestIndex < paths.length) { + t.step(function() { + assert_true(isPreviousConnectionClosed, "Previous connection should be closed before attempting a new one"); + isPreviousConnectionClosed = false; + + const path = paths[currentTestIndex]; + const ws = new WebSocket(SCHEME_DOMAIN_PORT + path); + + ws.onclose = t.step_func(function(e) { + if (path !== '/echo') { + assert_false(e.wasClean, "Connection should fail uncleanly for path: " + path); + } else { + assert_true(e.wasClean, "Connection to /echo should close cleanly"); + } + isPreviousConnectionClosed = true; + currentTestIndex++; + t.step_timeout(testNextPath, 0); // Schedule the next test + }); + + ws.onopen = t.step_func(function() { + if (path === '/echo') { + assert_true(true, "Connection to /echo should succeed"); + ws.close(); + } else { + t.unreached_func("Invalid path should not succeed"); + } + }); + + ws.onerror = t.step_func(function() { + if (path === '/echo') { + t.unreached_func("Connection to /echo should not encounter an error"); + } // otherwise failure is expected + }); + }); + } else { + t.done(); + } + } + + testNextPath(); +}); +</script> diff --git a/tests/wpt/tests/webvtt/parsing/file-parsing/tests/header-regions.html b/tests/wpt/tests/webvtt/parsing/file-parsing/tests/header-regions.html index b10fcbcef9b..f935cb6a2a7 100644 --- a/tests/wpt/tests/webvtt/parsing/file-parsing/tests/header-regions.html +++ b/tests/wpt/tests/webvtt/parsing/file-parsing/tests/header-regions.html @@ -39,7 +39,7 @@ async_test(function(t) { var testTrack = document.createElement('track'); testTrack.onload = t.step_func_done(function() { var track = testTrack.track; - assert_equals(track.cues.length, 9); + assert_equals(track.cues.length, 10); checkCueRegions(track.cues); }); testTrack.src = 'support/header-regions.vtt'; diff --git a/tests/wpt/tests/webvtt/parsing/file-parsing/tests/support/header-regions.vtt b/tests/wpt/tests/webvtt/parsing/file-parsing/tests/support/header-regions.vtt index 81634c5cdc6..67308835b6c 100644 --- a/tests/wpt/tests/webvtt/parsing/file-parsing/tests/support/header-regions.vtt +++ b/tests/wpt/tests/webvtt/parsing/file-parsing/tests/support/header-regions.vtt @@ -24,6 +24,10 @@ REGION invalid_settings values but region still created : Invalid Header +REGION +id:region_split_by_ascii_whitespace width:10% +lines:5 regionanchor:40%,20% viewportanchor:30%,80% scroll:up + 00:00:00.000 --> 00:00:02.500 region:someregionattributeid "no region" @@ -50,3 +54,6 @@ invalid_settings values but region still created 00:00:07.000 --> 00:00:08.000 region: "no region" + +00:00:08.000 --> 00:00:09.000 region:region_split_by_ascii_whitespace +{"width":10,"lines":5,"regionAnchorX":40,"regionAnchorY":20,"viewportAnchorX":30,"viewportAnchorY":80,"scroll":"up"}