Test passes if the inner popover opens after clicking the inner toggle.
+
+
Inside popover 1
Popover 2
Inside popover 1 after button
-
-
-
Inside popover 2
+
+ Inside popover 2
+
Next control after popover1
-
This test passes if you see the same fraction four times.
+
This test passes if you see the same fraction eight times.
@@ -37,6 +37,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/fractions/frac-linethickness-001.html b/tests/wpt/tests/mathml/presentation-markup/fractions/frac-linethickness-001.html
index 918d4aba6e6..99f75102639 100644
--- a/tests/wpt/tests/mathml/presentation-markup/fractions/frac-linethickness-001.html
+++ b/tests/wpt/tests/mathml/presentation-markup/fractions/frac-linethickness-001.html
@@ -19,7 +19,7 @@
-
This test passes if you see the same fraction four times.
+
This test passes if you see the same fraction eight times.
@@ -40,6 +40,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-2-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-2-ref.html
new file mode 100644
index 00000000000..f442a48dfe6
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-2-ref.html
@@ -0,0 +1,31 @@
+
+
+
+
embellished operators 1: mrow
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-2.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-2.html
new file mode 100644
index 00000000000..f8bfb26d4e9
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-2.html
@@ -0,0 +1,33 @@
+
+
+
+
embellished operators 1: mrow
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-3-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-3-ref.html
new file mode 100644
index 00000000000..e134bfacebc
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-3-ref.html
@@ -0,0 +1,31 @@
+
+
+
+
embellished operators 1: mstyle
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-3.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-3.html
new file mode 100644
index 00000000000..85a21cc50b9
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-3.html
@@ -0,0 +1,33 @@
+
+
+
+
embellished operators 1: mstyle
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-4-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-4-ref.html
new file mode 100644
index 00000000000..149eff4b0d2
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-4-ref.html
@@ -0,0 +1,31 @@
+
+
+
+
embellished operators 1: mpadded
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-4.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-4.html
new file mode 100644
index 00000000000..b6c41256e88
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-4.html
@@ -0,0 +1,33 @@
+
+
+
+
embellished operators 1: mpadded
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-5-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-5-ref.html
new file mode 100644
index 00000000000..cb4342e708d
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-5-ref.html
@@ -0,0 +1,35 @@
+
+
+
+
embellished operators 1: mphantom
+
+
+
+
+
+
+
+
+
+ abcdef
+
+ g
+ ¯
+ h
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-5.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-5.html
new file mode 100644
index 00000000000..1623991c795
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-1-5.html
@@ -0,0 +1,37 @@
+
+
+
+
embellished operators 1: mphantom
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+
+ g
+ ¯
+ h
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-1-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-1-ref.html
new file mode 100644
index 00000000000..faa37e0d989
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-1-ref.html
@@ -0,0 +1,31 @@
+
+
+
+
embellished operators: ignore space-like children
+
+
+
+
+
+
+
+
+
+ abcdef
+ g ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-1.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-1.html
new file mode 100644
index 00000000000..a43f65e00e0
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-1.html
@@ -0,0 +1,33 @@
+
+
+
+
embellished operators: ignore space-like children
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+ g ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-2-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-2-ref.html
new file mode 100644
index 00000000000..903a30cc1f7
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-2-ref.html
@@ -0,0 +1,31 @@
+
+
+
+
embellished operators: ignore space-like children
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯ g
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-2.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-2.html
new file mode 100644
index 00000000000..108353dcb3a
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-2.html
@@ -0,0 +1,33 @@
+
+
+
+
embellished operators: ignore space-like children
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯ g
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-3-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-3-ref.html
new file mode 100644
index 00000000000..c40dff710f1
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-3-ref.html
@@ -0,0 +1,35 @@
+
+
+
+
embellished operators: ignore space-like children
+
+
+
+
+
+
+
+
+
+ abcdef
+
+ g
+ ¯
+ h
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-3.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-3.html
new file mode 100644
index 00000000000..e72cb68be30
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-3.html
@@ -0,0 +1,33 @@
+
+
+
+
embellished operators: ignore space-like children
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+ g ¯ h
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-4-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-4-ref.html
new file mode 100644
index 00000000000..b44f667442c
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-4-ref.html
@@ -0,0 +1,39 @@
+
+
+
+
embellished operators: ignore space-like children
+
+
+
+
+
+
+
+
+
+ abcdef
+
+
+ g
+
+ ¯
+
+
+ h
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-4.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-4.html
new file mode 100644
index 00000000000..7e60d5370b7
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-2-4.html
@@ -0,0 +1,41 @@
+
+
+
+
embellished operators: ignore space-like children
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+
+
+ g
+
+ ¯
+
+
+ h
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-2-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-2-ref.html
new file mode 100644
index 00000000000..2df02cf9a99
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-2-ref.html
@@ -0,0 +1,32 @@
+
+
+
+
embellished operators: maction and mrow-like as space-like children
+
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-2.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-2.html
new file mode 100644
index 00000000000..ff7b1020cbb
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-2.html
@@ -0,0 +1,34 @@
+
+
+
+
embellished operators: maction and mrow-like as space-like children
+
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-3-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-3-ref.html
new file mode 100644
index 00000000000..4615e4de229
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-3-ref.html
@@ -0,0 +1,34 @@
+
+
+
+
embellished operators: maction and mrow-like as space-like children
+
+
+
+
+
+
+
+
+
+
+ abcdef
+
+ ¯
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-3.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-3.html
new file mode 100644
index 00000000000..84dec135cac
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-3.html
@@ -0,0 +1,34 @@
+
+
+
+
embellished operators: maction and mrow-like as space-like children
+
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-4-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-4-ref.html
new file mode 100644
index 00000000000..e02ff28f18d
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-4-ref.html
@@ -0,0 +1,34 @@
+
+
+
+
embellished operators: maction and mrow-like as space-like children
+
+
+
+
+
+
+
+
+
+
+ abcdef
+
+ ¯
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-4.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-4.html
new file mode 100644
index 00000000000..648b0028f46
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-4.html
@@ -0,0 +1,36 @@
+
+
+
+
embellished operators: maction and mrow-like as space-like children
+
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+
+ ¯
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-5-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-5-ref.html
new file mode 100644
index 00000000000..c2c85f931c9
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-5-ref.html
@@ -0,0 +1,34 @@
+
+
+
+
embellished operators: maction and mrow-like as space-like children
+
+
+
+
+
+
+
+
+
+
+ abcdef
+
+ ¯
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-5.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-5.html
new file mode 100644
index 00000000000..b6d032a589d
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-3-5.html
@@ -0,0 +1,34 @@
+
+
+
+
embellished operators: maction and mrow-like as space-like children
+
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-1-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-1-ref.html
new file mode 100644
index 00000000000..bcf58699ea7
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-1-ref.html
@@ -0,0 +1,34 @@
+
+
+
+
embellished operators 4-1: some non-space-like children
+
+
+
+
+
+
+
+
+
+ abcdef
+
+ ¯
+ ¯
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-1.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-1.html
new file mode 100644
index 00000000000..724d39ceab0
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-1.html
@@ -0,0 +1,33 @@
+
+
+
+
embellished operators 4-1: some non-space-like children
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯ ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-2-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-2-ref.html
new file mode 100644
index 00000000000..b226d69a97b
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-2-ref.html
@@ -0,0 +1,31 @@
+
+
+
+
embellished operators 4-2: some non-space-like children
+
+
+
+
+
+
+
+
+
+ abcdef
+ g ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-2.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-2.html
new file mode 100644
index 00000000000..1a3724cb9d4
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-2.html
@@ -0,0 +1,33 @@
+
+
+
+
embellished operators 4-2: some non-space-like children
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+ g ¯
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-3-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-3-ref.html
new file mode 100644
index 00000000000..8786076642e
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-3-ref.html
@@ -0,0 +1,31 @@
+
+
+
+
embellished operators 4-3: some non-space-like children
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯ g
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-3.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-3.html
new file mode 100644
index 00000000000..1be87b81dd2
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-4-3.html
@@ -0,0 +1,33 @@
+
+
+
+
embellished operators 4-3: some non-space-like children
+
+
+
+
+
+
+
+
+
+
+
+ abcdef
+ ¯ g
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-5-1.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-5-1.html
new file mode 100644
index 00000000000..946bda0dc71
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-5-1.html
@@ -0,0 +1,37 @@
+
+
+
+
embellished operators 5: vertical stretchy operator
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-5-2.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-5-2.html
new file mode 100644
index 00000000000..95bd2694a50
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-5-2.html
@@ -0,0 +1,35 @@
+
+
+
+
embellished operators 5: vertical stretchy operator
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-5-ref.html b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-5-ref.html
new file mode 100644
index 00000000000..da9d2387757
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/embellished-op-5-ref.html
@@ -0,0 +1,30 @@
+
+
+
+
embellished operators 5: vertical stretchy operator
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/mo-dynamic-mozilla-347348-ref.xhtml b/tests/wpt/tests/mathml/presentation-markup/operators/mo-dynamic-mozilla-347348-ref.xhtml
new file mode 100644
index 00000000000..0deb51d5f23
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/mo-dynamic-mozilla-347348-ref.xhtml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+ x
+
+ y
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/mo-dynamic-mozilla-347348.xhtml b/tests/wpt/tests/mathml/presentation-markup/operators/mo-dynamic-mozilla-347348.xhtml
new file mode 100644
index 00000000000..a8471e116a5
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/operators/mo-dynamic-mozilla-347348.xhtml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ x
+ =
+ y
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-1-ref.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-1-ref.html
new file mode 100644
index 00000000000..96cba038a4d
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-1-ref.html
@@ -0,0 +1,36 @@
+
+
+
+
Stretchy mover
+
+
+
+
+
+
+
+
+ →
+ BBBBBBBBB
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-1a.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-1a.html
new file mode 100644
index 00000000000..8a87c2387f9
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-1a.html
@@ -0,0 +1,44 @@
+
+
+
+
Stretchy mover
+
+
+
+
+
+
+
+
+
+
+
+
+
+ →
+ BBBBBBBBB
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-1b.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-1b.html
new file mode 100644
index 00000000000..da351235135
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-1b.html
@@ -0,0 +1,44 @@
+
+
+
+
Stretchy mover
+
+
+
+
+
+
+
+
+
+
+
+
+
+ →
+ BBBBBBBBB
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-2-ref.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-2-ref.html
new file mode 100644
index 00000000000..e9b24785d3f
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-2-ref.html
@@ -0,0 +1,32 @@
+
+
+
+
Stretchy mover
+
+
+
+
+
+
+
+
+
+ ↑
+ B
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-2a.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-2a.html
new file mode 100644
index 00000000000..87738363cd3
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-2a.html
@@ -0,0 +1,36 @@
+
+
+
+
Stretchy mover
+
+
+
+
+
+
+
+
+
+
+
+
+ ↑
+ B
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-2b.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-2b.html
new file mode 100644
index 00000000000..6f44ffe17da
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-2b.html
@@ -0,0 +1,36 @@
+
+
+
+
Stretchy mover
+
+
+
+
+
+
+
+
+
+
+
+
+ ↑
+ B
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-3-ref.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-3-ref.html
new file mode 100644
index 00000000000..10e0779b98b
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-3-ref.html
@@ -0,0 +1,28 @@
+
+
+
+
Stretchy mover
+
+
+
+
+
+
+
+ ‖
+ BBBBBBBBB
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-3.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-3.html
new file mode 100644
index 00000000000..9becf31d14c
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-mover-3.html
@@ -0,0 +1,30 @@
+
+
+
+
Stretchy mover
+
+
+
+
+
+
+
+
+
+ ‖
+ BBBBBBBBB
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1-ref.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1-ref.html
new file mode 100644
index 00000000000..7b6b6d72adc
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1-ref.html
@@ -0,0 +1,28 @@
+
+
+
+
Non-stretchy msup
+
+
+
+
+
+
+
+ →
+ AAAAAA
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1a.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1a.html
new file mode 100644
index 00000000000..1abf64aad6e
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1a.html
@@ -0,0 +1,30 @@
+
+
+
+
Non-stretchy msup
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1b.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1b.html
new file mode 100644
index 00000000000..c6e0a8aaabc
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1b.html
@@ -0,0 +1,32 @@
+
+
+
+
Non-stretchy msup
+
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1c.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1c.html
new file mode 100644
index 00000000000..056000566ac
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1c.html
@@ -0,0 +1,34 @@
+
+
+
+
Non-stretchy msup
+
+
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1d.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1d.html
new file mode 100644
index 00000000000..a1ac5772f25
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-msup-1d.html
@@ -0,0 +1,33 @@
+
+
+
+
Non-stretchy msup
+
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1-ref.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1-ref.html
new file mode 100644
index 00000000000..587d37163db
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1-ref.html
@@ -0,0 +1,31 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+ BBBBBB
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1a.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1a.html
new file mode 100644
index 00000000000..0dfd5ad40bb
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1a.html
@@ -0,0 +1,33 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+ BBBBBB
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1b.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1b.html
new file mode 100644
index 00000000000..f4a2c67c58a
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1b.html
@@ -0,0 +1,35 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+ BBBBBB
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1c.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1c.html
new file mode 100644
index 00000000000..6430545794a
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1c.html
@@ -0,0 +1,31 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+ BBBBBB
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1d.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1d.html
new file mode 100644
index 00000000000..d2345c5f144
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1d.html
@@ -0,0 +1,34 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+ BBBBBB
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1e.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1e.html
new file mode 100644
index 00000000000..ba959a58790
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-1e.html
@@ -0,0 +1,34 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+ BBBBBB
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2-ref.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2-ref.html
new file mode 100644
index 00000000000..f43f659240d
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2-ref.html
@@ -0,0 +1,34 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+ BBBBBB
+
+ CCCCCC
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2a.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2a.html
new file mode 100644
index 00000000000..54aea8d7c9a
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2a.html
@@ -0,0 +1,36 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+ BBBBBB
+
+ CCCCCC
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2b.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2b.html
new file mode 100644
index 00000000000..6420f01dd7a
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2b.html
@@ -0,0 +1,38 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+ BBBBBB
+
+ CCCCCC
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2c.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2c.html
new file mode 100644
index 00000000000..3a77e78078a
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2c.html
@@ -0,0 +1,34 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+ BBBBBB
+
+ CCCCCC
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2d.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2d.html
new file mode 100644
index 00000000000..30a7ca2e728
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2d.html
@@ -0,0 +1,36 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+ BBBBBB
+
+ CCCCCC
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2e.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2e.html
new file mode 100644
index 00000000000..199c101b6ae
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2e.html
@@ -0,0 +1,36 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+ BBBBBB
+
+
+ CCCCCC
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2f.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2f.html
new file mode 100644
index 00000000000..5b736fda0a8
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2f.html
@@ -0,0 +1,38 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+ BBBBBB
+
+
+
+ CCCCCC
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2g.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2g.html
new file mode 100644
index 00000000000..11cca42de14
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-2g.html
@@ -0,0 +1,37 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+
+
+ →
+ AAAAAA
+ BBBBBB
+
+ CCCCCC
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3-ref.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3-ref.html
new file mode 100644
index 00000000000..67b3492ec86
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3-ref.html
@@ -0,0 +1,31 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+ AAAAAA
+ →
+ BBBBBB
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3a.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3a.html
new file mode 100644
index 00000000000..dd41c82def5
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3a.html
@@ -0,0 +1,33 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+
+ AAAAAA
+ →
+ BBBBBB
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3b.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3b.html
new file mode 100644
index 00000000000..b4619bfef90
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3b.html
@@ -0,0 +1,31 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+ AAAAAA
+ →
+ BBBBBB
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3c.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3c.html
new file mode 100644
index 00000000000..004349f8319
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3c.html
@@ -0,0 +1,34 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+
+ AAAAAA
+ →
+ BBBBBB
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3d.html b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3d.html
new file mode 100644
index 00000000000..e5cf01f23e1
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/stretchy-munderover-3d.html
@@ -0,0 +1,31 @@
+
+
+
+
Stretchy munderover
+
+
+
+
+
+
+
+
+
+ AAAAAA
+ →
+ BBBBBB
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/sub-vs-sup-mozilla-345563-ref.xhtml b/tests/wpt/tests/mathml/presentation-markup/scripts/sub-vs-sup-mozilla-345563-ref.xhtml
new file mode 100644
index 00000000000..dc57aa35066
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/sub-vs-sup-mozilla-345563-ref.xhtml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ x
+ 2
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/sub-vs-sup-mozilla-345563.xhtml b/tests/wpt/tests/mathml/presentation-markup/scripts/sub-vs-sup-mozilla-345563.xhtml
new file mode 100644
index 00000000000..5c8d78952f0
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/scripts/sub-vs-sup-mozilla-345563.xhtml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ x
+ 2
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/tables/dynamic-rowspan-mozilla-370692-ref.xhtml b/tests/wpt/tests/mathml/presentation-markup/tables/dynamic-rowspan-mozilla-370692-ref.xhtml
new file mode 100644
index 00000000000..2e01559d274
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/tables/dynamic-rowspan-mozilla-370692-ref.xhtml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/tables/dynamic-rowspan-mozilla-370692.xhtml b/tests/wpt/tests/mathml/presentation-markup/tables/dynamic-rowspan-mozilla-370692.xhtml
new file mode 100644
index 00000000000..e16326b1aa9
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/tables/dynamic-rowspan-mozilla-370692.xhtml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/tokens/dynamic-mi-mozilla-409125-ref.xhtml b/tests/wpt/tests/mathml/presentation-markup/tokens/dynamic-mi-mozilla-409125-ref.xhtml
new file mode 100644
index 00000000000..04d9eeba310
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/tokens/dynamic-mi-mozilla-409125-ref.xhtml
@@ -0,0 +1,11 @@
+
+
+
Mozilla bug 409125
+
+
+
+
+
mi
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/tokens/dynamic-mi-mozilla-409125.xhtml b/tests/wpt/tests/mathml/presentation-markup/tokens/dynamic-mi-mozilla-409125.xhtml
new file mode 100644
index 00000000000..35b9951dcbc
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/tokens/dynamic-mi-mozilla-409125.xhtml
@@ -0,0 +1,15 @@
+
+
+
Mozilla bug 409125
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/tokens/dynamic-mi-mozilla-414123-ref.xhtml b/tests/wpt/tests/mathml/presentation-markup/tokens/dynamic-mi-mozilla-414123-ref.xhtml
new file mode 100644
index 00000000000..7ec9cb751cb
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/tokens/dynamic-mi-mozilla-414123-ref.xhtml
@@ -0,0 +1,32 @@
+
+
+
+
+
Testcase for bug 414123
+
+
+
+
+
+ M
+ 2
+
+
+
+
+
+ M
+ 2
+
+
+
+
+
+ M
+ 2
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/tokens/dynamic-mi-mozilla-414123.xhtml b/tests/wpt/tests/mathml/presentation-markup/tokens/dynamic-mi-mozilla-414123.xhtml
new file mode 100644
index 00000000000..b2d7e2d1667
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/tokens/dynamic-mi-mozilla-414123.xhtml
@@ -0,0 +1,45 @@
+
+
+
+
+
Testcase for Mozilla bug 414123
+
+
+
+
+
+
+
+
+
+ 2
+
+
+
+
+
+ M
+ 2
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/tokens/mi-mathvariant-1-ref.xhtml b/tests/wpt/tests/mathml/presentation-markup/tokens/mi-mathvariant-1-ref.xhtml
new file mode 100644
index 00000000000..ec3bb1a83e0
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/tokens/mi-mathvariant-1-ref.xhtml
@@ -0,0 +1,9 @@
+
+
+
+ cos
+
+ x
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/tokens/mi-mathvariant-1.xhtml b/tests/wpt/tests/mathml/presentation-markup/tokens/mi-mathvariant-1.xhtml
new file mode 100644
index 00000000000..04fe19194ee
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/tokens/mi-mathvariant-1.xhtml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+ cos
+
+ x
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/tokens/mi-mathvariant-2-ref.xhtml b/tests/wpt/tests/mathml/presentation-markup/tokens/mi-mathvariant-2-ref.xhtml
new file mode 100644
index 00000000000..35e6bf6ecd2
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/tokens/mi-mathvariant-2-ref.xhtml
@@ -0,0 +1,14 @@
+
+
+
+
+ ∞
+
+ ℎ
+
+
+
diff --git a/tests/wpt/tests/mathml/presentation-markup/tokens/mi-mathvariant-2.xhtml b/tests/wpt/tests/mathml/presentation-markup/tokens/mi-mathvariant-2.xhtml
new file mode 100644
index 00000000000..e83a24c5d34
--- /dev/null
+++ b/tests/wpt/tests/mathml/presentation-markup/tokens/mi-mathvariant-2.xhtml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+ ∞
+ ℎ
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/css-styling/mozilla-393760-1-ref.xml b/tests/wpt/tests/mathml/relations/css-styling/mozilla-393760-1-ref.xml
new file mode 100644
index 00000000000..027bdf1b7d9
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/css-styling/mozilla-393760-1-ref.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+ X
+ X
+ X
+
+
+
+
+ X
+ X
+ X
+
+
+
+
Y
+
Y
+
+
+
x
+
x
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/css-styling/mozilla-393760-1.xml b/tests/wpt/tests/mathml/relations/css-styling/mozilla-393760-1.xml
new file mode 100644
index 00000000000..cc2e725f92a
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/css-styling/mozilla-393760-1.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+ X
+ X
+ X
+
+
+
+
+ X
+ X
+ X
+
+
+
+
Y
+
Y
+
+
+
x
+
x
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/css-styling/mozilla-393760-2-ref.xml b/tests/wpt/tests/mathml/relations/css-styling/mozilla-393760-2-ref.xml
new file mode 100644
index 00000000000..58dd5a5d8c3
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/css-styling/mozilla-393760-2-ref.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/css-styling/mozilla-393760-2.xml b/tests/wpt/tests/mathml/relations/css-styling/mozilla-393760-2.xml
new file mode 100644
index 00000000000..c6ebcb5ecee
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/css-styling/mozilla-393760-2.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
This should be invisible.
+
+
+
x
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/css-styling/table-width-1-ref.xhtml b/tests/wpt/tests/mathml/relations/css-styling/table-width-1-ref.xhtml
new file mode 100644
index 00000000000..d76a350290d
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/css-styling/table-width-1-ref.xhtml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+ 60
+
+
+ 2
+ +
+ 3
+ -
+ 5
+
+
+
+
+
+
+
+
+
+
+
+ 8
+ 90
+
+ 61
+
+
+
+
+
+
+
+
+
+ |
+ {
+
+ 0
+ 5
+ 9
+
+ }
+ |
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/css-styling/table-width-1.xhtml b/tests/wpt/tests/mathml/relations/css-styling/table-width-1.xhtml
new file mode 100644
index 00000000000..c3689adb6f2
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/css-styling/table-width-1.xhtml
@@ -0,0 +1,66 @@
+
+
+
Check that the content box is large enough
+
+
+
+
+
+
+
+
+
+ 60
+
+
+ 2
+ +
+ 3
+ -
+ 5
+
+
+
+
+
+
+
+
+
+
+ 8
+ 90
+
+ 61
+
+
+
+
+
+
+
+
+ |
+ {
+
+ 0
+ 5
+ 9
+
+ }
+ |
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/css-styling/table-width-2-ref.html b/tests/wpt/tests/mathml/relations/css-styling/table-width-2-ref.html
new file mode 100644
index 00000000000..dfb9eeca8b7
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/css-styling/table-width-2-ref.html
@@ -0,0 +1,34 @@
+
+
+
+
table-width-2
+
+
+
+
+
+
+
+
+ |
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+ |
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/css-styling/table-width-2.html b/tests/wpt/tests/mathml/relations/css-styling/table-width-2.html
new file mode 100644
index 00000000000..533a9324b4e
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/css-styling/table-width-2.html
@@ -0,0 +1,36 @@
+
+
+
+
table-width-2
+
+
+
+
+
+
+
+
+
+
+ |
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+ |
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/css-styling/table-width-3-ref.html b/tests/wpt/tests/mathml/relations/css-styling/table-width-3-ref.html
new file mode 100644
index 00000000000..f06cea4bec0
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/css-styling/table-width-3-ref.html
@@ -0,0 +1,92 @@
+
+
+
+
table-width-3
+
+
+
+
+
+
+
+
+
+
+
+ f
+ f
+ f
+
+
+
+
+
+
+
+
+
+
+
+
+ f
+ f
+ f
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/css-styling/table-width-3.html b/tests/wpt/tests/mathml/relations/css-styling/table-width-3.html
new file mode 100644
index 00000000000..4847ce43045
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/css-styling/table-width-3.html
@@ -0,0 +1,83 @@
+
+
+
+
table-width-3
+
+
+
+
+
+
+
+
+
+
+
+
+ f
+ f
+ f
+
+
+
+
+
+
+
+
+
+
+ f
+ f
+ f
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/css-styling/table-width-4-ref.html b/tests/wpt/tests/mathml/relations/css-styling/table-width-4-ref.html
new file mode 100644
index 00000000000..b31807dee4d
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/css-styling/table-width-4-ref.html
@@ -0,0 +1,41 @@
+
+
+
+
table-width-4
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/css-styling/table-width-4.html b/tests/wpt/tests/mathml/relations/css-styling/table-width-4.html
new file mode 100644
index 00000000000..4a88b84cb2a
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/css-styling/table-width-4.html
@@ -0,0 +1,43 @@
+
+
+
+
table-width-4
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/html5-tree/dynamic-mozilla-162063.xhtml b/tests/wpt/tests/mathml/relations/html5-tree/dynamic-mozilla-162063.xhtml
new file mode 100644
index 00000000000..73bb25fd6f6
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/html5-tree/dynamic-mozilla-162063.xhtml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
test for pseudo removal
+
+
+
+
+
+
+
+
+ a
+ +
+ b
+
+
+ 2
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/html5-tree/shadow-dom-mozilla-1066554-ref.html b/tests/wpt/tests/mathml/relations/html5-tree/shadow-dom-mozilla-1066554-ref.html
new file mode 100644
index 00000000000..f885eaec428
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/html5-tree/shadow-dom-mozilla-1066554-ref.html
@@ -0,0 +1,13 @@
+
+
+
+
Test for Mozilla bug 1066554 - Shadow DOM loads MathML stylesheets as needed
+
+
+
+ X
+ X
+
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/html5-tree/shadow-dom-mozilla-1066554.html b/tests/wpt/tests/mathml/relations/html5-tree/shadow-dom-mozilla-1066554.html
new file mode 100644
index 00000000000..563ceb29e50
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/html5-tree/shadow-dom-mozilla-1066554.html
@@ -0,0 +1,19 @@
+
+
+
+
Test for Mozilla bug 1066554 - Shadow DOM loads MathML stylesheets as needed
+
+
+
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/text-and-math/mi-automatic-italic-with-default-font-ref.html b/tests/wpt/tests/mathml/relations/text-and-math/mi-automatic-italic-with-default-font-ref.html
new file mode 100644
index 00000000000..27a58b9ba00
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/text-and-math/mi-automatic-italic-with-default-font-ref.html
@@ -0,0 +1,12 @@
+
+
+
+
Mathematica Alphanumeric Italic
+
+
+
+
+
X
+
+
+
diff --git a/tests/wpt/tests/mathml/relations/text-and-math/mi-automatic-italic-with-default-font.html b/tests/wpt/tests/mathml/relations/text-and-math/mi-automatic-italic-with-default-font.html
new file mode 100644
index 00000000000..50199214107
--- /dev/null
+++ b/tests/wpt/tests/mathml/relations/text-and-math/mi-automatic-italic-with-default-font.html
@@ -0,0 +1,17 @@
+
+
+
+
Mathematica Alphanumeric Italic with default font
+
+
+
+
+
+
+
+
+
o
+
+
+
diff --git a/tests/wpt/tests/preload/preload-nonce.sub.html b/tests/wpt/tests/preload/preload-nonce.sub.html
new file mode 100644
index 00000000000..325c8a2e824
--- /dev/null
+++ b/tests/wpt/tests/preload/preload-nonce.sub.html
@@ -0,0 +1,47 @@
+
+
+
Makes sure that preload requests use their nonce for the CSP
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/resources/testdriver.js b/tests/wpt/tests/resources/testdriver.js
index a9ab7220aad..a23d6eaf4cf 100644
--- a/tests/wpt/tests/resources/testdriver.js
+++ b/tests/wpt/tests/resources/testdriver.js
@@ -328,9 +328,9 @@
* to run the call, or null for the current
* browsing context.
*
- * @returns {Promise} fulfilled with the previous {@link
- * https://www.w3.org/TR/webdriver/#dfn-windowrect-object|WindowRect}
- * value, after the window is minimized.
+ * @returns {Promise} fulfilled with the previous `WindowRect
+ *
`_
+ * value, after the window is minimized.
*/
minimize_window: function(context=null) {
return window.test_driver_internal.minimize_window(context);
@@ -343,8 +343,8 @@
* `_
* WebDriver command
*
- * @param {Object} rect - A {@link
- * https://www.w3.org/TR/webdriver/#dfn-windowrect-object|WindowRect}
+ * @param {Object} rect - A `WindowRect
+ * `_
* @param {WindowProxy} context - Browsing context in which
* to run the call, or null for the current
* browsing context.
diff --git a/tests/wpt/tests/scroll-animations/view-timelines/unattached-subject-inset.html b/tests/wpt/tests/scroll-animations/view-timelines/unattached-subject-inset.html
new file mode 100644
index 00000000000..86262db8f88
--- /dev/null
+++ b/tests/wpt/tests/scroll-animations/view-timelines/unattached-subject-inset.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+ Test construction of a view timeline with a detached subject
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/service-workers/service-worker/tentative/static-router/resources/static-router-sw.js b/tests/wpt/tests/service-workers/service-worker/tentative/static-router/resources/static-router-sw.js
index e698d34c527..4655ab5321c 100644
--- a/tests/wpt/tests/service-workers/service-worker/tentative/static-router/resources/static-router-sw.js
+++ b/tests/wpt/tests/service-workers/service-worker/tentative/static-router/resources/static-router-sw.js
@@ -4,11 +4,17 @@ var requests = [];
self.addEventListener('install', e => {
e.registerRouter([
- {condition: {urlPattern: '*.txt'}, source: 'network'}, {
- condition: {urlPattern: '*/simple-test-for-condition-main-resource.html'},
+ {
+ condition: {urlPattern: '/**/*.txt??*'},
+ // Note: "??*" is for allowing arbitrary query strings.
+ // Upon my experiment, the URLPattern needs two '?'s for specifying
+ // a coming string as a query.
source: 'network'
- }
- ]);
+ }, {
+ condition: {
+ urlPattern: '/**/simple-test-for-condition-main-resource.html'},
+ source: 'network'
+ }]);
self.skipWaiting();
});
diff --git a/tests/wpt/tests/svg/animations/custom-events.html b/tests/wpt/tests/svg/animations/custom-events.html
new file mode 100644
index 00000000000..1c49106b510
--- /dev/null
+++ b/tests/wpt/tests/svg/animations/custom-events.html
@@ -0,0 +1,75 @@
+
+Custom events with the names "end" and "endEvent" and their effects on various types of event listeners
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/svg/animations/event-listeners.html b/tests/wpt/tests/svg/animations/event-listeners.html
new file mode 100644
index 00000000000..ca2b9b72f5b
--- /dev/null
+++ b/tests/wpt/tests/svg/animations/event-listeners.html
@@ -0,0 +1,62 @@
+
+Event handling of endEvent with various types of event listeners
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/svg/linking/scripted/href-animate-element.html b/tests/wpt/tests/svg/linking/scripted/href-animate-element.html
index f0b99209a80..5220495d796 100644
--- a/tests/wpt/tests/svg/linking/scripted/href-animate-element.html
+++ b/tests/wpt/tests/svg/linking/scripted/href-animate-element.html
@@ -29,7 +29,7 @@ promise_test(function(t) {
animate.setAttributeNS(XLINKNS, 'xlink:href', '#rect2');
assert_equals(animate.targetElement, rect1);
- return waitEvent(animate, 'begin').then(function() {
+ return waitEvent(animate, 'beginEvent').then(function() {
svg.pauseAnimations();
svg.setCurrentTime(5);
assert_equals(rect1.x.animVal.value, 50);
@@ -58,7 +58,7 @@ promise_test(function(t) {
transform.setAttributeNS(XLINKNS, 'xlink:href', '#rect2');
assert_equals(transform.targetElement, rect1);
- return waitEvent(transform, 'begin').then(function() {
+ return waitEvent(transform, 'beginEvent').then(function() {
svg.pauseAnimations();
svg.setCurrentTime(5);
assert_equals(rect1.getCTM().e, 50);
@@ -87,7 +87,7 @@ promise_test(function(t) {
animate.setAttributeNS(XLINKNS, 'xlink:href', '#circle2');
assert_equals(animate.targetElement, circle1);
- return waitEvent(animate, 'begin').then(function() {
+ return waitEvent(animate, 'beginEvent').then(function() {
svg.pauseAnimations();
svg.setCurrentTime(5);
assert_equals(circle1.cx.animVal.value, 100);
@@ -121,7 +121,7 @@ promise_test(function(t) {
animate.setAttributeNS(XLINKNS, 'xlink:href', '#circle2');
assert_equals(animate.targetElement, circle1);
- return waitEvent(animate, 'begin').then(function() {
+ return waitEvent(animate, 'beginEvent').then(function() {
svg.pauseAnimations();
svg.setCurrentTime(5);
assert_equals(circle1.cx.animVal.value, 100);
diff --git a/tests/wpt/tests/svg/linking/scripted/href-mpath-element.html b/tests/wpt/tests/svg/linking/scripted/href-mpath-element.html
index 8fb9f0f1aed..03949b4168c 100644
--- a/tests/wpt/tests/svg/linking/scripted/href-mpath-element.html
+++ b/tests/wpt/tests/svg/linking/scripted/href-mpath-element.html
@@ -25,7 +25,7 @@ promise_test(function(t) {
mpath.setAttributeNS(XLINKNS, 'xlink:href', '#MyPath2');
assert_equals(mpath.href.baseVal, '#MyPath1');
- return waitEvent(animateMotion, 'begin').then(function() {
+ return waitEvent(animateMotion, 'beginEvent').then(function() {
svg.pauseAnimations();
svg.setCurrentTime(1);
var ctm = rect.getCTM();
@@ -53,7 +53,7 @@ promise_test(function(t) {
mpath.setAttribute('href', '#MyPath1');
mpath.setAttributeNS(XLINKNS, 'xlink:href', '#MyPath2');
- return waitEvent(animateMotion, 'begin').then(function() {
+ return waitEvent(animateMotion, 'beginEvent').then(function() {
svg.pauseAnimations();
svg.setCurrentTime(5);
var ctm = rect.getCTM();
@@ -83,7 +83,7 @@ promise_test(function(t) {
mpath.setAttribute('href', '#MyPath1');
mpath.setAttributeNS(XLINKNS, 'xlink:href', '#MyPath2');
- return waitEvent(animateMotion, 'begin').then(function() {
+ return waitEvent(animateMotion, 'beginEvent').then(function() {
svg.pauseAnimations();
svg.setCurrentTime(5);
var ctm = rect.getCTM();
diff --git a/tests/wpt/tests/tools/ci/requirements_build.txt b/tests/wpt/tests/tools/ci/requirements_build.txt
index 2b7e1808552..e0443762c3c 100644
--- a/tests/wpt/tests/tools/ci/requirements_build.txt
+++ b/tests/wpt/tests/tools/ci/requirements_build.txt
@@ -1,4 +1,4 @@
-cairocffi==1.5.1
+cairocffi==1.6.1
fonttools==4.39.4
genshi==0.7.7
jinja2==3.1.2
diff --git a/tests/wpt/tests/tools/ci/requirements_tc.txt b/tests/wpt/tests/tools/ci/requirements_tc.txt
index e577a83fe39..bb9b3f7232d 100644
--- a/tests/wpt/tests/tools/ci/requirements_tc.txt
+++ b/tests/wpt/tests/tools/ci/requirements_tc.txt
@@ -1,4 +1,4 @@
-pygithub==1.58.2
+pygithub==1.59.1
pyyaml==6.0.1
requests==2.31.0
taskcluster==54.4.1
diff --git a/tests/wpt/tests/tools/localpaths.py b/tests/wpt/tests/tools/localpaths.py
index e8095ac69d5..5a2d0be00de 100644
--- a/tests/wpt/tests/tools/localpaths.py
+++ b/tests/wpt/tests/tools/localpaths.py
@@ -9,7 +9,6 @@ sys.path.insert(0, os.path.join(here, "wptserve"))
sys.path.insert(0, os.path.join(here, "third_party", "pywebsocket3"))
sys.path.insert(0, os.path.join(here, "third_party", "atomicwrites"))
sys.path.insert(0, os.path.join(here, "third_party", "attrs", "src"))
-sys.path.insert(0, os.path.join(here, "third_party", "funcsigs"))
sys.path.insert(0, os.path.join(here, "third_party", "html5lib"))
sys.path.insert(0, os.path.join(here, "third_party", "zipp"))
sys.path.insert(0, os.path.join(here, "third_party", "more-itertools"))
diff --git a/tests/wpt/tests/tools/requirements_flake8.txt b/tests/wpt/tests/tools/requirements_flake8.txt
index 949ae954845..fc1f92a69f7 100644
--- a/tests/wpt/tests/tools/requirements_flake8.txt
+++ b/tests/wpt/tests/tools/requirements_flake8.txt
@@ -1,7 +1,7 @@
flake8==5.0.4; python_version < '3.9'
pycodestyle==2.9.1; python_version < '3.8'
pyflakes==2.5.0; python_version < '3.8'
-flake8==6.0.0; python_version >= '3.9'
-pycodestyle==2.10.0; python_version >= '3.9'
-pyflakes==3.0.1; python_version >= '3.9'
+flake8==6.1.0; python_version >= '3.9'
+pycodestyle==2.11.0; python_version >= '3.9'
+pyflakes==3.1.0; python_version >= '3.9'
pep8-naming==0.13.3
diff --git a/tests/wpt/tests/tools/requirements_mypy.txt b/tests/wpt/tests/tools/requirements_mypy.txt
index 41ab1211b23..45261d0321f 100644
--- a/tests/wpt/tests/tools/requirements_mypy.txt
+++ b/tests/wpt/tests/tools/requirements_mypy.txt
@@ -2,7 +2,7 @@ mypy==1.4.1
mypy-extensions==1.0.0
toml==0.10.2
tomli==2.0.1
-typed-ast==1.5.4
+typed-ast==1.5.5
types-atomicwrites==1.4.5.1
types-python-dateutil==2.8.19.14
types-PyYAML==6.0.12.11
diff --git a/tests/wpt/tests/tools/requirements_tests.txt b/tests/wpt/tests/tools/requirements_tests.txt
index 8225875c8e5..01b56839989 100644
--- a/tests/wpt/tests/tools/requirements_tests.txt
+++ b/tests/wpt/tests/tools/requirements_tests.txt
@@ -1,5 +1,5 @@
httpx[http2]==0.24.1
-json-e==4.5.2
+json-e==4.5.3
jsonschema==4.17.3
pyyaml==6.0.1
taskcluster==54.4.1
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/.coveragerc b/tests/wpt/tests/tools/third_party/funcsigs/.coveragerc
deleted file mode 100644
index d83bfc220b1..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/.coveragerc
+++ /dev/null
@@ -1,6 +0,0 @@
-[run]
-source=funcsigs
-omit=funcsigs/odict*
-
-[report]
-include=funcsigs*
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/.gitignore b/tests/wpt/tests/tools/third_party/funcsigs/.gitignore
deleted file mode 100644
index c8d2af85d3c..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/.gitignore
+++ /dev/null
@@ -1,19 +0,0 @@
-*~
-*.egg
-*.egg-info
-*.pyc
-*.pyo
-*.swp
-.DS_Store
-.coverage
-.tox/
-MANIFEST
-build/
-docs/.build/
-dist/
-env*/
-htmlcov/
-tmp/
-coverage.xml
-junit.xml
-.eggs/
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/.travis.yml b/tests/wpt/tests/tools/third_party/funcsigs/.travis.yml
deleted file mode 100644
index c1e7abe0b44..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/.travis.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-language: python
-python:
- - 2.6
- - 2.7
- - 3.3
- - 3.4
- - 3.5
- - nightly
- - pypy
-# - pypy3
-install:
- - pip install -U pip setuptools wheel
- - pip install -r requirements/development.txt .
-script:
- - coverage run setup.py test
- - coverage report --show-missing
-after_success:
- - coveralls
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/CHANGELOG b/tests/wpt/tests/tools/third_party/funcsigs/CHANGELOG
deleted file mode 100644
index e1366d2668d..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/CHANGELOG
+++ /dev/null
@@ -1,24 +0,0 @@
-Changelog
----------
-
-0.5
-```
-
-* Fix binding with self as a kwarg. (Robert Collins #14)
-
-0.4 (2013-12-20)
-````````````````
-* Fix unbound methods getting their first parameter curried
-* Publish Python wheel packages
-
-0.3 (2013-05-29)
-````````````````
-* Fix annotation formatting of builtin types on Python 2.x
-
-0.2 (2012-01-07)
-````````````````
-* PyPy compatability
-
-0.1 (2012-01-06)
-````````````````
-* Initial release
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/LICENSE b/tests/wpt/tests/tools/third_party/funcsigs/LICENSE
deleted file mode 100644
index 3e563d6fbd4..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/LICENSE
+++ /dev/null
@@ -1,13 +0,0 @@
-Copyright 2013 Aaron Iles
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/MANIFEST.in b/tests/wpt/tests/tools/third_party/funcsigs/MANIFEST.in
deleted file mode 100644
index f0abb42f04a..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/MANIFEST.in
+++ /dev/null
@@ -1,7 +0,0 @@
-recursive-include docs *
-recursive-include tests *.py
-include *.py
-include CHANGELOG
-include LICENSE
-include MANIFEST.in
-include README.rst
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/Makefile b/tests/wpt/tests/tools/third_party/funcsigs/Makefile
deleted file mode 100644
index e2329231b56..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-SHELL := /bin/bash
-
-deps:
- pip install --upgrade \
- -r requirements/development.txt \
- -r requirements/production.txt
-
-sdist:
- python setup.py sdist
- python setup.py bdist_wheel
-
-register:
- python setup.py register
- python setup.py sdist upload
- python setup.py bdist_wheel upload
-
-site:
- cd docs; make html
-
-test:
- coverage run setup.py test
-
-unittest:
- coverage run -m unittest discover
-
-lint:
- flake8 --exit-zero funcsigs tests
-
-coverage:
- coverage report --show-missing
-
-clean:
- python setup.py clean --all
- find . -type f -name "*.pyc" -exec rm '{}' +
- find . -type d -name "__pycache__" -exec rmdir '{}' +
- rm -rf *.egg-info .coverage
- cd docs; make clean
-
-docs: site
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/README.rst b/tests/wpt/tests/tools/third_party/funcsigs/README.rst
deleted file mode 100644
index 5fbca27e6e6..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/README.rst
+++ /dev/null
@@ -1,353 +0,0 @@
-.. funcsigs documentation master file, created by
- sphinx-quickstart on Fri Apr 20 20:27:52 2012.
- You can adapt this file completely to your liking, but it should at least
- contain the root `toctree` directive.
-
-Introducing funcsigs
-====================
-
-The Funcsigs Package
---------------------
-
-``funcsigs`` is a backport of the `PEP 362`_ function signature features from
-Python 3.3's `inspect`_ module. The backport is compatible with Python 2.6, 2.7
-as well as 3.3 and up. 3.2 was supported by version 0.4, but with setuptools and
-pip no longer supporting 3.2, we cannot make any statement about 3.2
-compatibility.
-
-Compatibility
-`````````````
-
-The ``funcsigs`` backport has been tested against:
-
-* CPython 2.6
-* CPython 2.7
-* CPython 3.3
-* CPython 3.4
-* CPython 3.5
-* CPython nightlies
-* PyPy and PyPy3(currently failing CI)
-
-Continuous integration testing is provided by `Travis CI`_.
-
-Under Python 2.x there is a compatibility issue when a function is assigned to
-the ``__wrapped__`` property of a class after it has been constructed.
-Similiarily there under PyPy directly passing the ``__call__`` method of a
-builtin is also a compatibility issues. Otherwise the functionality is
-believed to be uniform between both Python2 and Python3.
-
-Issues
-``````
-
-Source code for ``funcsigs`` is hosted on `GitHub`_. Any bug reports or feature
-requests can be made using GitHub's `issues system`_. |build_status| |coverage|
-
-Example
--------
-
-To obtain a `Signature` object, pass the target function to the
-``funcsigs.signature`` function.
-
-.. code-block:: python
-
- >>> from funcsigs import signature
- >>> def foo(a, b=None, *args, **kwargs):
- ... pass
- ...
- >>> sig = signature(foo)
- >>> sig
-
- >>> sig.parameters
- OrderedDict([('a', ), ('b', ), ('args', ), ('kwargs', )])
- >>> sig.return_annotation
-
-
-Introspecting callables with the Signature object
--------------------------------------------------
-
-.. note::
-
- This section of documentation is a direct reproduction of the Python
- standard library documentation for the inspect module.
-
-The Signature object represents the call signature of a callable object and its
-return annotation. To retrieve a Signature object, use the :func:`signature`
-function.
-
-.. function:: signature(callable)
-
- Return a :class:`Signature` object for the given ``callable``::
-
- >>> from funcsigs import signature
- >>> def foo(a, *, b:int, **kwargs):
- ... pass
-
- >>> sig = signature(foo)
-
- >>> str(sig)
- '(a, *, b:int, **kwargs)'
-
- >>> str(sig.parameters['b'])
- 'b:int'
-
- >>> sig.parameters['b'].annotation
-
-
- Accepts a wide range of python callables, from plain functions and classes to
- :func:`functools.partial` objects.
-
- .. note::
-
- Some callables may not be introspectable in certain implementations of
- Python. For example, in CPython, built-in functions defined in C provide
- no metadata about their arguments.
-
-
-.. class:: Signature
-
- A Signature object represents the call signature of a function and its return
- annotation. For each parameter accepted by the function it stores a
- :class:`Parameter` object in its :attr:`parameters` collection.
-
- Signature objects are *immutable*. Use :meth:`Signature.replace` to make a
- modified copy.
-
- .. attribute:: Signature.empty
-
- A special class-level marker to specify absence of a return annotation.
-
- .. attribute:: Signature.parameters
-
- An ordered mapping of parameters' names to the corresponding
- :class:`Parameter` objects.
-
- .. attribute:: Signature.return_annotation
-
- The "return" annotation for the callable. If the callable has no "return"
- annotation, this attribute is set to :attr:`Signature.empty`.
-
- .. method:: Signature.bind(*args, **kwargs)
-
- Create a mapping from positional and keyword arguments to parameters.
- Returns :class:`BoundArguments` if ``*args`` and ``**kwargs`` match the
- signature, or raises a :exc:`TypeError`.
-
- .. method:: Signature.bind_partial(*args, **kwargs)
-
- Works the same way as :meth:`Signature.bind`, but allows the omission of
- some required arguments (mimics :func:`functools.partial` behavior.)
- Returns :class:`BoundArguments`, or raises a :exc:`TypeError` if the
- passed arguments do not match the signature.
-
- .. method:: Signature.replace(*[, parameters][, return_annotation])
-
- Create a new Signature instance based on the instance replace was invoked
- on. It is possible to pass different ``parameters`` and/or
- ``return_annotation`` to override the corresponding properties of the base
- signature. To remove return_annotation from the copied Signature, pass in
- :attr:`Signature.empty`.
-
- ::
-
- >>> def test(a, b):
- ... pass
- >>> sig = signature(test)
- >>> new_sig = sig.replace(return_annotation="new return anno")
- >>> str(new_sig)
- "(a, b) -> 'new return anno'"
-
-
-.. class:: Parameter
-
- Parameter objects are *immutable*. Instead of modifying a Parameter object,
- you can use :meth:`Parameter.replace` to create a modified copy.
-
- .. attribute:: Parameter.empty
-
- A special class-level marker to specify absence of default values and
- annotations.
-
- .. attribute:: Parameter.name
-
- The name of the parameter as a string. Must be a valid python identifier
- name (with the exception of ``POSITIONAL_ONLY`` parameters, which can have
- it set to ``None``).
-
- .. attribute:: Parameter.default
-
- The default value for the parameter. If the parameter has no default
- value, this attribute is set to :attr:`Parameter.empty`.
-
- .. attribute:: Parameter.annotation
-
- The annotation for the parameter. If the parameter has no annotation,
- this attribute is set to :attr:`Parameter.empty`.
-
- .. attribute:: Parameter.kind
-
- Describes how argument values are bound to the parameter. Possible values
- (accessible via :class:`Parameter`, like ``Parameter.KEYWORD_ONLY``):
-
- +------------------------+----------------------------------------------+
- | Name | Meaning |
- +========================+==============================================+
- | *POSITIONAL_ONLY* | Value must be supplied as a positional |
- | | argument. |
- | | |
- | | Python has no explicit syntax for defining |
- | | positional-only parameters, but many built-in|
- | | and extension module functions (especially |
- | | those that accept only one or two parameters)|
- | | accept them. |
- +------------------------+----------------------------------------------+
- | *POSITIONAL_OR_KEYWORD*| Value may be supplied as either a keyword or |
- | | positional argument (this is the standard |
- | | binding behaviour for functions implemented |
- | | in Python.) |
- +------------------------+----------------------------------------------+
- | *VAR_POSITIONAL* | A tuple of positional arguments that aren't |
- | | bound to any other parameter. This |
- | | corresponds to a ``*args`` parameter in a |
- | | Python function definition. |
- +------------------------+----------------------------------------------+
- | *KEYWORD_ONLY* | Value must be supplied as a keyword argument.|
- | | Keyword only parameters are those which |
- | | appear after a ``*`` or ``*args`` entry in a |
- | | Python function definition. |
- +------------------------+----------------------------------------------+
- | *VAR_KEYWORD* | A dict of keyword arguments that aren't bound|
- | | to any other parameter. This corresponds to a|
- | | ``**kwargs`` parameter in a Python function |
- | | definition. |
- +------------------------+----------------------------------------------+
-
- Example: print all keyword-only arguments without default values::
-
- >>> def foo(a, b, *, c, d=10):
- ... pass
-
- >>> sig = signature(foo)
- >>> for param in sig.parameters.values():
- ... if (param.kind == param.KEYWORD_ONLY and
- ... param.default is param.empty):
- ... print('Parameter:', param)
- Parameter: c
-
- .. method:: Parameter.replace(*[, name][, kind][, default][, annotation])
-
- Create a new Parameter instance based on the instance replaced was invoked
- on. To override a :class:`Parameter` attribute, pass the corresponding
- argument. To remove a default value or/and an annotation from a
- Parameter, pass :attr:`Parameter.empty`.
-
- ::
-
- >>> from funcsigs import Parameter
- >>> param = Parameter('foo', Parameter.KEYWORD_ONLY, default=42)
- >>> str(param)
- 'foo=42'
-
- >>> str(param.replace()) # Will create a shallow copy of 'param'
- 'foo=42'
-
- >>> str(param.replace(default=Parameter.empty, annotation='spam'))
- "foo:'spam'"
-
-
-.. class:: BoundArguments
-
- Result of a :meth:`Signature.bind` or :meth:`Signature.bind_partial` call.
- Holds the mapping of arguments to the function's parameters.
-
- .. attribute:: BoundArguments.arguments
-
- An ordered, mutable mapping (:class:`collections.OrderedDict`) of
- parameters' names to arguments' values. Contains only explicitly bound
- arguments. Changes in :attr:`arguments` will reflect in :attr:`args` and
- :attr:`kwargs`.
-
- Should be used in conjunction with :attr:`Signature.parameters` for any
- argument processing purposes.
-
- .. note::
-
- Arguments for which :meth:`Signature.bind` or
- :meth:`Signature.bind_partial` relied on a default value are skipped.
- However, if needed, it is easy to include them.
-
- ::
-
- >>> def foo(a, b=10):
- ... pass
-
- >>> sig = signature(foo)
- >>> ba = sig.bind(5)
-
- >>> ba.args, ba.kwargs
- ((5,), {})
-
- >>> for param in sig.parameters.values():
- ... if param.name not in ba.arguments:
- ... ba.arguments[param.name] = param.default
-
- >>> ba.args, ba.kwargs
- ((5, 10), {})
-
-
- .. attribute:: BoundArguments.args
-
- A tuple of positional arguments values. Dynamically computed from the
- :attr:`arguments` attribute.
-
- .. attribute:: BoundArguments.kwargs
-
- A dict of keyword arguments values. Dynamically computed from the
- :attr:`arguments` attribute.
-
- The :attr:`args` and :attr:`kwargs` properties can be used to invoke
- functions::
-
- def test(a, *, b):
- ...
-
- sig = signature(test)
- ba = sig.bind(10, b=20)
- test(*ba.args, **ba.kwargs)
-
-
-.. seealso::
-
- :pep:`362` - Function Signature Object.
- The detailed specification, implementation details and examples.
-
-Copyright
----------
-
-*funcsigs* is a derived work of CPython under the terms of the `PSF License
-Agreement`_. The original CPython inspect module, its unit tests and
-documentation are the copyright of the Python Software Foundation. The derived
-work is distributed under the `Apache License Version 2.0`_.
-
-.. _PSF License Agreement: http://docs.python.org/3/license.html#terms-and-conditions-for-accessing-or-otherwise-using-python
-.. _Apache License Version 2.0: http://opensource.org/licenses/Apache-2.0
-.. _GitHub: https://github.com/testing-cabal/funcsigs
-.. _PSF License Agreement: http://docs.python.org/3/license.html#terms-and-conditions-for-accessing-or-otherwise-using-python
-.. _Travis CI: http://travis-ci.org/
-.. _Read The Docs: http://funcsigs.readthedocs.org/
-.. _PEP 362: http://www.python.org/dev/peps/pep-0362/
-.. _inspect: http://docs.python.org/3/library/inspect.html#introspecting-callables-with-the-signature-object
-.. _issues system: https://github.com/testing-cabal/funcsigs/issues
-
-.. |build_status| image:: https://secure.travis-ci.org/aliles/funcsigs.png?branch=master
- :target: http://travis-ci.org/#!/aliles/funcsigs
- :alt: Current build status
-
-.. |coverage| image:: https://coveralls.io/repos/aliles/funcsigs/badge.png?branch=master
- :target: https://coveralls.io/r/aliles/funcsigs?branch=master
- :alt: Coverage status
-
-.. |pypi_version| image:: https://pypip.in/v/funcsigs/badge.png
- :target: https://crate.io/packages/funcsigs/
- :alt: Latest PyPI version
-
-
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/docs/Makefile b/tests/wpt/tests/tools/third_party/funcsigs/docs/Makefile
deleted file mode 100644
index f7ab3d16b40..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/docs/Makefile
+++ /dev/null
@@ -1,153 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
-PAPER =
-BUILDDIR = _build
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
-
-help:
- @echo "Please use \`make ' where is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " texinfo to make Texinfo files"
- @echo " info to make Texinfo files and run them through makeinfo"
- @echo " gettext to make PO message catalogs"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
-
-clean:
- -rm -rf $(BUILDDIR)
-
-html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml:
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-singlehtml:
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-pickle:
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
- @echo
- @echo "Build finished; now you can run HTML Help Workshop with the" \
- ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-qthelp:
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
- @echo
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/funcsigs.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/funcsigs.qhc"
-
-devhelp:
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
- @echo
- @echo "Build finished."
- @echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/funcsigs"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/funcsigs"
- @echo "# devhelp"
-
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-latexpdf:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through pdflatex..."
- $(MAKE) -C $(BUILDDIR)/latex all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-text:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-texinfo:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo
- @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
- @echo "Run \`make' in that directory to run these through makeinfo" \
- "(use \`make info' here to do that automatically)."
-
-info:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo "Running Texinfo files through makeinfo..."
- make -C $(BUILDDIR)/texinfo info
- @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
-
-gettext:
- $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
- @echo
- @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
-
-changes:
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
- @echo
- @echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck:
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
- @echo
- @echo "Link check complete; look for any errors in the above output " \
- "or in $(BUILDDIR)/linkcheck/output.txt."
-
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/docs/_templates/page.html b/tests/wpt/tests/tools/third_party/funcsigs/docs/_templates/page.html
deleted file mode 100644
index 5e1e00bcafa..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/docs/_templates/page.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "!page.html" %}
-{% block extrahead %}
-
-
-
- {{ super() }}
-{% endblock %}
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/docs/conf.py b/tests/wpt/tests/tools/third_party/funcsigs/docs/conf.py
deleted file mode 100644
index c6e4194cc05..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/docs/conf.py
+++ /dev/null
@@ -1,251 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-#
-# funcsigs documentation build configuration file, created by
-# sphinx-quickstart on Fri Apr 20 20:27:52 2012.
-#
-# This file is execfile()d with the current directory set to its containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import sys, os
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-sys.path.insert(0, os.path.abspath('..'))
-
-# -- General configuration -----------------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-#needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode']
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = 'funcsigs'
-copyright = '2013, Aaron Iles'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-from funcsigs import __version__
-version = '.'.join(__version__.split('.')[:2])
-# The full version, including alpha/beta/rc tags.
-release = __version__
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-exclude_patterns = ['_build']
-
-# The reST default role (used for this markup: `text`) to use for all documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-
-# -- Options for HTML output ---------------------------------------------------
-
-# The theme to use for HTML and HTML Help pages. See the documentation for
-# a list of builtin themes.
-html_theme = 'agogo'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further. For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
-# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# " v documentation".
-#html_title = None
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = []
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a tag referring to it. The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'funcsigsdoc'
-
-
-# -- Options for LaTeX output --------------------------------------------------
-
-latex_elements = {
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
-
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
-
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
-latex_documents = [
- ('index', 'funcsigs.tex', 'funcsigs Documentation',
- 'Aaron Iles', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- Options for manual page output --------------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
- ('index', 'funcsigs', 'funcsigs Documentation',
- ['Aaron Iles'], 1)
-]
-
-# If true, show URL addresses after external links.
-#man_show_urls = False
-
-
-# -- Options for Texinfo output ------------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-# dir menu entry, description, category)
-texinfo_documents = [
- ('index', 'funcsigs', 'funcsigs Documentation',
- 'Aaron Iles', 'funcsigs', 'One line description of project.',
- 'Miscellaneous'),
-]
-
-# Documents to append as an appendix to all manuals.
-#texinfo_appendices = []
-
-# If false, no module index is generated.
-#texinfo_domain_indices = True
-
-# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#texinfo_show_urls = 'footnote'
-
-
-# Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {
- 'python3': ('http://docs.python.org/py3k', None),
- 'python': ('http://docs.python.org/', None)
-}
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/docs/index.rst b/tests/wpt/tests/tools/third_party/funcsigs/docs/index.rst
deleted file mode 100644
index 5fbca27e6e6..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/docs/index.rst
+++ /dev/null
@@ -1,353 +0,0 @@
-.. funcsigs documentation master file, created by
- sphinx-quickstart on Fri Apr 20 20:27:52 2012.
- You can adapt this file completely to your liking, but it should at least
- contain the root `toctree` directive.
-
-Introducing funcsigs
-====================
-
-The Funcsigs Package
---------------------
-
-``funcsigs`` is a backport of the `PEP 362`_ function signature features from
-Python 3.3's `inspect`_ module. The backport is compatible with Python 2.6, 2.7
-as well as 3.3 and up. 3.2 was supported by version 0.4, but with setuptools and
-pip no longer supporting 3.2, we cannot make any statement about 3.2
-compatibility.
-
-Compatibility
-`````````````
-
-The ``funcsigs`` backport has been tested against:
-
-* CPython 2.6
-* CPython 2.7
-* CPython 3.3
-* CPython 3.4
-* CPython 3.5
-* CPython nightlies
-* PyPy and PyPy3(currently failing CI)
-
-Continuous integration testing is provided by `Travis CI`_.
-
-Under Python 2.x there is a compatibility issue when a function is assigned to
-the ``__wrapped__`` property of a class after it has been constructed.
-Similiarily there under PyPy directly passing the ``__call__`` method of a
-builtin is also a compatibility issues. Otherwise the functionality is
-believed to be uniform between both Python2 and Python3.
-
-Issues
-``````
-
-Source code for ``funcsigs`` is hosted on `GitHub`_. Any bug reports or feature
-requests can be made using GitHub's `issues system`_. |build_status| |coverage|
-
-Example
--------
-
-To obtain a `Signature` object, pass the target function to the
-``funcsigs.signature`` function.
-
-.. code-block:: python
-
- >>> from funcsigs import signature
- >>> def foo(a, b=None, *args, **kwargs):
- ... pass
- ...
- >>> sig = signature(foo)
- >>> sig
-
- >>> sig.parameters
- OrderedDict([('a', ), ('b', ), ('args', ), ('kwargs', )])
- >>> sig.return_annotation
-
-
-Introspecting callables with the Signature object
--------------------------------------------------
-
-.. note::
-
- This section of documentation is a direct reproduction of the Python
- standard library documentation for the inspect module.
-
-The Signature object represents the call signature of a callable object and its
-return annotation. To retrieve a Signature object, use the :func:`signature`
-function.
-
-.. function:: signature(callable)
-
- Return a :class:`Signature` object for the given ``callable``::
-
- >>> from funcsigs import signature
- >>> def foo(a, *, b:int, **kwargs):
- ... pass
-
- >>> sig = signature(foo)
-
- >>> str(sig)
- '(a, *, b:int, **kwargs)'
-
- >>> str(sig.parameters['b'])
- 'b:int'
-
- >>> sig.parameters['b'].annotation
-
-
- Accepts a wide range of python callables, from plain functions and classes to
- :func:`functools.partial` objects.
-
- .. note::
-
- Some callables may not be introspectable in certain implementations of
- Python. For example, in CPython, built-in functions defined in C provide
- no metadata about their arguments.
-
-
-.. class:: Signature
-
- A Signature object represents the call signature of a function and its return
- annotation. For each parameter accepted by the function it stores a
- :class:`Parameter` object in its :attr:`parameters` collection.
-
- Signature objects are *immutable*. Use :meth:`Signature.replace` to make a
- modified copy.
-
- .. attribute:: Signature.empty
-
- A special class-level marker to specify absence of a return annotation.
-
- .. attribute:: Signature.parameters
-
- An ordered mapping of parameters' names to the corresponding
- :class:`Parameter` objects.
-
- .. attribute:: Signature.return_annotation
-
- The "return" annotation for the callable. If the callable has no "return"
- annotation, this attribute is set to :attr:`Signature.empty`.
-
- .. method:: Signature.bind(*args, **kwargs)
-
- Create a mapping from positional and keyword arguments to parameters.
- Returns :class:`BoundArguments` if ``*args`` and ``**kwargs`` match the
- signature, or raises a :exc:`TypeError`.
-
- .. method:: Signature.bind_partial(*args, **kwargs)
-
- Works the same way as :meth:`Signature.bind`, but allows the omission of
- some required arguments (mimics :func:`functools.partial` behavior.)
- Returns :class:`BoundArguments`, or raises a :exc:`TypeError` if the
- passed arguments do not match the signature.
-
- .. method:: Signature.replace(*[, parameters][, return_annotation])
-
- Create a new Signature instance based on the instance replace was invoked
- on. It is possible to pass different ``parameters`` and/or
- ``return_annotation`` to override the corresponding properties of the base
- signature. To remove return_annotation from the copied Signature, pass in
- :attr:`Signature.empty`.
-
- ::
-
- >>> def test(a, b):
- ... pass
- >>> sig = signature(test)
- >>> new_sig = sig.replace(return_annotation="new return anno")
- >>> str(new_sig)
- "(a, b) -> 'new return anno'"
-
-
-.. class:: Parameter
-
- Parameter objects are *immutable*. Instead of modifying a Parameter object,
- you can use :meth:`Parameter.replace` to create a modified copy.
-
- .. attribute:: Parameter.empty
-
- A special class-level marker to specify absence of default values and
- annotations.
-
- .. attribute:: Parameter.name
-
- The name of the parameter as a string. Must be a valid python identifier
- name (with the exception of ``POSITIONAL_ONLY`` parameters, which can have
- it set to ``None``).
-
- .. attribute:: Parameter.default
-
- The default value for the parameter. If the parameter has no default
- value, this attribute is set to :attr:`Parameter.empty`.
-
- .. attribute:: Parameter.annotation
-
- The annotation for the parameter. If the parameter has no annotation,
- this attribute is set to :attr:`Parameter.empty`.
-
- .. attribute:: Parameter.kind
-
- Describes how argument values are bound to the parameter. Possible values
- (accessible via :class:`Parameter`, like ``Parameter.KEYWORD_ONLY``):
-
- +------------------------+----------------------------------------------+
- | Name | Meaning |
- +========================+==============================================+
- | *POSITIONAL_ONLY* | Value must be supplied as a positional |
- | | argument. |
- | | |
- | | Python has no explicit syntax for defining |
- | | positional-only parameters, but many built-in|
- | | and extension module functions (especially |
- | | those that accept only one or two parameters)|
- | | accept them. |
- +------------------------+----------------------------------------------+
- | *POSITIONAL_OR_KEYWORD*| Value may be supplied as either a keyword or |
- | | positional argument (this is the standard |
- | | binding behaviour for functions implemented |
- | | in Python.) |
- +------------------------+----------------------------------------------+
- | *VAR_POSITIONAL* | A tuple of positional arguments that aren't |
- | | bound to any other parameter. This |
- | | corresponds to a ``*args`` parameter in a |
- | | Python function definition. |
- +------------------------+----------------------------------------------+
- | *KEYWORD_ONLY* | Value must be supplied as a keyword argument.|
- | | Keyword only parameters are those which |
- | | appear after a ``*`` or ``*args`` entry in a |
- | | Python function definition. |
- +------------------------+----------------------------------------------+
- | *VAR_KEYWORD* | A dict of keyword arguments that aren't bound|
- | | to any other parameter. This corresponds to a|
- | | ``**kwargs`` parameter in a Python function |
- | | definition. |
- +------------------------+----------------------------------------------+
-
- Example: print all keyword-only arguments without default values::
-
- >>> def foo(a, b, *, c, d=10):
- ... pass
-
- >>> sig = signature(foo)
- >>> for param in sig.parameters.values():
- ... if (param.kind == param.KEYWORD_ONLY and
- ... param.default is param.empty):
- ... print('Parameter:', param)
- Parameter: c
-
- .. method:: Parameter.replace(*[, name][, kind][, default][, annotation])
-
- Create a new Parameter instance based on the instance replaced was invoked
- on. To override a :class:`Parameter` attribute, pass the corresponding
- argument. To remove a default value or/and an annotation from a
- Parameter, pass :attr:`Parameter.empty`.
-
- ::
-
- >>> from funcsigs import Parameter
- >>> param = Parameter('foo', Parameter.KEYWORD_ONLY, default=42)
- >>> str(param)
- 'foo=42'
-
- >>> str(param.replace()) # Will create a shallow copy of 'param'
- 'foo=42'
-
- >>> str(param.replace(default=Parameter.empty, annotation='spam'))
- "foo:'spam'"
-
-
-.. class:: BoundArguments
-
- Result of a :meth:`Signature.bind` or :meth:`Signature.bind_partial` call.
- Holds the mapping of arguments to the function's parameters.
-
- .. attribute:: BoundArguments.arguments
-
- An ordered, mutable mapping (:class:`collections.OrderedDict`) of
- parameters' names to arguments' values. Contains only explicitly bound
- arguments. Changes in :attr:`arguments` will reflect in :attr:`args` and
- :attr:`kwargs`.
-
- Should be used in conjunction with :attr:`Signature.parameters` for any
- argument processing purposes.
-
- .. note::
-
- Arguments for which :meth:`Signature.bind` or
- :meth:`Signature.bind_partial` relied on a default value are skipped.
- However, if needed, it is easy to include them.
-
- ::
-
- >>> def foo(a, b=10):
- ... pass
-
- >>> sig = signature(foo)
- >>> ba = sig.bind(5)
-
- >>> ba.args, ba.kwargs
- ((5,), {})
-
- >>> for param in sig.parameters.values():
- ... if param.name not in ba.arguments:
- ... ba.arguments[param.name] = param.default
-
- >>> ba.args, ba.kwargs
- ((5, 10), {})
-
-
- .. attribute:: BoundArguments.args
-
- A tuple of positional arguments values. Dynamically computed from the
- :attr:`arguments` attribute.
-
- .. attribute:: BoundArguments.kwargs
-
- A dict of keyword arguments values. Dynamically computed from the
- :attr:`arguments` attribute.
-
- The :attr:`args` and :attr:`kwargs` properties can be used to invoke
- functions::
-
- def test(a, *, b):
- ...
-
- sig = signature(test)
- ba = sig.bind(10, b=20)
- test(*ba.args, **ba.kwargs)
-
-
-.. seealso::
-
- :pep:`362` - Function Signature Object.
- The detailed specification, implementation details and examples.
-
-Copyright
----------
-
-*funcsigs* is a derived work of CPython under the terms of the `PSF License
-Agreement`_. The original CPython inspect module, its unit tests and
-documentation are the copyright of the Python Software Foundation. The derived
-work is distributed under the `Apache License Version 2.0`_.
-
-.. _PSF License Agreement: http://docs.python.org/3/license.html#terms-and-conditions-for-accessing-or-otherwise-using-python
-.. _Apache License Version 2.0: http://opensource.org/licenses/Apache-2.0
-.. _GitHub: https://github.com/testing-cabal/funcsigs
-.. _PSF License Agreement: http://docs.python.org/3/license.html#terms-and-conditions-for-accessing-or-otherwise-using-python
-.. _Travis CI: http://travis-ci.org/
-.. _Read The Docs: http://funcsigs.readthedocs.org/
-.. _PEP 362: http://www.python.org/dev/peps/pep-0362/
-.. _inspect: http://docs.python.org/3/library/inspect.html#introspecting-callables-with-the-signature-object
-.. _issues system: https://github.com/testing-cabal/funcsigs/issues
-
-.. |build_status| image:: https://secure.travis-ci.org/aliles/funcsigs.png?branch=master
- :target: http://travis-ci.org/#!/aliles/funcsigs
- :alt: Current build status
-
-.. |coverage| image:: https://coveralls.io/repos/aliles/funcsigs/badge.png?branch=master
- :target: https://coveralls.io/r/aliles/funcsigs?branch=master
- :alt: Coverage status
-
-.. |pypi_version| image:: https://pypip.in/v/funcsigs/badge.png
- :target: https://crate.io/packages/funcsigs/
- :alt: Latest PyPI version
-
-
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/funcsigs/__init__.py b/tests/wpt/tests/tools/third_party/funcsigs/funcsigs/__init__.py
deleted file mode 100644
index 5f5378b42a6..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/funcsigs/__init__.py
+++ /dev/null
@@ -1,829 +0,0 @@
-# Copyright 2001-2013 Python Software Foundation; All Rights Reserved
-"""Function signature objects for callables
-
-Back port of Python 3.3's function signature tools from the inspect module,
-modified to be compatible with Python 2.6, 2.7 and 3.3+.
-"""
-from __future__ import absolute_import, division, print_function
-import itertools
-import functools
-import re
-import types
-
-try:
- from collections import OrderedDict
-except ImportError:
- from ordereddict import OrderedDict
-
-from funcsigs.version import __version__
-
-__all__ = ['BoundArguments', 'Parameter', 'Signature', 'signature']
-
-
-_WrapperDescriptor = type(type.__call__)
-_MethodWrapper = type(all.__call__)
-
-_NonUserDefinedCallables = (_WrapperDescriptor,
- _MethodWrapper,
- types.BuiltinFunctionType)
-
-
-def formatannotation(annotation, base_module=None):
- if isinstance(annotation, type):
- if annotation.__module__ in ('builtins', '__builtin__', base_module):
- return annotation.__name__
- return annotation.__module__+'.'+annotation.__name__
- return repr(annotation)
-
-
-def _get_user_defined_method(cls, method_name, *nested):
- try:
- if cls is type:
- return
- meth = getattr(cls, method_name)
- for name in nested:
- meth = getattr(meth, name, meth)
- except AttributeError:
- return
- else:
- if not isinstance(meth, _NonUserDefinedCallables):
- # Once '__signature__' will be added to 'C'-level
- # callables, this check won't be necessary
- return meth
-
-
-def signature(obj):
- '''Get a signature object for the passed callable.'''
-
- if not callable(obj):
- raise TypeError('{0!r} is not a callable object'.format(obj))
-
- if isinstance(obj, types.MethodType):
- sig = signature(obj.__func__)
- if obj.__self__ is None:
- # Unbound method - preserve as-is.
- return sig
- else:
- # Bound method. Eat self - if we can.
- params = tuple(sig.parameters.values())
-
- if not params or params[0].kind in (_VAR_KEYWORD, _KEYWORD_ONLY):
- raise ValueError('invalid method signature')
-
- kind = params[0].kind
- if kind in (_POSITIONAL_OR_KEYWORD, _POSITIONAL_ONLY):
- # Drop first parameter:
- # '(p1, p2[, ...])' -> '(p2[, ...])'
- params = params[1:]
- else:
- if kind is not _VAR_POSITIONAL:
- # Unless we add a new parameter type we never
- # get here
- raise ValueError('invalid argument type')
- # It's a var-positional parameter.
- # Do nothing. '(*args[, ...])' -> '(*args[, ...])'
-
- return sig.replace(parameters=params)
-
- try:
- sig = obj.__signature__
- except AttributeError:
- pass
- else:
- if sig is not None:
- return sig
-
- try:
- # Was this function wrapped by a decorator?
- wrapped = obj.__wrapped__
- except AttributeError:
- pass
- else:
- return signature(wrapped)
-
- if isinstance(obj, types.FunctionType):
- return Signature.from_function(obj)
-
- if isinstance(obj, functools.partial):
- sig = signature(obj.func)
-
- new_params = OrderedDict(sig.parameters.items())
-
- partial_args = obj.args or ()
- partial_keywords = obj.keywords or {}
- try:
- ba = sig.bind_partial(*partial_args, **partial_keywords)
- except TypeError as ex:
- msg = 'partial object {0!r} has incorrect arguments'.format(obj)
- raise ValueError(msg)
-
- for arg_name, arg_value in ba.arguments.items():
- param = new_params[arg_name]
- if arg_name in partial_keywords:
- # We set a new default value, because the following code
- # is correct:
- #
- # >>> def foo(a): print(a)
- # >>> print(partial(partial(foo, a=10), a=20)())
- # 20
- # >>> print(partial(partial(foo, a=10), a=20)(a=30))
- # 30
- #
- # So, with 'partial' objects, passing a keyword argument is
- # like setting a new default value for the corresponding
- # parameter
- #
- # We also mark this parameter with '_partial_kwarg'
- # flag. Later, in '_bind', the 'default' value of this
- # parameter will be added to 'kwargs', to simulate
- # the 'functools.partial' real call.
- new_params[arg_name] = param.replace(default=arg_value,
- _partial_kwarg=True)
-
- elif (param.kind not in (_VAR_KEYWORD, _VAR_POSITIONAL) and
- not param._partial_kwarg):
- new_params.pop(arg_name)
-
- return sig.replace(parameters=new_params.values())
-
- sig = None
- if isinstance(obj, type):
- # obj is a class or a metaclass
-
- # First, let's see if it has an overloaded __call__ defined
- # in its metaclass
- call = _get_user_defined_method(type(obj), '__call__')
- if call is not None:
- sig = signature(call)
- else:
- # Now we check if the 'obj' class has a '__new__' method
- new = _get_user_defined_method(obj, '__new__')
- if new is not None:
- sig = signature(new)
- else:
- # Finally, we should have at least __init__ implemented
- init = _get_user_defined_method(obj, '__init__')
- if init is not None:
- sig = signature(init)
- elif not isinstance(obj, _NonUserDefinedCallables):
- # An object with __call__
- # We also check that the 'obj' is not an instance of
- # _WrapperDescriptor or _MethodWrapper to avoid
- # infinite recursion (and even potential segfault)
- call = _get_user_defined_method(type(obj), '__call__', 'im_func')
- if call is not None:
- sig = signature(call)
-
- if sig is not None:
- # For classes and objects we skip the first parameter of their
- # __call__, __new__, or __init__ methods
- return sig.replace(parameters=tuple(sig.parameters.values())[1:])
-
- if isinstance(obj, types.BuiltinFunctionType):
- # Raise a nicer error message for builtins
- msg = 'no signature found for builtin function {0!r}'.format(obj)
- raise ValueError(msg)
-
- raise ValueError('callable {0!r} is not supported by signature'.format(obj))
-
-
-class _void(object):
- '''A private marker - used in Parameter & Signature'''
-
-
-class _empty(object):
- pass
-
-
-class _ParameterKind(int):
- def __new__(self, *args, **kwargs):
- obj = int.__new__(self, *args)
- obj._name = kwargs['name']
- return obj
-
- def __str__(self):
- return self._name
-
- def __repr__(self):
- return '<_ParameterKind: {0!r}>'.format(self._name)
-
-
-_POSITIONAL_ONLY = _ParameterKind(0, name='POSITIONAL_ONLY')
-_POSITIONAL_OR_KEYWORD = _ParameterKind(1, name='POSITIONAL_OR_KEYWORD')
-_VAR_POSITIONAL = _ParameterKind(2, name='VAR_POSITIONAL')
-_KEYWORD_ONLY = _ParameterKind(3, name='KEYWORD_ONLY')
-_VAR_KEYWORD = _ParameterKind(4, name='VAR_KEYWORD')
-
-
-class Parameter(object):
- '''Represents a parameter in a function signature.
-
- Has the following public attributes:
-
- * name : str
- The name of the parameter as a string.
- * default : object
- The default value for the parameter if specified. If the
- parameter has no default value, this attribute is not set.
- * annotation
- The annotation for the parameter if specified. If the
- parameter has no annotation, this attribute is not set.
- * kind : str
- Describes how argument values are bound to the parameter.
- Possible values: `Parameter.POSITIONAL_ONLY`,
- `Parameter.POSITIONAL_OR_KEYWORD`, `Parameter.VAR_POSITIONAL`,
- `Parameter.KEYWORD_ONLY`, `Parameter.VAR_KEYWORD`.
- '''
-
- __slots__ = ('_name', '_kind', '_default', '_annotation', '_partial_kwarg')
-
- POSITIONAL_ONLY = _POSITIONAL_ONLY
- POSITIONAL_OR_KEYWORD = _POSITIONAL_OR_KEYWORD
- VAR_POSITIONAL = _VAR_POSITIONAL
- KEYWORD_ONLY = _KEYWORD_ONLY
- VAR_KEYWORD = _VAR_KEYWORD
-
- empty = _empty
-
- def __init__(self, name, kind, default=_empty, annotation=_empty,
- _partial_kwarg=False):
-
- if kind not in (_POSITIONAL_ONLY, _POSITIONAL_OR_KEYWORD,
- _VAR_POSITIONAL, _KEYWORD_ONLY, _VAR_KEYWORD):
- raise ValueError("invalid value for 'Parameter.kind' attribute")
- self._kind = kind
-
- if default is not _empty:
- if kind in (_VAR_POSITIONAL, _VAR_KEYWORD):
- msg = '{0} parameters cannot have default values'.format(kind)
- raise ValueError(msg)
- self._default = default
- self._annotation = annotation
-
- if name is None:
- if kind != _POSITIONAL_ONLY:
- raise ValueError("None is not a valid name for a "
- "non-positional-only parameter")
- self._name = name
- else:
- name = str(name)
- if kind != _POSITIONAL_ONLY and not re.match(r'[a-z_]\w*$', name, re.I):
- msg = '{0!r} is not a valid parameter name'.format(name)
- raise ValueError(msg)
- self._name = name
-
- self._partial_kwarg = _partial_kwarg
-
- @property
- def name(self):
- return self._name
-
- @property
- def default(self):
- return self._default
-
- @property
- def annotation(self):
- return self._annotation
-
- @property
- def kind(self):
- return self._kind
-
- def replace(self, name=_void, kind=_void, annotation=_void,
- default=_void, _partial_kwarg=_void):
- '''Creates a customized copy of the Parameter.'''
-
- if name is _void:
- name = self._name
-
- if kind is _void:
- kind = self._kind
-
- if annotation is _void:
- annotation = self._annotation
-
- if default is _void:
- default = self._default
-
- if _partial_kwarg is _void:
- _partial_kwarg = self._partial_kwarg
-
- return type(self)(name, kind, default=default, annotation=annotation,
- _partial_kwarg=_partial_kwarg)
-
- def __str__(self):
- kind = self.kind
-
- formatted = self._name
- if kind == _POSITIONAL_ONLY:
- if formatted is None:
- formatted = ''
- formatted = '<{0}>'.format(formatted)
-
- # Add annotation and default value
- if self._annotation is not _empty:
- formatted = '{0}:{1}'.format(formatted,
- formatannotation(self._annotation))
-
- if self._default is not _empty:
- formatted = '{0}={1}'.format(formatted, repr(self._default))
-
- if kind == _VAR_POSITIONAL:
- formatted = '*' + formatted
- elif kind == _VAR_KEYWORD:
- formatted = '**' + formatted
-
- return formatted
-
- def __repr__(self):
- return '<{0} at {1:#x} {2!r}>'.format(self.__class__.__name__,
- id(self), self.name)
-
- def __hash__(self):
- msg = "unhashable type: '{0}'".format(self.__class__.__name__)
- raise TypeError(msg)
-
- def __eq__(self, other):
- return (issubclass(other.__class__, Parameter) and
- self._name == other._name and
- self._kind == other._kind and
- self._default == other._default and
- self._annotation == other._annotation)
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
-
-class BoundArguments(object):
- '''Result of `Signature.bind` call. Holds the mapping of arguments
- to the function's parameters.
-
- Has the following public attributes:
-
- * arguments : OrderedDict
- An ordered mutable mapping of parameters' names to arguments' values.
- Does not contain arguments' default values.
- * signature : Signature
- The Signature object that created this instance.
- * args : tuple
- Tuple of positional arguments values.
- * kwargs : dict
- Dict of keyword arguments values.
- '''
-
- def __init__(self, signature, arguments):
- self.arguments = arguments
- self._signature = signature
-
- @property
- def signature(self):
- return self._signature
-
- @property
- def args(self):
- args = []
- for param_name, param in self._signature.parameters.items():
- if (param.kind in (_VAR_KEYWORD, _KEYWORD_ONLY) or
- param._partial_kwarg):
- # Keyword arguments mapped by 'functools.partial'
- # (Parameter._partial_kwarg is True) are mapped
- # in 'BoundArguments.kwargs', along with VAR_KEYWORD &
- # KEYWORD_ONLY
- break
-
- try:
- arg = self.arguments[param_name]
- except KeyError:
- # We're done here. Other arguments
- # will be mapped in 'BoundArguments.kwargs'
- break
- else:
- if param.kind == _VAR_POSITIONAL:
- # *args
- args.extend(arg)
- else:
- # plain argument
- args.append(arg)
-
- return tuple(args)
-
- @property
- def kwargs(self):
- kwargs = {}
- kwargs_started = False
- for param_name, param in self._signature.parameters.items():
- if not kwargs_started:
- if (param.kind in (_VAR_KEYWORD, _KEYWORD_ONLY) or
- param._partial_kwarg):
- kwargs_started = True
- else:
- if param_name not in self.arguments:
- kwargs_started = True
- continue
-
- if not kwargs_started:
- continue
-
- try:
- arg = self.arguments[param_name]
- except KeyError:
- pass
- else:
- if param.kind == _VAR_KEYWORD:
- # **kwargs
- kwargs.update(arg)
- else:
- # plain keyword argument
- kwargs[param_name] = arg
-
- return kwargs
-
- def __hash__(self):
- msg = "unhashable type: '{0}'".format(self.__class__.__name__)
- raise TypeError(msg)
-
- def __eq__(self, other):
- return (issubclass(other.__class__, BoundArguments) and
- self.signature == other.signature and
- self.arguments == other.arguments)
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
-
-class Signature(object):
- '''A Signature object represents the overall signature of a function.
- It stores a Parameter object for each parameter accepted by the
- function, as well as information specific to the function itself.
-
- A Signature object has the following public attributes and methods:
-
- * parameters : OrderedDict
- An ordered mapping of parameters' names to the corresponding
- Parameter objects (keyword-only arguments are in the same order
- as listed in `code.co_varnames`).
- * return_annotation : object
- The annotation for the return type of the function if specified.
- If the function has no annotation for its return type, this
- attribute is not set.
- * bind(*args, **kwargs) -> BoundArguments
- Creates a mapping from positional and keyword arguments to
- parameters.
- * bind_partial(*args, **kwargs) -> BoundArguments
- Creates a partial mapping from positional and keyword arguments
- to parameters (simulating 'functools.partial' behavior.)
- '''
-
- __slots__ = ('_return_annotation', '_parameters')
-
- _parameter_cls = Parameter
- _bound_arguments_cls = BoundArguments
-
- empty = _empty
-
- def __init__(self, parameters=None, return_annotation=_empty,
- __validate_parameters__=True):
- '''Constructs Signature from the given list of Parameter
- objects and 'return_annotation'. All arguments are optional.
- '''
-
- if parameters is None:
- params = OrderedDict()
- else:
- if __validate_parameters__:
- params = OrderedDict()
- top_kind = _POSITIONAL_ONLY
-
- for idx, param in enumerate(parameters):
- kind = param.kind
- if kind < top_kind:
- msg = 'wrong parameter order: {0} before {1}'
- msg = msg.format(top_kind, param.kind)
- raise ValueError(msg)
- else:
- top_kind = kind
-
- name = param.name
- if name is None:
- name = str(idx)
- param = param.replace(name=name)
-
- if name in params:
- msg = 'duplicate parameter name: {0!r}'.format(name)
- raise ValueError(msg)
- params[name] = param
- else:
- params = OrderedDict(((param.name, param)
- for param in parameters))
-
- self._parameters = params
- self._return_annotation = return_annotation
-
- @classmethod
- def from_function(cls, func):
- '''Constructs Signature for the given python function'''
-
- if not isinstance(func, types.FunctionType):
- raise TypeError('{0!r} is not a Python function'.format(func))
-
- Parameter = cls._parameter_cls
-
- # Parameter information.
- func_code = func.__code__
- pos_count = func_code.co_argcount
- arg_names = func_code.co_varnames
- positional = tuple(arg_names[:pos_count])
- keyword_only_count = getattr(func_code, 'co_kwonlyargcount', 0)
- keyword_only = arg_names[pos_count:(pos_count + keyword_only_count)]
- annotations = getattr(func, '__annotations__', {})
- defaults = func.__defaults__
- kwdefaults = getattr(func, '__kwdefaults__', None)
-
- if defaults:
- pos_default_count = len(defaults)
- else:
- pos_default_count = 0
-
- parameters = []
-
- # Non-keyword-only parameters w/o defaults.
- non_default_count = pos_count - pos_default_count
- for name in positional[:non_default_count]:
- annotation = annotations.get(name, _empty)
- parameters.append(Parameter(name, annotation=annotation,
- kind=_POSITIONAL_OR_KEYWORD))
-
- # ... w/ defaults.
- for offset, name in enumerate(positional[non_default_count:]):
- annotation = annotations.get(name, _empty)
- parameters.append(Parameter(name, annotation=annotation,
- kind=_POSITIONAL_OR_KEYWORD,
- default=defaults[offset]))
-
- # *args
- if func_code.co_flags & 0x04:
- name = arg_names[pos_count + keyword_only_count]
- annotation = annotations.get(name, _empty)
- parameters.append(Parameter(name, annotation=annotation,
- kind=_VAR_POSITIONAL))
-
- # Keyword-only parameters.
- for name in keyword_only:
- default = _empty
- if kwdefaults is not None:
- default = kwdefaults.get(name, _empty)
-
- annotation = annotations.get(name, _empty)
- parameters.append(Parameter(name, annotation=annotation,
- kind=_KEYWORD_ONLY,
- default=default))
- # **kwargs
- if func_code.co_flags & 0x08:
- index = pos_count + keyword_only_count
- if func_code.co_flags & 0x04:
- index += 1
-
- name = arg_names[index]
- annotation = annotations.get(name, _empty)
- parameters.append(Parameter(name, annotation=annotation,
- kind=_VAR_KEYWORD))
-
- return cls(parameters,
- return_annotation=annotations.get('return', _empty),
- __validate_parameters__=False)
-
- @property
- def parameters(self):
- try:
- return types.MappingProxyType(self._parameters)
- except AttributeError:
- return OrderedDict(self._parameters.items())
-
- @property
- def return_annotation(self):
- return self._return_annotation
-
- def replace(self, parameters=_void, return_annotation=_void):
- '''Creates a customized copy of the Signature.
- Pass 'parameters' and/or 'return_annotation' arguments
- to override them in the new copy.
- '''
-
- if parameters is _void:
- parameters = self.parameters.values()
-
- if return_annotation is _void:
- return_annotation = self._return_annotation
-
- return type(self)(parameters,
- return_annotation=return_annotation)
-
- def __hash__(self):
- msg = "unhashable type: '{0}'".format(self.__class__.__name__)
- raise TypeError(msg)
-
- def __eq__(self, other):
- if (not issubclass(type(other), Signature) or
- self.return_annotation != other.return_annotation or
- len(self.parameters) != len(other.parameters)):
- return False
-
- other_positions = dict((param, idx)
- for idx, param in enumerate(other.parameters.keys()))
-
- for idx, (param_name, param) in enumerate(self.parameters.items()):
- if param.kind == _KEYWORD_ONLY:
- try:
- other_param = other.parameters[param_name]
- except KeyError:
- return False
- else:
- if param != other_param:
- return False
- else:
- try:
- other_idx = other_positions[param_name]
- except KeyError:
- return False
- else:
- if (idx != other_idx or
- param != other.parameters[param_name]):
- return False
-
- return True
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
- def _bind(self, args, kwargs, partial=False):
- '''Private method. Don't use directly.'''
-
- arguments = OrderedDict()
-
- parameters = iter(self.parameters.values())
- parameters_ex = ()
- arg_vals = iter(args)
-
- if partial:
- # Support for binding arguments to 'functools.partial' objects.
- # See 'functools.partial' case in 'signature()' implementation
- # for details.
- for param_name, param in self.parameters.items():
- if (param._partial_kwarg and param_name not in kwargs):
- # Simulating 'functools.partial' behavior
- kwargs[param_name] = param.default
-
- while True:
- # Let's iterate through the positional arguments and corresponding
- # parameters
- try:
- arg_val = next(arg_vals)
- except StopIteration:
- # No more positional arguments
- try:
- param = next(parameters)
- except StopIteration:
- # No more parameters. That's it. Just need to check that
- # we have no `kwargs` after this while loop
- break
- else:
- if param.kind == _VAR_POSITIONAL:
- # That's OK, just empty *args. Let's start parsing
- # kwargs
- break
- elif param.name in kwargs:
- if param.kind == _POSITIONAL_ONLY:
- msg = '{arg!r} parameter is positional only, ' \
- 'but was passed as a keyword'
- msg = msg.format(arg=param.name)
- raise TypeError(msg)
- parameters_ex = (param,)
- break
- elif (param.kind == _VAR_KEYWORD or
- param.default is not _empty):
- # That's fine too - we have a default value for this
- # parameter. So, lets start parsing `kwargs`, starting
- # with the current parameter
- parameters_ex = (param,)
- break
- else:
- if partial:
- parameters_ex = (param,)
- break
- else:
- msg = '{arg!r} parameter lacking default value'
- msg = msg.format(arg=param.name)
- raise TypeError(msg)
- else:
- # We have a positional argument to process
- try:
- param = next(parameters)
- except StopIteration:
- raise TypeError('too many positional arguments')
- else:
- if param.kind in (_VAR_KEYWORD, _KEYWORD_ONLY):
- # Looks like we have no parameter for this positional
- # argument
- raise TypeError('too many positional arguments')
-
- if param.kind == _VAR_POSITIONAL:
- # We have an '*args'-like argument, let's fill it with
- # all positional arguments we have left and move on to
- # the next phase
- values = [arg_val]
- values.extend(arg_vals)
- arguments[param.name] = tuple(values)
- break
-
- if param.name in kwargs:
- raise TypeError('multiple values for argument '
- '{arg!r}'.format(arg=param.name))
-
- arguments[param.name] = arg_val
-
- # Now, we iterate through the remaining parameters to process
- # keyword arguments
- kwargs_param = None
- for param in itertools.chain(parameters_ex, parameters):
- if param.kind == _POSITIONAL_ONLY:
- # This should never happen in case of a properly built
- # Signature object (but let's have this check here
- # to ensure correct behaviour just in case)
- raise TypeError('{arg!r} parameter is positional only, '
- 'but was passed as a keyword'. \
- format(arg=param.name))
-
- if param.kind == _VAR_KEYWORD:
- # Memorize that we have a '**kwargs'-like parameter
- kwargs_param = param
- continue
-
- param_name = param.name
- try:
- arg_val = kwargs.pop(param_name)
- except KeyError:
- # We have no value for this parameter. It's fine though,
- # if it has a default value, or it is an '*args'-like
- # parameter, left alone by the processing of positional
- # arguments.
- if (not partial and param.kind != _VAR_POSITIONAL and
- param.default is _empty):
- raise TypeError('{arg!r} parameter lacking default value'. \
- format(arg=param_name))
-
- else:
- arguments[param_name] = arg_val
-
- if kwargs:
- if kwargs_param is not None:
- # Process our '**kwargs'-like parameter
- arguments[kwargs_param.name] = kwargs
- else:
- raise TypeError('too many keyword arguments %r' % kwargs)
-
- return self._bound_arguments_cls(self, arguments)
-
- def bind(*args, **kwargs):
- '''Get a BoundArguments object, that maps the passed `args`
- and `kwargs` to the function's signature. Raises `TypeError`
- if the passed arguments can not be bound.
- '''
- return args[0]._bind(args[1:], kwargs)
-
- def bind_partial(self, *args, **kwargs):
- '''Get a BoundArguments object, that partially maps the
- passed `args` and `kwargs` to the function's signature.
- Raises `TypeError` if the passed arguments can not be bound.
- '''
- return self._bind(args, kwargs, partial=True)
-
- def __str__(self):
- result = []
- render_kw_only_separator = True
- for idx, param in enumerate(self.parameters.values()):
- formatted = str(param)
-
- kind = param.kind
- if kind == _VAR_POSITIONAL:
- # OK, we have an '*args'-like parameter, so we won't need
- # a '*' to separate keyword-only arguments
- render_kw_only_separator = False
- elif kind == _KEYWORD_ONLY and render_kw_only_separator:
- # We have a keyword-only parameter to render and we haven't
- # rendered an '*args'-like parameter before, so add a '*'
- # separator to the parameters list ("foo(arg1, *, arg2)" case)
- result.append('*')
- # This condition should be only triggered once, so
- # reset the flag
- render_kw_only_separator = False
-
- result.append(formatted)
-
- rendered = '({0})'.format(', '.join(result))
-
- if self.return_annotation is not _empty:
- anno = formatannotation(self.return_annotation)
- rendered += ' -> {0}'.format(anno)
-
- return rendered
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/funcsigs/version.py b/tests/wpt/tests/tools/third_party/funcsigs/funcsigs/version.py
deleted file mode 100644
index 7863915fa5f..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/funcsigs/version.py
+++ /dev/null
@@ -1 +0,0 @@
-__version__ = "1.0.2"
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/requirements/development.txt b/tests/wpt/tests/tools/third_party/funcsigs/requirements/development.txt
deleted file mode 100644
index 40dedd92bf0..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/requirements/development.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-coverage
-coveralls
-flake8
-sphinx
-unittest2
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/setup.cfg b/tests/wpt/tests/tools/third_party/funcsigs/setup.cfg
deleted file mode 100644
index 5e4090017a9..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/setup.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[wheel]
-universal = 1
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/setup.py b/tests/wpt/tests/tools/third_party/funcsigs/setup.py
deleted file mode 100644
index f3696888f9e..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/setup.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env python
-from setuptools import setup
-import re
-import sys
-
-def load_version(filename='funcsigs/version.py'):
- "Parse a __version__ number from a source file"
- with open(filename) as source:
- text = source.read()
- match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", text)
- if not match:
- msg = "Unable to find version number in {}".format(filename)
- raise RuntimeError(msg)
- version = match.group(1)
- return version
-
-
-setup(
- name="funcsigs",
- version=load_version(),
- packages=['funcsigs'],
- zip_safe=False,
- author="Testing Cabal",
- author_email="testing-in-python@lists.idyll.org",
- url="http://funcsigs.readthedocs.org",
- description="Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2+",
- long_description=open('README.rst').read(),
- license="ASL",
- extras_require = {
- ':python_version<"2.7"': ['ordereddict'],
- },
- setup_requires = ["setuptools>=17.1"],
- classifiers = [
- 'Development Status :: 4 - Beta',
- 'Intended Audience :: Developers',
- 'License :: OSI Approved :: Apache Software License',
- 'Operating System :: OS Independent',
- 'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.6',
- 'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.3',
- 'Programming Language :: Python :: 3.4',
- 'Programming Language :: Python :: 3.5',
- 'Programming Language :: Python :: Implementation :: CPython',
- 'Programming Language :: Python :: Implementation :: PyPy',
- 'Topic :: Software Development :: Libraries :: Python Modules'
- ],
- tests_require = ['unittest2'],
- test_suite = 'unittest2.collector',
-)
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/tests/__init__.py b/tests/wpt/tests/tools/third_party/funcsigs/tests/__init__.py
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/tests/test_formatannotation.py b/tests/wpt/tests/tools/third_party/funcsigs/tests/test_formatannotation.py
deleted file mode 100644
index 4b98e6037d8..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/tests/test_formatannotation.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import funcsigs
-
-import unittest2 as unittest
-
-class TestFormatAnnotation(unittest.TestCase):
- def test_string (self):
- self.assertEqual(funcsigs.formatannotation("annotation"),
- "'annotation'")
-
- def test_builtin_type (self):
- self.assertEqual(funcsigs.formatannotation(int),
- "int")
-
- def test_user_type (self):
- class dummy (object): pass
- self.assertEqual(funcsigs.formatannotation(dummy),
- "tests.test_formatannotation.dummy")
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/tests/test_funcsigs.py b/tests/wpt/tests/tools/third_party/funcsigs/tests/test_funcsigs.py
deleted file mode 100644
index a7b9cca7679..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/tests/test_funcsigs.py
+++ /dev/null
@@ -1,91 +0,0 @@
-import unittest2 as unittest
-
-import doctest
-import sys
-
-import funcsigs as inspect
-
-
-class TestFunctionSignatures(unittest.TestCase):
-
- @staticmethod
- def signature(func):
- sig = inspect.signature(func)
- return (tuple((param.name,
- (Ellipsis if param.default is param.empty else param.default),
- (Ellipsis if param.annotation is param.empty
- else param.annotation),
- str(param.kind).lower())
- for param in sig.parameters.values()),
- (Ellipsis if sig.return_annotation is sig.empty
- else sig.return_annotation))
-
- def test_zero_arguments(self):
- def test():
- pass
- self.assertEqual(self.signature(test),
- ((), Ellipsis))
-
- def test_single_positional_argument(self):
- def test(a):
- pass
- self.assertEqual(self.signature(test),
- (((('a', Ellipsis, Ellipsis, "positional_or_keyword")),), Ellipsis))
-
- def test_single_keyword_argument(self):
- def test(a=None):
- pass
- self.assertEqual(self.signature(test),
- (((('a', None, Ellipsis, "positional_or_keyword")),), Ellipsis))
-
- def test_var_args(self):
- def test(*args):
- pass
- self.assertEqual(self.signature(test),
- (((('args', Ellipsis, Ellipsis, "var_positional")),), Ellipsis))
-
- def test_keywords_args(self):
- def test(**kwargs):
- pass
- self.assertEqual(self.signature(test),
- (((('kwargs', Ellipsis, Ellipsis, "var_keyword")),), Ellipsis))
-
- def test_multiple_arguments(self):
- def test(a, b=None, *args, **kwargs):
- pass
- self.assertEqual(self.signature(test), ((
- ('a', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('b', None, Ellipsis, "positional_or_keyword"),
- ('args', Ellipsis, Ellipsis, "var_positional"),
- ('kwargs', Ellipsis, Ellipsis, "var_keyword"),
- ), Ellipsis))
-
- def test_has_version(self):
- self.assertTrue(inspect.__version__)
-
- def test_readme(self):
- # XXX: This fails but doesn't fail the build.
- # (and the syntax isn't valid on all pythons so that seems a little
- # hard to get right.
- doctest.testfile('../README.rst')
-
- def test_unbound_method(self):
- self_kind = "positional_or_keyword"
- class Test(object):
- def method(self):
- pass
- def method_with_args(self, a):
- pass
- def method_with_varargs(*args):
- pass
- self.assertEqual(
- self.signature(Test.method),
- (((('self', Ellipsis, Ellipsis, self_kind)),), Ellipsis))
- self.assertEqual(
- self.signature(Test.method_with_args),
- ((('self', Ellipsis, Ellipsis, self_kind),
- ('a', Ellipsis, Ellipsis, "positional_or_keyword"),
- ), Ellipsis))
- self.assertEqual(
- self.signature(Test.method_with_varargs),
- ((('args', Ellipsis, Ellipsis, "var_positional"),), Ellipsis))
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/tests/test_inspect.py b/tests/wpt/tests/tools/third_party/funcsigs/tests/test_inspect.py
deleted file mode 100644
index 98d6592fcc7..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/tests/test_inspect.py
+++ /dev/null
@@ -1,1002 +0,0 @@
-# Copyright 2001-2013 Python Software Foundation; All Rights Reserved
-from __future__ import absolute_import, division, print_function
-import collections
-import functools
-import sys
-
-import unittest2 as unittest
-
-import funcsigs as inspect
-
-
-class TestSignatureObject(unittest.TestCase):
- @staticmethod
- def signature(func):
- sig = inspect.signature(func)
- return (tuple((param.name,
- (Ellipsis if param.default is param.empty else param.default),
- (Ellipsis if param.annotation is param.empty
- else param.annotation),
- str(param.kind).lower())
- for param in sig.parameters.values()),
- (Ellipsis if sig.return_annotation is sig.empty
- else sig.return_annotation))
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_object(self):
- S = inspect.Signature
- P = inspect.Parameter
-
- self.assertEqual(str(S()), '()')
-
- def test(po, pk, *args, ko, **kwargs):
- pass
- sig = inspect.signature(test)
- po = sig.parameters['po'].replace(kind=P.POSITIONAL_ONLY)
- pk = sig.parameters['pk']
- args = sig.parameters['args']
- ko = sig.parameters['ko']
- kwargs = sig.parameters['kwargs']
-
- S((po, pk, args, ko, kwargs))
-
- with self.assertRaisesRegex(ValueError, 'wrong parameter order'):
- S((pk, po, args, ko, kwargs))
-
- with self.assertRaisesRegex(ValueError, 'wrong parameter order'):
- S((po, args, pk, ko, kwargs))
-
- with self.assertRaisesRegex(ValueError, 'wrong parameter order'):
- S((args, po, pk, ko, kwargs))
-
- with self.assertRaisesRegex(ValueError, 'wrong parameter order'):
- S((po, pk, args, kwargs, ko))
-
- kwargs2 = kwargs.replace(name='args')
- with self.assertRaisesRegex(ValueError, 'duplicate parameter name'):
- S((po, pk, args, kwargs2, ko))
-""")
-
- def test_signature_immutability(self):
- def test(a):
- pass
- sig = inspect.signature(test)
-
- with self.assertRaises(AttributeError):
- sig.foo = 'bar'
-
- # Python2 does not have MappingProxyType class
- if sys.version_info[:2] < (3, 3):
- return
-
- with self.assertRaises(TypeError):
- sig.parameters['a'] = None
-
- def test_signature_on_noarg(self):
- def test():
- pass
- self.assertEqual(self.signature(test), ((), Ellipsis))
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_on_wargs(self):
- def test(a, b:'foo') -> 123:
- pass
- self.assertEqual(self.signature(test),
- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('b', Ellipsis, 'foo', "positional_or_keyword")),
- 123))
-""")
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_on_wkwonly(self):
- def test(*, a:float, b:str) -> int:
- pass
- self.assertEqual(self.signature(test),
- ((('a', Ellipsis, float, "keyword_only"),
- ('b', Ellipsis, str, "keyword_only")),
- int))
-""")
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_on_complex_args(self):
- def test(a, b:'foo'=10, *args:'bar', spam:'baz', ham=123, **kwargs:int):
- pass
- self.assertEqual(self.signature(test),
- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('b', 10, 'foo', "positional_or_keyword"),
- ('args', Ellipsis, 'bar', "var_positional"),
- ('spam', Ellipsis, 'baz', "keyword_only"),
- ('ham', 123, Ellipsis, "keyword_only"),
- ('kwargs', Ellipsis, int, "var_keyword")),
- Ellipsis))
-""")
-
- def test_signature_on_builtin_function(self):
- with self.assertRaisesRegex(ValueError, 'not supported by signature'):
- inspect.signature(type)
- with self.assertRaisesRegex(ValueError, 'not supported by signature'):
- # support for 'wrapper_descriptor'
- inspect.signature(type.__call__)
- if hasattr(sys, 'pypy_version_info'):
- raise ValueError('not supported by signature')
- with self.assertRaisesRegex(ValueError, 'not supported by signature'):
- # support for 'method-wrapper'
- inspect.signature(min.__call__)
- if hasattr(sys, 'pypy_version_info'):
- raise ValueError('not supported by signature')
- with self.assertRaisesRegex(ValueError,
- 'no signature found for builtin function'):
- # support for 'method-wrapper'
- inspect.signature(min)
-
- def test_signature_on_non_function(self):
- with self.assertRaisesRegex(TypeError, 'is not a callable object'):
- inspect.signature(42)
-
- with self.assertRaisesRegex(TypeError, 'is not a Python function'):
- inspect.Signature.from_function(42)
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_on_method(self):
- class Test:
- def foo(self, arg1, arg2=1) -> int:
- pass
-
- meth = Test().foo
-
- self.assertEqual(self.signature(meth),
- ((('arg1', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('arg2', 1, Ellipsis, "positional_or_keyword")),
- int))
-""")
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_on_classmethod(self):
- class Test:
- @classmethod
- def foo(cls, arg1, *, arg2=1):
- pass
-
- meth = Test().foo
- self.assertEqual(self.signature(meth),
- ((('arg1', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('arg2', 1, Ellipsis, "keyword_only")),
- Ellipsis))
-
- meth = Test.foo
- self.assertEqual(self.signature(meth),
- ((('arg1', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('arg2', 1, Ellipsis, "keyword_only")),
- Ellipsis))
-""")
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_on_staticmethod(self):
- class Test:
- @staticmethod
- def foo(cls, *, arg):
- pass
-
- meth = Test().foo
- self.assertEqual(self.signature(meth),
- ((('cls', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('arg', Ellipsis, Ellipsis, "keyword_only")),
- Ellipsis))
-
- meth = Test.foo
- self.assertEqual(self.signature(meth),
- ((('cls', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('arg', Ellipsis, Ellipsis, "keyword_only")),
- Ellipsis))
-""")
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_on_partial(self):
- from functools import partial
-
- def test():
- pass
-
- self.assertEqual(self.signature(partial(test)), ((), Ellipsis))
-
- with self.assertRaisesRegex(ValueError, "has incorrect arguments"):
- inspect.signature(partial(test, 1))
-
- with self.assertRaisesRegex(ValueError, "has incorrect arguments"):
- inspect.signature(partial(test, a=1))
-
- def test(a, b, *, c, d):
- pass
-
- self.assertEqual(self.signature(partial(test)),
- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('b', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('c', Ellipsis, Ellipsis, "keyword_only"),
- ('d', Ellipsis, Ellipsis, "keyword_only")),
- Ellipsis))
-
- self.assertEqual(self.signature(partial(test, 1)),
- ((('b', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('c', Ellipsis, Ellipsis, "keyword_only"),
- ('d', Ellipsis, Ellipsis, "keyword_only")),
- Ellipsis))
-
- self.assertEqual(self.signature(partial(test, 1, c=2)),
- ((('b', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('c', 2, Ellipsis, "keyword_only"),
- ('d', Ellipsis, Ellipsis, "keyword_only")),
- Ellipsis))
-
- self.assertEqual(self.signature(partial(test, b=1, c=2)),
- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('b', 1, Ellipsis, "positional_or_keyword"),
- ('c', 2, Ellipsis, "keyword_only"),
- ('d', Ellipsis, Ellipsis, "keyword_only")),
- Ellipsis))
-
- self.assertEqual(self.signature(partial(test, 0, b=1, c=2)),
- ((('b', 1, Ellipsis, "positional_or_keyword"),
- ('c', 2, Ellipsis, "keyword_only"),
- ('d', Ellipsis, Ellipsis, "keyword_only"),),
- Ellipsis))
-
- def test(a, *args, b, **kwargs):
- pass
-
- self.assertEqual(self.signature(partial(test, 1)),
- ((('args', Ellipsis, Ellipsis, "var_positional"),
- ('b', Ellipsis, Ellipsis, "keyword_only"),
- ('kwargs', Ellipsis, Ellipsis, "var_keyword")),
- Ellipsis))
-
- self.assertEqual(self.signature(partial(test, 1, 2, 3)),
- ((('args', Ellipsis, Ellipsis, "var_positional"),
- ('b', Ellipsis, Ellipsis, "keyword_only"),
- ('kwargs', Ellipsis, Ellipsis, "var_keyword")),
- Ellipsis))
-
-
- self.assertEqual(self.signature(partial(test, 1, 2, 3, test=True)),
- ((('args', Ellipsis, Ellipsis, "var_positional"),
- ('b', Ellipsis, Ellipsis, "keyword_only"),
- ('kwargs', Ellipsis, Ellipsis, "var_keyword")),
- Ellipsis))
-
- self.assertEqual(self.signature(partial(test, 1, 2, 3, test=1, b=0)),
- ((('args', Ellipsis, Ellipsis, "var_positional"),
- ('b', 0, Ellipsis, "keyword_only"),
- ('kwargs', Ellipsis, Ellipsis, "var_keyword")),
- Ellipsis))
-
- self.assertEqual(self.signature(partial(test, b=0)),
- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('args', Ellipsis, Ellipsis, "var_positional"),
- ('b', 0, Ellipsis, "keyword_only"),
- ('kwargs', Ellipsis, Ellipsis, "var_keyword")),
- Ellipsis))
-
- self.assertEqual(self.signature(partial(test, b=0, test=1)),
- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('args', Ellipsis, Ellipsis, "var_positional"),
- ('b', 0, Ellipsis, "keyword_only"),
- ('kwargs', Ellipsis, Ellipsis, "var_keyword")),
- Ellipsis))
-
- def test(a, b, c:int) -> 42:
- pass
-
- sig = test.__signature__ = inspect.signature(test)
-
- self.assertEqual(self.signature(partial(partial(test, 1))),
- ((('b', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('c', Ellipsis, int, "positional_or_keyword")),
- 42))
-
- self.assertEqual(self.signature(partial(partial(test, 1), 2)),
- ((('c', Ellipsis, int, "positional_or_keyword"),),
- 42))
-
- psig = inspect.signature(partial(partial(test, 1), 2))
-
- def foo(a):
- return a
- _foo = partial(partial(foo, a=10), a=20)
- self.assertEqual(self.signature(_foo),
- ((('a', 20, Ellipsis, "positional_or_keyword"),),
- Ellipsis))
- # check that we don't have any side-effects in signature(),
- # and the partial object is still functioning
- self.assertEqual(_foo(), 20)
-
- def foo(a, b, c):
- return a, b, c
- _foo = partial(partial(foo, 1, b=20), b=30)
- self.assertEqual(self.signature(_foo),
- ((('b', 30, Ellipsis, "positional_or_keyword"),
- ('c', Ellipsis, Ellipsis, "positional_or_keyword")),
- Ellipsis))
- self.assertEqual(_foo(c=10), (1, 30, 10))
- _foo = partial(_foo, 2) # now 'b' has two values -
- # positional and keyword
- with self.assertRaisesRegex(ValueError, "has incorrect arguments"):
- inspect.signature(_foo)
-
- def foo(a, b, c, *, d):
- return a, b, c, d
- _foo = partial(partial(foo, d=20, c=20), b=10, d=30)
- self.assertEqual(self.signature(_foo),
- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('b', 10, Ellipsis, "positional_or_keyword"),
- ('c', 20, Ellipsis, "positional_or_keyword"),
- ('d', 30, Ellipsis, "keyword_only")),
- Ellipsis))
- ba = inspect.signature(_foo).bind(a=200, b=11)
- self.assertEqual(_foo(*ba.args, **ba.kwargs), (200, 11, 20, 30))
-
- def foo(a=1, b=2, c=3):
- return a, b, c
- _foo = partial(foo, a=10, c=13)
- ba = inspect.signature(_foo).bind(11)
- self.assertEqual(_foo(*ba.args, **ba.kwargs), (11, 2, 13))
- ba = inspect.signature(_foo).bind(11, 12)
- self.assertEqual(_foo(*ba.args, **ba.kwargs), (11, 12, 13))
- ba = inspect.signature(_foo).bind(11, b=12)
- self.assertEqual(_foo(*ba.args, **ba.kwargs), (11, 12, 13))
- ba = inspect.signature(_foo).bind(b=12)
- self.assertEqual(_foo(*ba.args, **ba.kwargs), (10, 12, 13))
- _foo = partial(_foo, b=10)
- ba = inspect.signature(_foo).bind(12, 14)
- self.assertEqual(_foo(*ba.args, **ba.kwargs), (12, 14, 13))
-""")
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_on_decorated(self):
- import functools
-
- def decorator(func):
- @functools.wraps(func)
- def wrapper(*args, **kwargs) -> int:
- return func(*args, **kwargs)
- return wrapper
-
- class Foo:
- @decorator
- def bar(self, a, b):
- pass
-
- self.assertEqual(self.signature(Foo.bar),
- ((('self', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('a', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('b', Ellipsis, Ellipsis, "positional_or_keyword")),
- Ellipsis))
-
- self.assertEqual(self.signature(Foo().bar),
- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('b', Ellipsis, Ellipsis, "positional_or_keyword")),
- Ellipsis))
-
- # Test that we handle method wrappers correctly
- def decorator(func):
- @functools.wraps(func)
- def wrapper(*args, **kwargs) -> int:
- return func(42, *args, **kwargs)
- sig = inspect.signature(func)
- new_params = tuple(sig.parameters.values())[1:]
- wrapper.__signature__ = sig.replace(parameters=new_params)
- return wrapper
-
- class Foo:
- @decorator
- def __call__(self, a, b):
- pass
-
- self.assertEqual(self.signature(Foo.__call__),
- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('b', Ellipsis, Ellipsis, "positional_or_keyword")),
- Ellipsis))
-
- self.assertEqual(self.signature(Foo().__call__),
- ((('b', Ellipsis, Ellipsis, "positional_or_keyword"),),
- Ellipsis))
-""")
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_on_class(self):
- class C:
- def __init__(self, a):
- pass
-
- self.assertEqual(self.signature(C),
- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),),
- Ellipsis))
-
- class CM(type):
- def __call__(cls, a):
- pass
- class C(metaclass=CM):
- def __init__(self, b):
- pass
-
- self.assertEqual(self.signature(C),
- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),),
- Ellipsis))
-
- class CM(type):
- def __new__(mcls, name, bases, dct, *, foo=1):
- return super().__new__(mcls, name, bases, dct)
- class C(metaclass=CM):
- def __init__(self, b):
- pass
-
- self.assertEqual(self.signature(C),
- ((('b', Ellipsis, Ellipsis, "positional_or_keyword"),),
- Ellipsis))
-
- self.assertEqual(self.signature(CM),
- ((('name', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('bases', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('dct', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('foo', 1, Ellipsis, "keyword_only")),
- Ellipsis))
-
- class CMM(type):
- def __new__(mcls, name, bases, dct, *, foo=1):
- return super().__new__(mcls, name, bases, dct)
- def __call__(cls, nm, bs, dt):
- return type(nm, bs, dt)
- class CM(type, metaclass=CMM):
- def __new__(mcls, name, bases, dct, *, bar=2):
- return super().__new__(mcls, name, bases, dct)
- class C(metaclass=CM):
- def __init__(self, b):
- pass
-
- self.assertEqual(self.signature(CMM),
- ((('name', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('bases', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('dct', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('foo', 1, Ellipsis, "keyword_only")),
- Ellipsis))
-
- self.assertEqual(self.signature(CM),
- ((('nm', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('bs', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('dt', Ellipsis, Ellipsis, "positional_or_keyword")),
- Ellipsis))
-
- self.assertEqual(self.signature(C),
- ((('b', Ellipsis, Ellipsis, "positional_or_keyword"),),
- Ellipsis))
-
- class CM(type):
- def __init__(cls, name, bases, dct, *, bar=2):
- return super().__init__(name, bases, dct)
- class C(metaclass=CM):
- def __init__(self, b):
- pass
-
- self.assertEqual(self.signature(CM),
- ((('name', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('bases', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('dct', Ellipsis, Ellipsis, "positional_or_keyword"),
- ('bar', 2, Ellipsis, "keyword_only")),
- Ellipsis))
-""")
-
- def test_signature_on_callable_objects(self):
- class Foo(object):
- def __call__(self, a):
- pass
-
- self.assertEqual(self.signature(Foo()),
- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),),
- Ellipsis))
-
- class Spam(object):
- pass
- with self.assertRaisesRegex(TypeError, "is not a callable object"):
- inspect.signature(Spam())
-
- class Bar(Spam, Foo):
- pass
-
- self.assertEqual(self.signature(Bar()),
- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),),
- Ellipsis))
-
- class ToFail(object):
- __call__ = type
- with self.assertRaisesRegex(ValueError, "not supported by signature"):
- inspect.signature(ToFail())
-
- if sys.version_info[0] < 3:
- return
-
- class Wrapped(object):
- pass
- Wrapped.__wrapped__ = lambda a: None
- self.assertEqual(self.signature(Wrapped),
- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),),
- Ellipsis))
-
- def test_signature_on_lambdas(self):
- self.assertEqual(self.signature((lambda a=10: a)),
- ((('a', 10, Ellipsis, "positional_or_keyword"),),
- Ellipsis))
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_equality(self):
- def foo(a, *, b:int) -> float: pass
- self.assertNotEqual(inspect.signature(foo), 42)
-
- def bar(a, *, b:int) -> float: pass
- self.assertEqual(inspect.signature(foo), inspect.signature(bar))
-
- def bar(a, *, b:int) -> int: pass
- self.assertNotEqual(inspect.signature(foo), inspect.signature(bar))
-
- def bar(a, *, b:int): pass
- self.assertNotEqual(inspect.signature(foo), inspect.signature(bar))
-
- def bar(a, *, b:int=42) -> float: pass
- self.assertNotEqual(inspect.signature(foo), inspect.signature(bar))
-
- def bar(a, *, c) -> float: pass
- self.assertNotEqual(inspect.signature(foo), inspect.signature(bar))
-
- def bar(a, b:int) -> float: pass
- self.assertNotEqual(inspect.signature(foo), inspect.signature(bar))
- def spam(b:int, a) -> float: pass
- self.assertNotEqual(inspect.signature(spam), inspect.signature(bar))
-
- def foo(*, a, b, c): pass
- def bar(*, c, b, a): pass
- self.assertEqual(inspect.signature(foo), inspect.signature(bar))
-
- def foo(*, a=1, b, c): pass
- def bar(*, c, b, a=1): pass
- self.assertEqual(inspect.signature(foo), inspect.signature(bar))
-
- def foo(pos, *, a=1, b, c): pass
- def bar(pos, *, c, b, a=1): pass
- self.assertEqual(inspect.signature(foo), inspect.signature(bar))
-
- def foo(pos, *, a, b, c): pass
- def bar(pos, *, c, b, a=1): pass
- self.assertNotEqual(inspect.signature(foo), inspect.signature(bar))
-
- def foo(pos, *args, a=42, b, c, **kwargs:int): pass
- def bar(pos, *args, c, b, a=42, **kwargs:int): pass
- self.assertEqual(inspect.signature(foo), inspect.signature(bar))
-""")
-
- def test_signature_unhashable(self):
- def foo(a): pass
- sig = inspect.signature(foo)
- with self.assertRaisesRegex(TypeError, 'unhashable type'):
- hash(sig)
-
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_str(self):
- def foo(a:int=1, *, b, c=None, **kwargs) -> 42:
- pass
- self.assertEqual(str(inspect.signature(foo)),
- '(a:int=1, *, b, c=None, **kwargs) -> 42')
-
- def foo(a:int=1, *args, b, c=None, **kwargs) -> 42:
- pass
- self.assertEqual(str(inspect.signature(foo)),
- '(a:int=1, *args, b, c=None, **kwargs) -> 42')
-
- def foo():
- pass
- self.assertEqual(str(inspect.signature(foo)), '()')
-""")
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_str_positional_only(self):
- P = inspect.Parameter
-
- def test(a_po, *, b, **kwargs):
- return a_po, kwargs
-
- sig = inspect.signature(test)
- new_params = list(sig.parameters.values())
- new_params[0] = new_params[0].replace(kind=P.POSITIONAL_ONLY)
- test.__signature__ = sig.replace(parameters=new_params)
-
- self.assertEqual(str(inspect.signature(test)),
- '(, *, b, **kwargs)')
-
- sig = inspect.signature(test)
- new_params = list(sig.parameters.values())
- new_params[0] = new_params[0].replace(name=None)
- test.__signature__ = sig.replace(parameters=new_params)
- self.assertEqual(str(inspect.signature(test)),
- '(<0>, *, b, **kwargs)')
-""")
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_replace_anno(self):
- def test() -> 42:
- pass
-
- sig = inspect.signature(test)
- sig = sig.replace(return_annotation=None)
- self.assertIs(sig.return_annotation, None)
- sig = sig.replace(return_annotation=sig.empty)
- self.assertIs(sig.return_annotation, sig.empty)
- sig = sig.replace(return_annotation=42)
- self.assertEqual(sig.return_annotation, 42)
- self.assertEqual(sig, inspect.signature(test))
-""")
-
-
-class TestParameterObject(unittest.TestCase):
-
- def test_signature_parameter_kinds(self):
- P = inspect.Parameter
- self.assertTrue(P.POSITIONAL_ONLY < P.POSITIONAL_OR_KEYWORD < \
- P.VAR_POSITIONAL < P.KEYWORD_ONLY < P.VAR_KEYWORD)
-
- self.assertEqual(str(P.POSITIONAL_ONLY), 'POSITIONAL_ONLY')
- self.assertTrue('POSITIONAL_ONLY' in repr(P.POSITIONAL_ONLY))
-
- def test_signature_parameter_object(self):
- p = inspect.Parameter('foo', default=10,
- kind=inspect.Parameter.POSITIONAL_ONLY)
- self.assertEqual(p.name, 'foo')
- self.assertEqual(p.default, 10)
- self.assertIs(p.annotation, p.empty)
- self.assertEqual(p.kind, inspect.Parameter.POSITIONAL_ONLY)
-
- with self.assertRaisesRegex(ValueError, 'invalid value'):
- inspect.Parameter('foo', default=10, kind='123')
-
- with self.assertRaisesRegex(ValueError, 'not a valid parameter name'):
- inspect.Parameter('1', kind=inspect.Parameter.VAR_KEYWORD)
-
- with self.assertRaisesRegex(ValueError,
- 'non-positional-only parameter'):
- inspect.Parameter(None, kind=inspect.Parameter.VAR_KEYWORD)
-
- with self.assertRaisesRegex(ValueError, 'cannot have default values'):
- inspect.Parameter('a', default=42,
- kind=inspect.Parameter.VAR_KEYWORD)
-
- with self.assertRaisesRegex(ValueError, 'cannot have default values'):
- inspect.Parameter('a', default=42,
- kind=inspect.Parameter.VAR_POSITIONAL)
-
- p = inspect.Parameter('a', default=42,
- kind=inspect.Parameter.POSITIONAL_OR_KEYWORD)
- with self.assertRaisesRegex(ValueError, 'cannot have default values'):
- p.replace(kind=inspect.Parameter.VAR_POSITIONAL)
-
- self.assertTrue(repr(p).startswith('')
-
- p = p.replace(name='1')
- self.assertEqual(str(p), '<1>')
-
- def test_signature_parameter_immutability(self):
- p = inspect.Parameter(None, kind=inspect.Parameter.POSITIONAL_ONLY)
-
- with self.assertRaises(AttributeError):
- p.foo = 'bar'
-
- with self.assertRaises(AttributeError):
- p.kind = 123
-
-
-class TestSignatureBind(unittest.TestCase):
- @staticmethod
- def call(func, *args, **kwargs):
- sig = inspect.signature(func)
- ba = sig.bind(*args, **kwargs)
- return func(*ba.args, **ba.kwargs)
-
- def test_signature_bind_empty(self):
- def test():
- return 42
-
- self.assertEqual(self.call(test), 42)
- with self.assertRaisesRegex(TypeError, 'too many positional arguments'):
- self.call(test, 1)
- with self.assertRaisesRegex(TypeError, 'too many positional arguments'):
- self.call(test, 1, spam=10)
- with self.assertRaisesRegex(TypeError, 'too many keyword arguments'):
- self.call(test, spam=1)
-
- def test_signature_bind_var(self):
- def test(*args, **kwargs):
- return args, kwargs
-
- self.assertEqual(self.call(test), ((), {}))
- self.assertEqual(self.call(test, 1), ((1,), {}))
- self.assertEqual(self.call(test, 1, 2), ((1, 2), {}))
- self.assertEqual(self.call(test, foo='bar'), ((), {'foo': 'bar'}))
- self.assertEqual(self.call(test, 1, foo='bar'), ((1,), {'foo': 'bar'}))
- self.assertEqual(self.call(test, args=10), ((), {'args': 10}))
- self.assertEqual(self.call(test, 1, 2, foo='bar'),
- ((1, 2), {'foo': 'bar'}))
-
- def test_signature_bind_just_args(self):
- def test(a, b, c):
- return a, b, c
-
- self.assertEqual(self.call(test, 1, 2, 3), (1, 2, 3))
-
- with self.assertRaisesRegex(TypeError, 'too many positional arguments'):
- self.call(test, 1, 2, 3, 4)
-
- with self.assertRaisesRegex(TypeError, "'b' parameter lacking default"):
- self.call(test, 1)
-
- with self.assertRaisesRegex(TypeError, "'a' parameter lacking default"):
- self.call(test)
-
- def test(a, b, c=10):
- return a, b, c
- self.assertEqual(self.call(test, 1, 2, 3), (1, 2, 3))
- self.assertEqual(self.call(test, 1, 2), (1, 2, 10))
-
- def test(a=1, b=2, c=3):
- return a, b, c
- self.assertEqual(self.call(test, a=10, c=13), (10, 2, 13))
- self.assertEqual(self.call(test, a=10), (10, 2, 3))
- self.assertEqual(self.call(test, b=10), (1, 10, 3))
-
- def test_signature_bind_varargs_order(self):
- def test(*args):
- return args
-
- self.assertEqual(self.call(test), ())
- self.assertEqual(self.call(test, 1, 2, 3), (1, 2, 3))
-
- def test_signature_bind_args_and_varargs(self):
- def test(a, b, c=3, *args):
- return a, b, c, args
-
- self.assertEqual(self.call(test, 1, 2, 3, 4, 5), (1, 2, 3, (4, 5)))
- self.assertEqual(self.call(test, 1, 2), (1, 2, 3, ()))
- self.assertEqual(self.call(test, b=1, a=2), (2, 1, 3, ()))
- self.assertEqual(self.call(test, 1, b=2), (1, 2, 3, ()))
-
- with self.assertRaisesRegex(TypeError,
- "multiple values for argument 'c'"):
- self.call(test, 1, 2, 3, c=4)
-
- def test_signature_bind_just_kwargs(self):
- def test(**kwargs):
- return kwargs
-
- self.assertEqual(self.call(test), {})
- self.assertEqual(self.call(test, foo='bar', spam='ham'),
- {'foo': 'bar', 'spam': 'ham'})
-
- def test_signature_bind_args_and_kwargs(self):
- def test(a, b, c=3, **kwargs):
- return a, b, c, kwargs
-
- self.assertEqual(self.call(test, 1, 2), (1, 2, 3, {}))
- self.assertEqual(self.call(test, 1, 2, foo='bar', spam='ham'),
- (1, 2, 3, {'foo': 'bar', 'spam': 'ham'}))
- self.assertEqual(self.call(test, b=2, a=1, foo='bar', spam='ham'),
- (1, 2, 3, {'foo': 'bar', 'spam': 'ham'}))
- self.assertEqual(self.call(test, a=1, b=2, foo='bar', spam='ham'),
- (1, 2, 3, {'foo': 'bar', 'spam': 'ham'}))
- self.assertEqual(self.call(test, 1, b=2, foo='bar', spam='ham'),
- (1, 2, 3, {'foo': 'bar', 'spam': 'ham'}))
- self.assertEqual(self.call(test, 1, b=2, c=4, foo='bar', spam='ham'),
- (1, 2, 4, {'foo': 'bar', 'spam': 'ham'}))
- self.assertEqual(self.call(test, 1, 2, 4, foo='bar'),
- (1, 2, 4, {'foo': 'bar'}))
- self.assertEqual(self.call(test, c=5, a=4, b=3),
- (4, 3, 5, {}))
-
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_bind_kwonly(self):
- def test(*, foo):
- return foo
- with self.assertRaisesRegex(TypeError,
- 'too many positional arguments'):
- self.call(test, 1)
- self.assertEqual(self.call(test, foo=1), 1)
-
- def test(a, *, foo=1, bar):
- return foo
- with self.assertRaisesRegex(TypeError,
- "'bar' parameter lacking default value"):
- self.call(test, 1)
-
- def test(foo, *, bar):
- return foo, bar
- self.assertEqual(self.call(test, 1, bar=2), (1, 2))
- self.assertEqual(self.call(test, bar=2, foo=1), (1, 2))
-
- with self.assertRaisesRegex(TypeError,
- 'too many keyword arguments'):
- self.call(test, bar=2, foo=1, spam=10)
-
- with self.assertRaisesRegex(TypeError,
- 'too many positional arguments'):
- self.call(test, 1, 2)
-
- with self.assertRaisesRegex(TypeError,
- 'too many positional arguments'):
- self.call(test, 1, 2, bar=2)
-
- with self.assertRaisesRegex(TypeError,
- 'too many keyword arguments'):
- self.call(test, 1, bar=2, spam='ham')
-
- with self.assertRaisesRegex(TypeError,
- "'bar' parameter lacking default value"):
- self.call(test, 1)
-
- def test(foo, *, bar, **bin):
- return foo, bar, bin
- self.assertEqual(self.call(test, 1, bar=2), (1, 2, {}))
- self.assertEqual(self.call(test, foo=1, bar=2), (1, 2, {}))
- self.assertEqual(self.call(test, 1, bar=2, spam='ham'),
- (1, 2, {'spam': 'ham'}))
- self.assertEqual(self.call(test, spam='ham', foo=1, bar=2),
- (1, 2, {'spam': 'ham'}))
- with self.assertRaisesRegex(TypeError,
- "'foo' parameter lacking default value"):
- self.call(test, spam='ham', bar=2)
- self.assertEqual(self.call(test, 1, bar=2, bin=1, spam=10),
- (1, 2, {'bin': 1, 'spam': 10}))
-""")
-#
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_bind_arguments(self):
- def test(a, *args, b, z=100, **kwargs):
- pass
- sig = inspect.signature(test)
- ba = sig.bind(10, 20, b=30, c=40, args=50, kwargs=60)
- # we won't have 'z' argument in the bound arguments object, as we didn't
- # pass it to the 'bind'
- self.assertEqual(tuple(ba.arguments.items()),
- (('a', 10), ('args', (20,)), ('b', 30),
- ('kwargs', {'c': 40, 'args': 50, 'kwargs': 60})))
- self.assertEqual(ba.kwargs,
- {'b': 30, 'c': 40, 'args': 50, 'kwargs': 60})
- self.assertEqual(ba.args, (10, 20))
-""")
-#
- if sys.version_info[0] > 2:
- exec("""
-def test_signature_bind_positional_only(self):
- P = inspect.Parameter
-
- def test(a_po, b_po, c_po=3, foo=42, *, bar=50, **kwargs):
- return a_po, b_po, c_po, foo, bar, kwargs
-
- sig = inspect.signature(test)
- new_params = collections.OrderedDict(tuple(sig.parameters.items()))
- for name in ('a_po', 'b_po', 'c_po'):
- new_params[name] = new_params[name].replace(kind=P.POSITIONAL_ONLY)
- new_sig = sig.replace(parameters=new_params.values())
- test.__signature__ = new_sig
-
- self.assertEqual(self.call(test, 1, 2, 4, 5, bar=6),
- (1, 2, 4, 5, 6, {}))
-
- with self.assertRaisesRegex(TypeError, "parameter is positional only"):
- self.call(test, 1, 2, c_po=4)
-
- with self.assertRaisesRegex(TypeError, "parameter is positional only"):
- self.call(test, a_po=1, b_po=2)
-""")
-
- def test_bind_self(self):
- class F:
- def f(a, self):
- return a, self
- an_f = F()
- partial_f = functools.partial(F.f, an_f)
- ba = inspect.signature(partial_f).bind(self=10)
- self.assertEqual((an_f, 10), partial_f(*ba.args, **ba.kwargs))
-
-
-class TestBoundArguments(unittest.TestCase):
-
- def test_signature_bound_arguments_unhashable(self):
- def foo(a): pass
- ba = inspect.signature(foo).bind(1)
-
- with self.assertRaisesRegex(TypeError, 'unhashable type'):
- hash(ba)
-
- def test_signature_bound_arguments_equality(self):
- def foo(a): pass
- ba = inspect.signature(foo).bind(1)
- self.assertEqual(ba, ba)
-
- ba2 = inspect.signature(foo).bind(1)
- self.assertEqual(ba, ba2)
-
- ba3 = inspect.signature(foo).bind(2)
- self.assertNotEqual(ba, ba3)
- ba3.arguments['a'] = 1
- self.assertEqual(ba, ba3)
-
- def bar(b): pass
- ba4 = inspect.signature(bar).bind(1)
- self.assertNotEqual(ba, ba4)
diff --git a/tests/wpt/tests/tools/third_party/funcsigs/tox.ini b/tests/wpt/tests/tools/third_party/funcsigs/tox.ini
deleted file mode 100644
index 1873c744a00..00000000000
--- a/tests/wpt/tests/tools/third_party/funcsigs/tox.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[tox]
-envlist = py26, py27, py33, py34, py35, py36, pypy, pypy3
-
-[testenv]
-deps = -rrequirements/development.txt
-commands =
- coverage run setup.py test
- coverage report --show-missing
diff --git a/tests/wpt/tests/tools/webdriver/webdriver/bidi/error.py b/tests/wpt/tests/tools/webdriver/webdriver/bidi/error.py
index 8507a51543d..4a9b4ba9db9 100644
--- a/tests/wpt/tests/tools/webdriver/webdriver/bidi/error.py
+++ b/tests/wpt/tests/tools/webdriver/webdriver/bidi/error.py
@@ -98,5 +98,5 @@ def get(error_code: str) -> Type[BidiException]:
_errors: DefaultDict[str, Type[BidiException]] = collections.defaultdict()
for item in list(locals().values()):
- if type(item) == type and item != BidiException and issubclass(item, BidiException):
+ if isinstance(item, type) and item != BidiException and issubclass(item, BidiException):
_errors[item.error_code] = item
diff --git a/tests/wpt/tests/tools/webdriver/webdriver/error.py b/tests/wpt/tests/tools/webdriver/webdriver/error.py
index 7d5d914a20c..25e4b39ae69 100644
--- a/tests/wpt/tests/tools/webdriver/webdriver/error.py
+++ b/tests/wpt/tests/tools/webdriver/webdriver/error.py
@@ -228,5 +228,5 @@ def get(error_code):
_errors: DefaultDict[str, Type[WebDriverException]] = collections.defaultdict()
for item in list(locals().values()):
- if type(item) == type and item != WebDriverException and issubclass(item, WebDriverException):
+ if isinstance(item, type) and item != WebDriverException and issubclass(item, WebDriverException):
_errors[item.status_code] = item
diff --git a/tests/wpt/tests/tools/webtransport/h3/webtransport_h3_server.py b/tests/wpt/tests/tools/webtransport/h3/webtransport_h3_server.py
index 0fc367e1ff4..8c55ba87e0e 100644
--- a/tests/wpt/tests/tools/webtransport/h3/webtransport_h3_server.py
+++ b/tests/wpt/tests/tools/webtransport/h3/webtransport_h3_server.py
@@ -53,6 +53,11 @@ class H3DatagramSetting(IntEnum):
RFC = 0x33
+class WebTransportHttp3Setting(IntEnum):
+ # https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3-07#section-8.2
+ WEBTRANSPORT_MAX_SESSIONS_DRAFT07 = 0xc671706a
+
+
class H3ConnectionWithDatagram(H3Connection):
"""
A H3Connection subclass, to make it work with the latest
@@ -77,12 +82,13 @@ class H3ConnectionWithDatagram(H3Connection):
if self._datagram_setting is None:
raise SettingsError("HTTP Datagrams support required")
-
def _get_local_settings(self) -> Dict[int, int]:
settings = super()._get_local_settings()
settings[H3DatagramSetting.RFC] = 1
settings[H3DatagramSetting.DRAFT04] = 1
settings[H3ConnectionWithDatagram.ENABLE_CONNECT_PROTOCOL] = 1
+ # This connection can handle only one WebTransport session.
+ settings[WebTransportHttp3Setting.WEBTRANSPORT_MAX_SESSIONS_DRAFT07] = 1
return settings
@property
diff --git a/tests/wpt/tests/tools/wpt/requirements_install.txt b/tests/wpt/tests/tools/wpt/requirements_install.txt
index a299792b223..55bed99f8c5 100644
--- a/tests/wpt/tests/tools/wpt/requirements_install.txt
+++ b/tests/wpt/tests/tools/wpt/requirements_install.txt
@@ -1,2 +1,2 @@
-mozinstall==2.0.1
+mozinstall==2.1.0
packaging==23.1
diff --git a/tests/wpt/tests/tools/wptrunner/requirements.txt b/tests/wpt/tests/tools/wptrunner/requirements.txt
index 8e47b2f229a..0b7ccba4fb8 100644
--- a/tests/wpt/tests/tools/wptrunner/requirements.txt
+++ b/tests/wpt/tests/tools/wptrunner/requirements.txt
@@ -1,6 +1,6 @@
html5lib==1.1
mozdebug==0.3.0
-mozinfo==1.2.2 # https://bugzilla.mozilla.org/show_bug.cgi?id=1621226
+mozinfo==1.2.3 # https://bugzilla.mozilla.org/show_bug.cgi?id=1621226
mozlog==8.0.0
mozprocess==1.3.1
packaging==23.1
diff --git a/tests/wpt/tests/tools/wptrunner/requirements_edge.txt b/tests/wpt/tests/tools/wptrunner/requirements_edge.txt
index 45f93a3bb96..0ce4d76f8af 100644
--- a/tests/wpt/tests/tools/wptrunner/requirements_edge.txt
+++ b/tests/wpt/tests/tools/wptrunner/requirements_edge.txt
@@ -1 +1 @@
-selenium==4.10.0
+selenium==4.11.0
diff --git a/tests/wpt/tests/tools/wptrunner/requirements_firefox.txt b/tests/wpt/tests/tools/wptrunner/requirements_firefox.txt
index 102b7460978..abbfd9a40a3 100644
--- a/tests/wpt/tests/tools/wptrunner/requirements_firefox.txt
+++ b/tests/wpt/tests/tools/wptrunner/requirements_firefox.txt
@@ -1,10 +1,10 @@
marionette_driver==3.3.0
mozcrash==2.2.0
mozdevice==4.1.1
-mozinstall==2.0.1
+mozinstall==2.1.0
mozleak==0.2
-mozprofile==2.5.0
-mozrunner==8.2.1
-mozversion==2.3.0
+mozprofile==2.6.0
+mozrunner==8.3.0
+mozversion==2.4.0
psutil==5.9.5
redo==2.0.4
diff --git a/tests/wpt/tests/tools/wptrunner/requirements_ie.txt b/tests/wpt/tests/tools/wptrunner/requirements_ie.txt
index aa272e2bfdd..90a5512c79f 100644
--- a/tests/wpt/tests/tools/wptrunner/requirements_ie.txt
+++ b/tests/wpt/tests/tools/wptrunner/requirements_ie.txt
@@ -1,2 +1,2 @@
mozprocess==1.3.1
-selenium==4.10.0
+selenium==4.11.0
diff --git a/tests/wpt/tests/tools/wptrunner/requirements_opera.txt b/tests/wpt/tests/tools/wptrunner/requirements_opera.txt
index aa272e2bfdd..90a5512c79f 100644
--- a/tests/wpt/tests/tools/wptrunner/requirements_opera.txt
+++ b/tests/wpt/tests/tools/wptrunner/requirements_opera.txt
@@ -1,2 +1,2 @@
mozprocess==1.3.1
-selenium==4.10.0
+selenium==4.11.0
diff --git a/tests/wpt/tests/tools/wptrunner/requirements_sauce.txt b/tests/wpt/tests/tools/wptrunner/requirements_sauce.txt
index 5740883d351..8cf3f1d32c8 100644
--- a/tests/wpt/tests/tools/wptrunner/requirements_sauce.txt
+++ b/tests/wpt/tests/tools/wptrunner/requirements_sauce.txt
@@ -1,2 +1,2 @@
-selenium==4.10.0
+selenium==4.11.0
requests==2.31.0
diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox.py b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox.py
index 880c2bd187a..13755932858 100644
--- a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox.py
+++ b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox.py
@@ -5,6 +5,7 @@ import os
import platform
import signal
import subprocess
+import sys
import tempfile
import time
from abc import ABCMeta, abstractmethod
@@ -93,33 +94,36 @@ def check_args(**kwargs):
def browser_kwargs(logger, test_type, run_info_data, config, **kwargs):
- return {"binary": kwargs["binary"],
- "webdriver_binary": kwargs["webdriver_binary"],
- "webdriver_args": kwargs["webdriver_args"],
- "prefs_root": kwargs["prefs_root"],
- "extra_prefs": kwargs["extra_prefs"],
- "test_type": test_type,
- "debug_info": kwargs["debug_info"],
- "symbols_path": kwargs["symbols_path"],
- "stackwalk_binary": kwargs["stackwalk_binary"],
- "certutil_binary": kwargs["certutil_binary"],
- "ca_certificate_path": config.ssl_config["ca_cert_path"],
- "e10s": kwargs["gecko_e10s"],
- "enable_fission": run_info_data["fission"],
- "stackfix_dir": kwargs["stackfix_dir"],
- "binary_args": kwargs["binary_args"],
- "timeout_multiplier": get_timeout_multiplier(test_type,
- run_info_data,
- **kwargs),
- "leak_check": run_info_data["debug"] and (kwargs["leak_check"] is not False),
- "asan": run_info_data.get("asan"),
- "chaos_mode_flags": kwargs["chaos_mode_flags"],
- "config": config,
- "browser_channel": kwargs["browser_channel"],
- "headless": kwargs["headless"],
- "preload_browser": kwargs["preload_browser"] and not kwargs["pause_after_test"] and not kwargs["num_test_groups"] == 1,
- "specialpowers_path": kwargs["specialpowers_path"],
- "debug_test": kwargs["debug_test"]}
+ browser_kwargs = {"binary": kwargs["binary"],
+ "webdriver_binary": kwargs["webdriver_binary"],
+ "webdriver_args": kwargs["webdriver_args"],
+ "prefs_root": kwargs["prefs_root"],
+ "extra_prefs": kwargs["extra_prefs"],
+ "test_type": test_type,
+ "debug_info": kwargs["debug_info"],
+ "symbols_path": kwargs["symbols_path"],
+ "stackwalk_binary": kwargs["stackwalk_binary"],
+ "certutil_binary": kwargs["certutil_binary"],
+ "ca_certificate_path": config.ssl_config["ca_cert_path"],
+ "e10s": kwargs["gecko_e10s"],
+ "enable_fission": run_info_data["fission"],
+ "stackfix_dir": kwargs["stackfix_dir"],
+ "binary_args": kwargs["binary_args"],
+ "timeout_multiplier": get_timeout_multiplier(test_type,
+ run_info_data,
+ **kwargs),
+ "leak_check": run_info_data["debug"] and (kwargs["leak_check"] is not False),
+ "asan": run_info_data.get("asan"),
+ "chaos_mode_flags": kwargs["chaos_mode_flags"],
+ "config": config,
+ "browser_channel": kwargs["browser_channel"],
+ "headless": kwargs["headless"],
+ "preload_browser": kwargs["preload_browser"] and not kwargs["pause_after_test"] and not kwargs["num_test_groups"] == 1,
+ "specialpowers_path": kwargs["specialpowers_path"],
+ "debug_test": kwargs["debug_test"]}
+ if test_type == "wdspec" and kwargs["binary"]:
+ browser_kwargs["webdriver_args"].extend(["--binary", kwargs["binary"]])
+ return browser_kwargs
def executor_kwargs(logger, test_type, test_environment, run_info_data,
@@ -139,8 +143,6 @@ def executor_kwargs(logger, test_type, test_environment, run_info_data,
if test_type == "wdspec":
options = {"args": []}
if kwargs["binary"]:
- if "webdriver_args" not in executor_kwargs:
- executor_kwargs["webdriver_args"] = []
executor_kwargs["webdriver_args"].extend(["--binary", kwargs["binary"]])
if kwargs["binary_args"]:
options["args"] = kwargs["binary_args"]
@@ -244,10 +246,21 @@ def log_gecko_crashes(logger, process, test, profile_dir, symbols_path, stackwal
def get_environ(logger, binary, debug_info, headless, chaos_mode_flags=None):
- env = test_environment(xrePath=os.path.abspath(os.path.dirname(binary)),
- debugger=debug_info is not None,
- useLSan=True,
- log=logger)
+ # Hack: test_environment expects a bin_suffix key in mozinfo that in gecko infrastructure
+ # is set in the build system. Set it manually here.
+ if "bin_suffix" not in mozinfo.info:
+ mozinfo.info["bin_suffix"] = (".exe" if sys.platform in ["win32", "msys", "cygwin"]
+ else "")
+
+ # test_environment has started returning None values for some environment variables
+ # that are only set in a gecko checkout
+ env = {key: value for key, value in
+ test_environment(xrePath=os.path.abspath(os.path.dirname(binary)),
+ debugger=debug_info is not None,
+ useLSan=True,
+ log=logger).items()
+ if value is not None}
+
# Disable window occlusion. Bug 1733955
env["MOZ_WINDOW_OCCLUSION"] = "0"
if chaos_mode_flags is not None:
diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/executors/base.py b/tests/wpt/tests/tools/wptrunner/wptrunner/executors/base.py
index 17be0cec39f..b148365780b 100644
--- a/tests/wpt/tests/tools/wptrunner/wptrunner/executors/base.py
+++ b/tests/wpt/tests/tools/wptrunner/wptrunner/executors/base.py
@@ -35,10 +35,10 @@ def executor_kwargs(test_type, test_environment, run_info_data, **kwargs):
executor_kwargs["reftest_screenshot"] = kwargs["reftest_screenshot"]
if test_type == "wdspec":
- executor_kwargs["binary"] = kwargs.get("binary")
- executor_kwargs["binary_args"] = kwargs.get("args")
- executor_kwargs["webdriver_binary"] = kwargs.get("webdriver_binary")
- executor_kwargs["webdriver_args"] = kwargs.get("webdriver_args")
+ executor_kwargs["binary"] = kwargs["binary"]
+ executor_kwargs["binary_args"] = kwargs["binary_args"].copy()
+ executor_kwargs["webdriver_binary"] = kwargs["webdriver_binary"]
+ executor_kwargs["webdriver_args"] = kwargs["webdriver_args"].copy()
# By default the executor may try to cleanup windows after a test (to best
# associate any problems with the test causing them). If the user might
@@ -104,7 +104,7 @@ def _ensure_hash_in_reftest_screenshots(extra):
if not log_data:
return
for item in log_data:
- if type(item) != dict:
+ if not isinstance(item, dict):
# Skip relation strings.
continue
if "hash" not in item:
diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/formatters/wptreport.py b/tests/wpt/tests/tools/wptrunner/wptrunner/formatters/wptreport.py
index be6cca2afc4..21c12115801 100644
--- a/tests/wpt/tests/tools/wptrunner/wptrunner/formatters/wptreport.py
+++ b/tests/wpt/tests/tools/wptrunner/wptrunner/formatters/wptreport.py
@@ -91,7 +91,7 @@ class WptreportFormatter(BaseFormatter): # type: ignore
test["screenshots"] = {
strip_server(item["url"]): "sha1:" + item["hash"]
for item in data["extra"]["reftest_screenshots"]
- if type(item) == dict
+ if isinstance(item, dict)
}
test_name = data["test"]
result = {"test": data["test"]}
diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/formatters/wptscreenshot.py b/tests/wpt/tests/tools/wptrunner/wptrunner/formatters/wptscreenshot.py
index 2b2d1ad49d5..989559701a4 100644
--- a/tests/wpt/tests/tools/wptrunner/wptrunner/formatters/wptscreenshot.py
+++ b/tests/wpt/tests/tools/wptrunner/wptrunner/formatters/wptscreenshot.py
@@ -38,7 +38,7 @@ class WptscreenshotFormatter(BaseFormatter): # type: ignore
return
output = ""
for item in data["extra"]["reftest_screenshots"]:
- if type(item) != dict:
+ if not isinstance(item, dict):
# Skip the relation string.
continue
checksum = "sha1:" + item["hash"]
diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/testloader.py b/tests/wpt/tests/tools/wptrunner/wptrunner/testloader.py
index 8cd24f2f5ae..86004b83387 100644
--- a/tests/wpt/tests/tools/wptrunner/wptrunner/testloader.py
+++ b/tests/wpt/tests/tools/wptrunner/wptrunner/testloader.py
@@ -185,11 +185,17 @@ class TestFilter:
class TagFilter:
- def __init__(self, tags):
- self.tags = set(tags)
+ def __init__(self, include_tags, exclude_tags):
+ self.include_tags = set(include_tags) if include_tags else None
+ self.exclude_tags = set(exclude_tags) if exclude_tags else None
def __call__(self, test):
- return test.tags & self.tags
+ does_match = True
+ if self.include_tags:
+ does_match &= bool(test.tags & self.include_tags)
+ if self.exclude_tags:
+ does_match &= not (test.tags & self.exclude_tags)
+ return does_match
class ManifestLoader:
diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/testrunner.py b/tests/wpt/tests/tools/wptrunner/wptrunner/testrunner.py
index b405dabd1dd..7715289a624 100644
--- a/tests/wpt/tests/tools/wptrunner/wptrunner/testrunner.py
+++ b/tests/wpt/tests/tools/wptrunner/wptrunner/testrunner.py
@@ -296,16 +296,16 @@ class TestRunnerManager(threading.Thread):
self.test_implementation_by_type = {}
for test_type, test_implementation in test_implementation_by_type.items():
- kwargs = test_implementation.browser_kwargs
- if kwargs.get("device_serial"):
- kwargs = kwargs.copy()
+ browser_kwargs = test_implementation.browser_kwargs
+ if browser_kwargs.get("device_serial"):
+ browser_kwargs = browser_kwargs.copy()
# Assign Android device to runner according to current manager index
- kwargs["device_serial"] = kwargs["device_serial"][index]
+ browser_kwargs["device_serial"] = browser_kwargs["device_serial"][index]
self.test_implementation_by_type[test_type] = TestImplementation(
test_implementation.executor_cls,
test_implementation.executor_kwargs,
test_implementation.browser_cls,
- kwargs)
+ browser_kwargs)
else:
self.test_implementation_by_type[test_type] = test_implementation
diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/tests/test_testloader.py b/tests/wpt/tests/tools/wptrunner/wptrunner/tests/test_testloader.py
index cef75e03be1..6e93a20e02e 100644
--- a/tests/wpt/tests/tools/wptrunner/wptrunner/tests/test_testloader.py
+++ b/tests/wpt/tests/tools/wptrunner/wptrunner/tests/test_testloader.py
@@ -132,6 +132,72 @@ def test_filter_unicode():
TestFilter(manifest_path=f.name, test_manifests=tests)
+def test_tag_filter():
+ # Mock a structure with what `TagFilter` actually uses
+ class Tagged:
+ def __init__(self, tags):
+ self.tags = set(tags)
+
+ # Case: empty filter (allow anything)
+ filter = TagFilter({}, {})
+ assert filter(Tagged({}))
+ assert filter(Tagged({'a'}))
+ assert filter(Tagged({'a', 'b'}))
+
+ # Case: only inclusion specified, single tag
+ filter = TagFilter({'a'}, {})
+ assert not filter(Tagged({})) # no `'a'`, no entry
+ assert filter(Tagged({'a'}))
+ assert not filter(Tagged({'b'}))
+ assert filter(Tagged({'a', 'b'}))
+
+ # Case: only inclusion specified, multiple tags
+ filter = TagFilter({'a', 'b'}, {})
+ assert not filter(Tagged({}))
+ assert filter(Tagged({'a'}))
+ assert filter(Tagged({'a', 'b'}))
+ assert filter(Tagged({'b'}))
+ assert not filter(Tagged({'c'}))
+
+ # Case: only exclusion specified, single tag
+ filter = TagFilter({}, {'a'})
+ assert filter(Tagged({})) # no `'a'`, no entry
+ assert not filter(Tagged({'a'}))
+ assert not filter(Tagged({'a', 'b'}))
+ assert filter(Tagged({'b'}))
+
+ # Case: only exclusion specified, multiple tags
+ filter = TagFilter({}, {'a', 'b'})
+ assert filter(Tagged({}))
+ assert not filter(Tagged({'a'}))
+ assert not filter(Tagged({'b'}))
+ assert filter(Tagged({'c'}))
+
+ # Case: disjoint inclusion and exclusion
+ filter = TagFilter({'a'}, {'b'})
+ assert not filter(Tagged({}))
+ assert filter(Tagged({'a'}))
+ assert not filter(Tagged({'b'}))
+ assert not filter(Tagged({'a', 'b'})) # `exclude` overrides `include`
+
+ # Case: intersecting inclusion and exclusion
+ filter = TagFilter({'a'}, {'a'})
+ assert not filter(Tagged({}))
+ assert not filter(Tagged({'a'}))
+ assert not filter(Tagged({'a', 'b'})) # exclusion takes precedence
+ assert not filter(Tagged({'b'}))
+ filter = TagFilter({'a', 'b'}, {'a'})
+ assert not filter(Tagged({}))
+ assert not filter(Tagged({'a'}))
+ assert not filter(Tagged({'a', 'b'}))
+ assert filter(Tagged({'b'}))
+ filter = TagFilter({'a'}, {'a', 'b'})
+ assert not filter(Tagged({}))
+ assert not filter(Tagged({'a'}))
+ assert not filter(Tagged({'a', 'b'})) # exclusion takes precedence
+ assert not filter(Tagged({'b'}))
+
+
def test_loader_filter_tags():
manifest_json = {
"items": {
@@ -141,11 +207,21 @@ def test_loader_filter_tags():
"abcdef123456",
[None, {}],
],
- "bar.html": [
+ "bar.html": [ # will have `test-include` tag
"uvwxyz987654",
[None, {}],
],
- }
+ },
+ "b": {
+ "baz.html": [ # will have `test-include`, `test-exclude` tags
+ "quertyuiop@!",
+ [None, {}],
+ ],
+ "quux.html": [
+ "asdfghjkl_-'",
+ [None, {}],
+ ],
+ },
}
},
"url_base": "/",
@@ -162,15 +238,48 @@ def test_loader_filter_tags():
with open(os.path.join(a_path, "bar.html.ini"), "w") as f:
f.write("tags: [test-include]\n")
- loader = TestLoader({manifest: {"metadata_path": metadata_path}}, ["testharness"], None)
- assert len(loader.tests["testharness"]) == 2
+ b_path = os.path.join(metadata_path, "b")
+ os.makedirs(b_path)
+ with open(os.path.join(b_path, "baz.html.ini"), "w") as f:
+ f.write("tags: [test-include, test-exclude]\n")
+
+ # Check: no filter loads all tests
+ loader = TestLoader({manifest: {"metadata_path": metadata_path}}, ["testharness"], None)
+ assert len(loader.tests["testharness"]) == 4
+
+ # Check: specifying a single `test-include` inclusion yields `/a/bar` and `/b/baz`
loader = TestLoader({manifest: {"metadata_path": metadata_path}}, ["testharness"], None,
- test_filters=[TagFilter({"test-include"})])
+ test_filters=[TagFilter({"test-include"}, {})])
+ assert len(loader.tests["testharness"]) == 2
+ assert loader.tests["testharness"][0].id == "/a/bar.html"
+ assert loader.tests["testharness"][0].tags == {"dir:a", "test-include"}
+ assert loader.tests["testharness"][1].id == "/b/baz.html"
+ assert loader.tests["testharness"][1].tags == {"dir:b", "test-include", "test-exclude"}
+
+ # Check: specifying a single `test-exclude` exclusion rejects only `/b/baz`
+ loader = TestLoader({manifest: {"metadata_path": metadata_path}}, ["testharness"], None,
+ test_filters=[TagFilter({}, {"test-exclude"})])
+ assert len(loader.tests["testharness"]) == 3
+ assert all(test.id != "/b/baz.html" for test in loader.tests["testharness"])
+
+ # Check: including `test-include` and excluding `test-exclude` yields only `/a/bar`
+ loader = TestLoader({manifest: {"metadata_path": metadata_path}}, ["testharness"], None,
+ test_filters=[TagFilter({"test-include"}, {"test-exclude"})])
assert len(loader.tests["testharness"]) == 1
assert loader.tests["testharness"][0].id == "/a/bar.html"
assert loader.tests["testharness"][0].tags == {"dir:a", "test-include"}
+ # Check: non-empty intersection of inclusion and exclusion yield zero tests
+
+ loader = TestLoader({manifest: {"metadata_path": metadata_path}}, ["testharness"], None,
+ test_filters=[TagFilter({"test-include"}, {"test-include"})])
+ assert len(loader.tests["testharness"]) == 0
+
+ loader = TestLoader({manifest: {"metadata_path": metadata_path}}, ["testharness"], None,
+ test_filters=[TagFilter({"test-include", "test-exclude"}, {"test-include"})])
+ assert len(loader.tests["testharness"]) == 0
+
def test_chunk_hash(manifest):
chunker1 = PathHashChunker(total_chunks=2, chunk_number=1)
diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/wptcommandline.py b/tests/wpt/tests/tools/wptrunner/wptrunner/wptcommandline.py
index 875ba7e66a9..6c7294e81e7 100644
--- a/tests/wpt/tests/tools/wptrunner/wptrunner/wptcommandline.py
+++ b/tests/wpt/tests/tools/wptrunner/wptrunner/wptcommandline.py
@@ -167,6 +167,9 @@ scheme host and port.""")
test_selection_group.add_argument("--tag", action="append", dest="tags",
help="Labels applied to tests to include in the run. "
"Labels starting dir: are equivalent to top-level directories.")
+ test_selection_group.add_argument("--exclude-tag", action="append", dest="exclude_tags",
+ help="Labels applied to tests to exclude in the run. Takes precedence over `--tag`. "
+ "Labels starting dir: are equivalent to top-level directories.")
test_selection_group.add_argument("--default-exclude", action="store_true",
default=False,
help="Only run the tests explicitly given in arguments. "
@@ -662,6 +665,11 @@ def check_args(kwargs):
# Default to preloading a gecko instance if we're only running a single process
kwargs["preload_browser"] = kwargs["processes"] == 1
+ if kwargs["tags"] and kwargs["exclude_tags"]:
+ contradictory = set(kwargs["tags"]) & set(kwargs["exclude_tags"])
+ if contradictory:
+ print("contradictory tags found; exclusion will take precedence:", contradictory)
+
return kwargs
diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/wptrunner.py b/tests/wpt/tests/tools/wptrunner/wptrunner/wptrunner.py
index 687a9d46c8e..0cb71bcbfad 100644
--- a/tests/wpt/tests/tools/wptrunner/wptrunner/wptrunner.py
+++ b/tests/wpt/tests/tools/wptrunner/wptrunner/wptrunner.py
@@ -76,8 +76,8 @@ def get_loader(test_paths, product, debug=None, run_info_extras=None, chunker_kw
if test_groups:
include = testloader.update_include_for_groups(test_groups, include)
- if kwargs["tags"]:
- test_filters.append(testloader.TagFilter(kwargs["tags"]))
+ if kwargs["tags"] or kwargs["exclude_tags"]:
+ test_filters.append(testloader.TagFilter(kwargs["tags"], kwargs["exclude_tags"]))
if include or kwargs["exclude"] or kwargs["include_manifest"] or kwargs["default_exclude"]:
manifest_filters.append(testloader.TestFilter(include=include,
@@ -163,17 +163,19 @@ def get_pause_after_test(test_loader, **kwargs):
def run_test_iteration(test_status, test_loader, test_source_kwargs, test_source_cls, run_info,
- recording, test_environment, product, run_test_kwargs):
+ recording, test_environment, product, kwargs):
"""Runs the entire test suite.
This is called for each repeat run requested."""
tests_by_type = defaultdict(list)
for test_type in test_loader.test_types:
- tests_by_type[test_type].extend(test_loader.tests[test_type])
- tests_by_type[test_type].extend(test_loader.disabled_tests[test_type])
+ type_tests_active = test_loader.tests[test_type]
+ type_tests_disabled = test_loader.disabled_tests[test_type]
+ if type_tests_active or type_tests_disabled:
+ tests_by_type[test_type].extend(type_tests_active)
+ tests_by_type[test_type].extend(type_tests_disabled)
try:
- test_groups = test_source_cls.tests_by_group(
- tests_by_type, **test_source_kwargs)
+ test_groups = test_source_cls.tests_by_group(tests_by_type, **test_source_kwargs)
except Exception:
logger.critical("Loading tests failed")
return False
@@ -181,11 +183,13 @@ def run_test_iteration(test_status, test_loader, test_source_kwargs, test_source
logger.suite_start(tests_by_type,
name='web-platform-test',
run_info=run_info,
- extra={"run_by_dir": run_test_kwargs["run_by_dir"]})
+ extra={"run_by_dir": kwargs["run_by_dir"]})
test_implementation_by_type = {}
- for test_type in run_test_kwargs["test_types"]:
+ for test_type in kwargs["test_types"]:
+ if test_type not in tests_by_type:
+ continue
executor_cls = product.executor_classes.get(test_type)
if executor_cls is None:
logger.warning(f"Unsupported test type {test_type} for product {product.name}")
@@ -194,14 +198,14 @@ def run_test_iteration(test_status, test_loader, test_source_kwargs, test_source
test_type,
test_environment,
run_info,
- **run_test_kwargs)
+ **kwargs)
browser_cls = product.get_browser_cls(test_type)
browser_kwargs = product.get_browser_kwargs(logger,
test_type,
run_info,
config=test_environment.config,
num_test_groups=len(test_groups),
- **run_test_kwargs)
+ **kwargs)
test_implementation_by_type[test_type] = TestImplementation(executor_cls,
executor_kwargs,
browser_cls,
@@ -232,10 +236,10 @@ def run_test_iteration(test_status, test_loader, test_source_kwargs, test_source
unexpected_tests = set()
unexpected_pass_tests = set()
recording.pause()
- retry_counts = run_test_kwargs["retry_unexpected"]
+ retry_counts = kwargs["retry_unexpected"]
for i in range(retry_counts + 1):
if i > 0:
- if not run_test_kwargs["fail_on_unexpected_pass"]:
+ if not kwargs["fail_on_unexpected_pass"]:
unexpected_fail_tests = unexpected_tests - unexpected_pass_tests
else:
unexpected_fail_tests = unexpected_tests
@@ -249,19 +253,19 @@ def run_test_iteration(test_status, test_loader, test_source_kwargs, test_source
logger.suite_start(tests_to_run,
name='web-platform-test',
run_info=run_info,
- extra={"run_by_dir": run_test_kwargs["run_by_dir"]})
+ extra={"run_by_dir": kwargs["run_by_dir"]})
with ManagerGroup("web-platform-tests",
test_source_cls,
test_source_kwargs,
test_implementation_by_type,
- run_test_kwargs["rerun"],
- run_test_kwargs["pause_after_test"],
- run_test_kwargs["pause_on_unexpected"],
- run_test_kwargs["restart_on_unexpected"],
- run_test_kwargs["debug_info"],
- not run_test_kwargs["no_capture_stdio"],
- run_test_kwargs["restart_on_new_group"],
+ kwargs["rerun"],
+ kwargs["pause_after_test"],
+ kwargs["pause_on_unexpected"],
+ kwargs["restart_on_unexpected"],
+ kwargs["debug_info"],
+ not kwargs["no_capture_stdio"],
+ kwargs["restart_on_new_group"],
recording=recording) as manager_group:
try:
handle_interrupt_signals()
@@ -293,26 +297,26 @@ def handle_interrupt_signals():
signal.signal(signal.SIGTERM, termination_handler)
-def evaluate_runs(test_status, run_test_kwargs):
+def evaluate_runs(test_status, **kwargs):
"""Evaluates the test counts after the given number of repeat runs has finished"""
if test_status.total_tests == 0:
if test_status.skipped > 0:
logger.warning("All requested tests were skipped")
else:
- if run_test_kwargs["default_exclude"]:
+ if kwargs["default_exclude"]:
logger.info("No tests ran")
return True
else:
logger.critical("No tests ran")
return False
- if test_status.unexpected and not run_test_kwargs["fail_on_unexpected"]:
+ if test_status.unexpected and not kwargs["fail_on_unexpected"]:
logger.info(f"Tolerating {test_status.unexpected} unexpected results")
return True
all_unexpected_passed = (test_status.unexpected and
test_status.unexpected == test_status.unexpected_pass)
- if all_unexpected_passed and not run_test_kwargs["fail_on_unexpected_pass"]:
+ if all_unexpected_passed and not kwargs["fail_on_unexpected_pass"]:
logger.info(f"Tolerating {test_status.unexpected_pass} unexpected results "
"because they all PASS")
return True
@@ -475,7 +479,7 @@ def run_tests(config, test_paths, product, **kwargs):
break
# Return the evaluation of the runs and the number of repeated iterations that were run.
- return evaluate_runs(test_status, kwargs), test_status
+ return evaluate_runs(test_status, **kwargs), test_status
def check_stability(**kwargs):
diff --git a/tests/wpt/tests/webcodecs/videoFrame-construction.crossOriginSource.sub.html b/tests/wpt/tests/webcodecs/videoFrame-construction.crossOriginSource.sub.html
index 81906d33b79..172580f83cc 100644
--- a/tests/wpt/tests/webcodecs/videoFrame-construction.crossOriginSource.sub.html
+++ b/tests/wpt/tests/webcodecs/videoFrame-construction.crossOriginSource.sub.html
@@ -1,222 +1,219 @@
-
+
+
-
-
-
+ function run_test(test) {
+ promise_test(async t => {
+ const source = await test.factory();
+ if (test.should_throw) {
+ assert_throws_dom('SecurityError', () => { create_frame(source); });
+ } else {
+ create_frame(source);
+ }
+ }, test.title);
+ }
+
+ function create_frame(img) {
+ let frame = new VideoFrame(img, { timestamp: 0 });
+ frame.close();
+ }
+
+ function on_frame_available(video, callback) {
+ if ('requestVideoFrameCallback' in video)
+ video.requestVideoFrameCallback(callback);
+ else
+ video.onloadeddata = callback;
+ }
+
+
+
diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/__init__.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/__init__.py
index 8abf012f276..e74de268093 100644
--- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/__init__.py
+++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/__init__.py
@@ -70,6 +70,16 @@ def assert_navigation_info(event, expected_navigation_info):
assert event["url"] == expected_navigation_info["url"]
+async def get_document_focus(bidi_session, context: Mapping[str, Any]) -> str:
+ result = await bidi_session.script.call_function(
+ function_declaration="""() => {
+ return document.hasFocus();
+ }""",
+ target=ContextTarget(context["context"]),
+ await_promise=False)
+ return result["value"]
+
+
async def get_visibility_state(bidi_session, context: Mapping[str, Any]) -> str:
result = await bidi_session.script.call_function(
function_declaration="""() => {
diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/activate/activate.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/activate/activate.py
index 3d20a4f6464..0abbbbac38e 100644
--- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/activate/activate.py
+++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/activate/activate.py
@@ -1,34 +1,41 @@
import pytest
from webdriver.bidi.modules.script import ContextTarget
-from . import get_visibility_state, is_selector_focused
+from . import is_selector_focused
+from .. import get_document_focus, get_visibility_state
-@pytest.mark.asyncio
-async def test_activate(bidi_session, new_tab):
- assert await get_visibility_state(bidi_session, new_tab) == 'hidden'
-
- await bidi_session.browsing_context.activate(context=new_tab["context"])
-
- assert await get_visibility_state(bidi_session, new_tab) == 'visible'
+pytestmark = pytest.mark.asyncio
+
+
+async def test_activate(bidi_session, new_tab, top_context):
+ assert await get_document_focus(bidi_session, top_context) is False
+
+ await bidi_session.browsing_context.activate(context=top_context["context"])
+
+ assert await get_visibility_state(bidi_session, top_context) == 'visible'
+ assert await get_document_focus(bidi_session, top_context) is True
-@pytest.mark.asyncio
async def test_deactivates_other_contexts(bidi_session, new_tab, top_context):
await bidi_session.browsing_context.activate(context=top_context["context"])
assert await get_visibility_state(bidi_session, top_context) == 'visible'
- assert await get_visibility_state(bidi_session, new_tab) == 'hidden'
+ assert await get_document_focus(bidi_session, top_context) is True
+
+ assert await get_document_focus(bidi_session, new_tab) is False
await bidi_session.browsing_context.activate(context=new_tab["context"])
- assert await get_visibility_state(bidi_session, top_context) == 'hidden'
+ assert await get_document_focus(bidi_session, top_context) is False
+
assert await get_visibility_state(bidi_session, new_tab) == 'visible'
+ assert await get_document_focus(bidi_session, new_tab) is True
-@pytest.mark.asyncio
async def test_keeps_focused_area(bidi_session, inline, new_tab, top_context):
await bidi_session.browsing_context.activate(context=new_tab["context"])
assert await get_visibility_state(bidi_session, new_tab) == 'visible'
+ assert await get_document_focus(bidi_session, new_tab) is True
await bidi_session.browsing_context.navigate(context=new_tab["context"],
url=inline(" "),
@@ -42,18 +49,19 @@ async def test_keeps_focused_area(bidi_session, inline, new_tab, top_context):
assert await is_selector_focused(bidi_session, new_tab, "input")
await bidi_session.browsing_context.activate(context=top_context["context"])
- assert await get_visibility_state(bidi_session, new_tab) == 'hidden'
+ assert await get_document_focus(bidi_session, new_tab) is False
assert await is_selector_focused(bidi_session, new_tab, "input")
await bidi_session.browsing_context.activate(context=new_tab["context"])
assert await get_visibility_state(bidi_session, new_tab) == 'visible'
+ assert await get_document_focus(bidi_session, new_tab) is True
assert await is_selector_focused(bidi_session, new_tab, "input")
-@pytest.mark.asyncio
-async def test_double_activation(bidi_session, inline, new_tab, top_context):
+async def test_double_activation(bidi_session, inline, new_tab):
await bidi_session.browsing_context.activate(context=new_tab["context"])
assert await get_visibility_state(bidi_session, new_tab) == 'visible'
+ assert await get_document_focus(bidi_session, new_tab) is True
await bidi_session.browsing_context.navigate(context=new_tab["context"],
url=inline(" "),
@@ -62,9 +70,26 @@ async def test_double_activation(bidi_session, inline, new_tab, top_context):
await bidi_session.browsing_context.activate(context=new_tab["context"])
assert await get_visibility_state(bidi_session, new_tab) == 'visible'
+ assert await get_document_focus(bidi_session, new_tab) is True
assert await is_selector_focused(bidi_session, new_tab, "input")
# Activate again.
await bidi_session.browsing_context.activate(context=new_tab["context"])
assert await get_visibility_state(bidi_session, new_tab) == 'visible'
+ assert await get_document_focus(bidi_session, new_tab) is True
assert await is_selector_focused(bidi_session, new_tab, "input")
+
+
+async def test_activate_window(bidi_session):
+ new_window_1 = await bidi_session.browsing_context.create(type_hint="window")
+ new_window_2 = await bidi_session.browsing_context.create(type_hint="window")
+
+ assert await get_visibility_state(bidi_session, new_window_2) == 'visible'
+ assert await get_document_focus(bidi_session, new_window_2) is True
+
+ assert await get_document_focus(bidi_session, new_window_1) is False
+
+ await bidi_session.browsing_context.activate(context=new_window_1["context"])
+
+ assert await get_visibility_state(bidi_session, new_window_1) == 'visible'
+ assert await get_document_focus(bidi_session, new_window_1) is True
diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/create/background.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/create/background.py
index cf9a167022c..f1effe05372 100644
--- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/create/background.py
+++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/create/background.py
@@ -2,24 +2,31 @@ import pytest
pytestmark = pytest.mark.asyncio
-from .. import get_visibility_state
+from .. import get_document_focus, get_visibility_state
+
@pytest.mark.parametrize("type_hint", ["tab", "window"])
async def test_background_default_false(bidi_session, type_hint):
new_context = await bidi_session.browsing_context.create(type_hint=type_hint)
try:
- assert await get_visibility_state(bidi_session, new_context) == "visible"
+ assert await get_visibility_state(bidi_session, new_context) == "visible"
+ assert await get_document_focus(bidi_session, new_context) is True
finally:
- await bidi_session.browsing_context.close(context=new_context["context"])
+ await bidi_session.browsing_context.close(context=new_context["context"])
@pytest.mark.parametrize("type_hint", ["tab", "window"])
@pytest.mark.parametrize("background", [True, False])
-async def test_background(bidi_session, type_hint, background):
+async def test_background(bidi_session, top_context, type_hint, background):
new_context = await bidi_session.browsing_context.create(type_hint=type_hint, background=background)
try:
- assert await get_visibility_state(bidi_session, new_context) == ("hidden" if background else "visible")
+ if background:
+ assert await get_visibility_state(bidi_session, top_context) == "visible"
+ else:
+ assert await get_visibility_state(bidi_session, new_context) == "visible"
+
+ assert await get_document_focus(bidi_session, new_context) != background
finally:
- await bidi_session.browsing_context.close(context=new_context["context"])
+ await bidi_session.browsing_context.close(context=new_context["context"])
diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/create/invalid.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/create/invalid.py
index 5de171b1b61..bad84017245 100644
--- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/create/invalid.py
+++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/create/invalid.py
@@ -53,7 +53,7 @@ async def test_params_type_invalid_value(bidi_session, value):
await bidi_session.browsing_context.create(type_hint=value)
-@pytest.mark.parametrize("value", [None, '', 42, {}, []])
+@pytest.mark.parametrize("value", ['', 42, {}, []])
async def test_params_background_invalid_type(bidi_session, value):
with pytest.raises(error.InvalidArgumentException):
await bidi_session.browsing_context.create(type_hint="tab", background = value)
diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/error.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/error.py
index b5d9a9d8fe7..ba23e773000 100644
--- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/error.py
+++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/error.py
@@ -9,8 +9,8 @@ pytestmark = pytest.mark.asyncio
"url",
[
"thisprotocoldoesnotexist://",
- "http://doesnotexist.localhost/",
- "http://localhost:0",
+ "https://doesnotexist.localhost/",
+ "https://localhost:0",
],
ids=[
"protocol",
diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/invalid.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/invalid.py
index 3ea45f06665..1f33604c4d0 100644
--- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/invalid.py
+++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/invalid.py
@@ -28,11 +28,12 @@ async def test_params_url_invalid_type(bidi_session, new_tab, value):
)
-@pytest.mark.parametrize("value", ["http://:invalid", "http://#invalid"])
-async def test_params_url_invalid_value(bidi_session, new_tab, value):
+@pytest.mark.parametrize("protocol", ["http", "https"])
+@pytest.mark.parametrize("value", [":invalid", "#invalid"])
+async def test_params_url_invalid_value(bidi_session, new_tab, protocol, value):
with pytest.raises(error.InvalidArgumentException):
await bidi_session.browsing_context.navigate(
- context=new_tab["context"], url=value
+ context=new_tab["context"], url=f"{protocol}://{value}"
)
diff --git a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse.py b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse.py
index 7e262581018..bb5d78f3013 100644
--- a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse.py
+++ b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse.py
@@ -211,11 +211,12 @@ async def test_drag_and_drop(
@pytest.mark.parametrize("drag_duration", [0, 300, 800])
-async def test_drag_and_drop_with_draggable_element(
- bidi_session, top_context, get_element, load_static_test_page, drag_duration
-):
- new_context = await bidi_session.browsing_context.create(type_hint="window")
- await load_static_test_page(page="test_actions.html", context=new_context)
+async def test_drag_and_drop_with_draggable_element(bidi_session, top_context,
+ get_element,
+ load_static_test_page,
+ drag_duration):
+ await load_static_test_page(page="test_actions.html")
+
drag_target = await get_element("#draggable")
drop_target = await get_element("#droppable")
@@ -226,29 +227,59 @@ async def test_drag_and_drop_with_draggable_element(
actions.add_pointer()
.pointer_move(x=0, y=0, origin=get_element_origin(drag_target))
.pointer_down(button=0)
- .pointer_move(
- x=50, y=25, duration=drag_duration, origin=get_element_origin(drop_target)
- )
+ .pointer_move(x=0, y=0, duration=drag_duration, origin=get_element_origin(drop_target))
.pointer_up(button=0)
- .pointer_move(80, 50, duration=100, origin="pointer")
)
- await bidi_session.input.perform_actions(
- actions=actions, context=new_context["context"]
- )
+ await bidi_session.input.perform_actions(actions=actions,
+ context=top_context["context"])
# mouseup that ends the drag is at the expected destination
- events = await get_events(bidi_session, new_context["context"])
+ events = await get_events(bidi_session, top_context["context"])
- assert len(events) >= 5
- assert events[1]["type"] == "dragstart", f"Events captured were {events}"
- assert events[2]["type"] == "dragover", f"Events captured were {events}"
drag_events_captured = [
- ev["type"]
- for ev in events
+ ev["type"] for ev in events
if ev["type"].startswith("drag") or ev["type"].startswith("drop")
]
- assert "dragend" in drag_events_captured
+ assert "dragstart" in drag_events_captured
assert "dragenter" in drag_events_captured
- assert "dragleave" in drag_events_captured
+ # dragleave never happens if the mouse moves directly into the drop element
+ # without intermediate movements.
+ if drag_duration != 0:
+ assert "dragleave" in drag_events_captured
+ assert "dragover" in drag_events_captured
assert "drop" in drag_events_captured
+ assert "dragend" in drag_events_captured
+
+ def last_index(list, value):
+ return len(list) - list[::-1].index(value) - 1
+
+ # The order should follow the diagram:
+ #
+ # - dragstart
+ # - dragenter
+ # - ...
+ # - dragenter
+ # - dragleave
+ # - ...
+ # - dragleave
+ # - dragover
+ # - ...
+ # - dragover
+ # - drop
+ # - dragend
+ #
+ assert drag_events_captured.index(
+ "dragstart") < drag_events_captured.index("dragenter")
+ if drag_duration != 0:
+ assert last_index(drag_events_captured,
+ "dragenter") < last_index(drag_events_captured, "dragleave")
+ assert last_index(drag_events_captured,
+ "dragleave") < last_index(drag_events_captured, "dragover")
+ else:
+ assert last_index(drag_events_captured,
+ "dragenter") < last_index(drag_events_captured, "dragover")
+ assert last_index(drag_events_captured,
+ "dragover") < drag_events_captured.index("drop")
+ assert drag_events_captured.index(
+ "drop") == drag_events_captured.index("dragend") - 1
diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/__init__.py b/tests/wpt/tests/webdriver/tests/bidi/script/__init__.py
index 901b412458b..5635a4bbfb0 100644
--- a/tests/wpt/tests/webdriver/tests/bidi/script/__init__.py
+++ b/tests/wpt/tests/webdriver/tests/bidi/script/__init__.py
@@ -68,7 +68,7 @@ PRIMITIVE_VALUES: list[tuple[str, dict]] = [
("null", {"type": "null"}),
("'foobar'", {"type": "string", "value": "foobar"}),
("'2'", {"type": "string", "value": "2"}),
- ("Number.NaN", {"type": "number", "value": "NaN"}),
+ ("NaN", {"type": "number", "value": "NaN"}),
("-0", {"type": "number", "value": "-0"}),
("Infinity", {"type": "number", "value": "Infinity"}),
("-Infinity", {"type": "number", "value": "-Infinity"}),
diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/arguments.py b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/arguments.py
index 32a4a6a2b8f..b1b188187ba 100644
--- a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/arguments.py
+++ b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/arguments.py
@@ -23,7 +23,11 @@ async def test_default_arguments(bidi_session, top_context):
async def test_primitive_value(bidi_session, top_context, argument, expected):
result = await bidi_session.script.call_function(
function_declaration=f"""(arg) => {{
- if (arg !== {expected}) {{
+ if (typeof {expected} === "number" && isNaN({expected})) {{
+ if (!isNaN(arg)) {{
+ throw new Error(`Argument should be {expected}, but was ` + arg);
+ }}
+ }} else if (arg !== {expected}) {{
throw new Error(`Argument should be {expected}, but was ` + arg);
}}
return arg;
@@ -36,24 +40,6 @@ async def test_primitive_value(bidi_session, top_context, argument, expected):
recursive_compare(argument, result)
-@pytest.mark.asyncio
-async def test_primitive_value_NaN(bidi_session, top_context):
- nan_remote_value = {"type": "number", "value": "NaN"}
- result = await bidi_session.script.call_function(
- function_declaration="""(arg) => {
- if (!isNaN(arg)) {
- throw new Error("Argument should be 'NaN', but was " + arg);
- }
- return arg;
- }""",
- arguments=[nan_remote_value],
- await_promise=False,
- target=ContextTarget(top_context["context"]),
- )
-
- recursive_compare(nan_remote_value, result)
-
-
@pytest.mark.asyncio
@pytest.mark.parametrize(
"argument, expected_type",
diff --git a/tests/wpt/tests/webdriver/tests/classic/add_cookie/add.py b/tests/wpt/tests/webdriver/tests/classic/add_cookie/add.py
index 3a19432fc6a..24b71c52fdd 100644
--- a/tests/wpt/tests/webdriver/tests/classic/add_cookie/add.py
+++ b/tests/wpt/tests/webdriver/tests/classic/add_cookie/add.py
@@ -121,7 +121,7 @@ def test_add_domain_cookie(session, url, server_config):
cookie["domain"] == ".%s" % server_config["browser_host"]
-def test_add_cookie_for_ip(session, url, server_config, configuration):
+def test_add_cookie_for_ip(session, server_config):
new_cookie = {
"name": "hello",
"value": "world",
@@ -131,7 +131,9 @@ def test_add_cookie_for_ip(session, url, server_config, configuration):
"secure": False
}
- session.url = "http://127.0.0.1:%s/common/blank.html" % (server_config["ports"]["http"][0])
+ port = server_config["ports"]["http"][0]
+ session.url = f"http://127.0.0.1:{port}/common/blank.html"
+
clear_all_cookies(session)
result = add_cookie(session, new_cookie)
diff --git a/tests/wpt/tests/webdriver/tests/classic/element_click/navigate.py b/tests/wpt/tests/webdriver/tests/classic/element_click/navigate.py
index e92c11bb135..fa35b7ae6e3 100644
--- a/tests/wpt/tests/webdriver/tests/classic/element_click/navigate.py
+++ b/tests/wpt/tests/webdriver/tests/classic/element_click/navigate.py
@@ -14,53 +14,47 @@ def element_click(session, element):
element_id=element.id))
-def test_numbers_link(session, server_config, inline):
+def test_numbers_link(session, inline, url):
link = "/webdriver/tests/classic/element_click/support/input.html"
- session.url = inline("123456 ".format(url=link))
+ session.url = inline(f"123456 ")
element = session.find.css("a", all=False)
response = element_click(session, element)
assert_success(response)
- host = server_config["browser_host"]
- port = server_config["ports"]["http"][0]
- assert session.url == "http://{host}:{port}{url}".format(host=host, port=port, url=link)
+ assert session.url == url(link)
-def test_multi_line_link(session, server_config, inline):
+def test_multi_line_link(session, inline, url):
link = "/webdriver/tests/classic/element_click/support/input.html"
- session.url = inline("""
+ session.url = inline(f"""
- Helloooooooooooooooooooo Worlddddddddddddddd
-
""".format(url=link))
+ Helloooooooooooooooooooo Worlddddddddddddddd
+ """)
element = session.find.css("a", all=False)
response = element_click(session, element)
assert_success(response)
- host = server_config["browser_host"]
- port = server_config["ports"]["http"][0]
- assert session.url == "http://{host}:{port}{url}".format(host=host, port=port, url=link)
+ assert session.url == url(link)
-def test_link_unload_event(session, server_config, inline):
+def test_link_unload_event(session, url, server_config, inline):
link = "/webdriver/tests/classic/element_click/support/input.html"
- session.url = inline("""
+ session.url = inline(f"""
- click here
-
+ click here
+
- """.format(url=link))
+ """)
element = session.find.css("a", all=False)
response = element_click(session, element)
assert_success(response)
- host = server_config["browser_host"]
- port = server_config["ports"]["http"][0]
- assert session.url == "http://{host}:{port}{url}".format(host=host, port=port, url=link)
+ assert session.url == url(link)
session.back()
diff --git a/tests/wpt/tests/webdriver/tests/support/fixtures.py b/tests/wpt/tests/webdriver/tests/support/fixtures.py
index 6033e243552..850c654d2a6 100644
--- a/tests/wpt/tests/webdriver/tests/support/fixtures.py
+++ b/tests/wpt/tests/webdriver/tests/support/fixtures.py
@@ -201,7 +201,7 @@ def current_session():
@pytest.fixture
def url(server_config):
- def url(path, protocol="http", domain="", subdomain="", query="", fragment=""):
+ def url(path, protocol="https", domain="", subdomain="", query="", fragment=""):
domain = server_config["domains"][domain][subdomain]
port = server_config["ports"][protocol][0]
host = "{0}:{1}".format(domain, port)
diff --git a/tests/wpt/tests/webdriver/tests/support/html/test_actions.html b/tests/wpt/tests/webdriver/tests/support/html/test_actions.html
index 40e4b5aa37c..e3778406722 100644
--- a/tests/wpt/tests/webdriver/tests/support/html/test_actions.html
+++ b/tests/wpt/tests/webdriver/tests/support/html/test_actions.html
@@ -172,15 +172,12 @@
els.dragTarget = document.getElementById("dragTarget");
els.dragTarget.addEventListener("mousedown", grabOnce);
- var draggable = document.getElementById("draggable");
- draggable.addEventListener("dragstart", recordPointerEvent);
- draggable.addEventListener("dragenter", recordPointerEvent);
- draggable.addEventListener("dragend", recordPointerEvent);
- draggable.addEventListener("dragleave", recordPointerEvent);
- draggable.addEventListener("dragover", recordPointerEvent);
-
- var droppable = document.getElementById("droppable");
- droppable.addEventListener("drop", recordPointerEvent);
+ window.addEventListener("dragstart", recordPointerEvent);
+ window.addEventListener("dragenter", recordPointerEvent);
+ window.addEventListener("dragover", recordPointerEvent);
+ window.addEventListener("dragleave", recordPointerEvent);
+ window.addEventListener("drop", recordPointerEvent);
+ window.addEventListener("dragend", recordPointerEvent);
});
@@ -204,8 +201,8 @@
diff --git a/tests/wpt/tests/webdriver/tests/support/http_handlers/authentication.py b/tests/wpt/tests/webdriver/tests/support/http_handlers/authentication.py
index db247af610a..d3c95a948f0 100644
--- a/tests/wpt/tests/webdriver/tests/support/http_handlers/authentication.py
+++ b/tests/wpt/tests/webdriver/tests/support/http_handlers/authentication.py
@@ -1,12 +1,12 @@
from urllib.parse import urlencode
-def basic_authentication(url, protocol="http"):
+def basic_authentication(url, **kwargs):
query = {}
return url("/webdriver/tests/support/http_handlers/authentication.py",
query=urlencode(query),
- protocol=protocol)
+ **kwargs)
def main(request, response):
diff --git a/tests/wpt/tests/webnn/resources/test_data/pow.json b/tests/wpt/tests/webnn/resources/test_data/pow.json
index d6c9f592df7..b35a96233d0 100644
--- a/tests/wpt/tests/webnn/resources/test_data/pow.json
+++ b/tests/wpt/tests/webnn/resources/test_data/pow.json
@@ -481,304 +481,9 @@
}
},
{
- "name": "pow float32 1D positive base tensor and 1D exponent tensor",
+ "name": "pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor",
"inputs": {
"a": {
- "shape": [24],
- "data": [
- 1.4186520416325132,
- 19.384846302672862,
- 12.983916515701083,
- 2.460315836803,
- 7.818154966175683,
- 6.944444510618668,
- 12.183951502858129,
- 17.91247403540764,
- 11.35656818684932,
- 8.924248275595188,
- 17.63682367890858,
- 11.49622917976384,
- 18.51627975602645,
- 2.2580489773802714,
- 2.231948203000913,
- 13.629855345962834,
- 17.54841363842334,
- 0.5390733851574936,
- 5.891367616729561,
- 0.12803148642270834,
- 19.654494983574544,
- 3.412272498152542,
- 4.9450348267065225,
- 4.437101298745225
- ],
- "type": "float32"
- },
- "b": {
- "shape": [24],
- "data": [
- -1.5511157816056738,
- 19.380577557084465,
- -3.6426215860281452,
- 16.167571318689518,
- -2.0848799217875964,
- 11.261693793617642,
- 12.615325041672058,
- -2.7793194614392647,
- -11.366388615297627,
- -5.648841807865415,
- 11.413243516798275,
- 12.879077210007082,
- 0.4005270071745244,
- -6.527585857242606,
- 2.407976905841956,
- -9.631716701331072,
- -0.2599778139698401,
- -9.364569334111161,
- 15.316681121612149,
- 7.0153143060793965,
- -11.982424302485697,
- -12.112285237422382,
- 14.26965166637288,
- -6.536952275641514
- ],
- "type": "float32"
- }
- },
- "expected": {
- "name": "output",
- "shape": [24],
- "data": [
- 0.5813302397727966,
- 8.948769192887517e+24,
- 0.00008795983740128577,
- 2095912.875,
- 0.013739941641688347,
- 3007905536,
- 49839131852800,
- 0.00032891242881305516,
- 1.01309802560956e-12,
- 0.000004269440978532657,
- 168150804987904,
- 45601043513344,
- 3.218766689300537,
- 0.004908796865493059,
- 6.912310600280762,
- 1.1827739308800655e-11,
- 0.4748164415359497,
- 325.8381042480469,
- 626836635648,
- 5.464456762638292e-7,
- 3.170955982412547e-16,
- 3.496410840853059e-7,
- 8045534720,
- 0.00005887653969693929
- ],
- "type": "float32"
- }
- },
- {
- "name": "pow float32 2D positive base tensor and 2D exponent tensor",
- "inputs": {
- "a": {
- "shape": [4, 6],
- "data": [
- 1.4186520416325132,
- 19.384846302672862,
- 12.983916515701083,
- 2.460315836803,
- 7.818154966175683,
- 6.944444510618668,
- 12.183951502858129,
- 17.91247403540764,
- 11.35656818684932,
- 8.924248275595188,
- 17.63682367890858,
- 11.49622917976384,
- 18.51627975602645,
- 2.2580489773802714,
- 2.231948203000913,
- 13.629855345962834,
- 17.54841363842334,
- 0.5390733851574936,
- 5.891367616729561,
- 0.12803148642270834,
- 19.654494983574544,
- 3.412272498152542,
- 4.9450348267065225,
- 4.437101298745225
- ],
- "type": "float32"
- },
- "b": {
- "shape": [4, 6],
- "data": [
- -1.5511157816056738,
- 19.380577557084465,
- -3.6426215860281452,
- 16.167571318689518,
- -2.0848799217875964,
- 11.261693793617642,
- 12.615325041672058,
- -2.7793194614392647,
- -11.366388615297627,
- -5.648841807865415,
- 11.413243516798275,
- 12.879077210007082,
- 0.4005270071745244,
- -6.527585857242606,
- 2.407976905841956,
- -9.631716701331072,
- -0.2599778139698401,
- -9.364569334111161,
- 15.316681121612149,
- 7.0153143060793965,
- -11.982424302485697,
- -12.112285237422382,
- 14.26965166637288,
- -6.536952275641514
- ],
- "type": "float32"
- }
- },
- "expected": {
- "name": "output",
- "shape": [4, 6],
- "data": [
- 0.5813302397727966,
- 8.948769192887517e+24,
- 0.00008795983740128577,
- 2095912.875,
- 0.013739941641688347,
- 3007905536,
- 49839131852800,
- 0.00032891242881305516,
- 1.01309802560956e-12,
- 0.000004269440978532657,
- 168150804987904,
- 45601043513344,
- 3.218766689300537,
- 0.004908796865493059,
- 6.912310600280762,
- 1.1827739308800655e-11,
- 0.4748164415359497,
- 325.8381042480469,
- 626836635648,
- 5.464456762638292e-7,
- 3.170955982412547e-16,
- 3.496410840853059e-7,
- 8045534720,
- 0.00005887653969693929
- ],
- "type": "float32"
- }
- },
- {
- "name": "pow float32 4D positive base tensor and 4D exponent tensor",
- "inputs": {
- "a": {
- "shape": [2, 2, 2, 3],
- "data": [
- 1.4186520416325132,
- 19.384846302672862,
- 12.983916515701083,
- 2.460315836803,
- 7.818154966175683,
- 6.944444510618668,
- 12.183951502858129,
- 17.91247403540764,
- 11.35656818684932,
- 8.924248275595188,
- 17.63682367890858,
- 11.49622917976384,
- 18.51627975602645,
- 2.2580489773802714,
- 2.231948203000913,
- 13.629855345962834,
- 17.54841363842334,
- 0.5390733851574936,
- 5.891367616729561,
- 0.12803148642270834,
- 19.654494983574544,
- 3.412272498152542,
- 4.9450348267065225,
- 4.437101298745225
- ],
- "type": "float32"
- },
- "b": {
- "shape": [2, 2, 2, 3],
- "data": [
- -1.5511157816056738,
- 19.380577557084465,
- -3.6426215860281452,
- 16.167571318689518,
- -2.0848799217875964,
- 11.261693793617642,
- 12.615325041672058,
- -2.7793194614392647,
- -11.366388615297627,
- -5.648841807865415,
- 11.413243516798275,
- 12.879077210007082,
- 0.4005270071745244,
- -6.527585857242606,
- 2.407976905841956,
- -9.631716701331072,
- -0.2599778139698401,
- -9.364569334111161,
- 15.316681121612149,
- 7.0153143060793965,
- -11.982424302485697,
- -12.112285237422382,
- 14.26965166637288,
- -6.536952275641514
- ],
- "type": "float32"
- }
- },
- "expected": {
- "name": "output",
- "shape": [2, 2, 2, 3],
- "data": [
- 0.5813302397727966,
- 8.948769192887517e+24,
- 0.00008795983740128577,
- 2095912.875,
- 0.013739941641688347,
- 3007905536,
- 49839131852800,
- 0.00032891242881305516,
- 1.01309802560956e-12,
- 0.000004269440978532657,
- 168150804987904,
- 45601043513344,
- 3.218766689300537,
- 0.004908796865493059,
- 6.912310600280762,
- 1.1827739308800655e-11,
- 0.4748164415359497,
- 325.8381042480469,
- 626836635648,
- 5.464456762638292e-7,
- 3.170955982412547e-16,
- 3.496410840853059e-7,
- 8045534720,
- 0.00005887653969693929
- ],
- "type": "float32"
- }
- },
- {
- "name": "pow float32 4D exponent tensor and broadcastable 1D positive base tensor",
- "inputs": {
- "a": {
- "shape": [1],
- "data": [
- 11.594479317507522
- ],
- "type": "float32"
- },
- "b": {
"shape": [2, 2, 2, 3],
"data": [
17.84601042972939,
@@ -807,36 +512,114 @@
17.415215284302022
],
"type": "float32"
+ },
+ "b": {
+ "shape": [1],
+ "data": [2], // square
+ "type": "float32",
+ "constant": true
}
},
"expected": {
"name": "output",
"shape": [2, 2, 2, 3],
"data": [
- 9831930832107864000,
- 0.8567188382148743,
- 3.145953983429983e-11,
- 786871222272,
- 3.4610242370650813e-19,
- 4211286999040,
- 1.2196345930224334e-18,
- 673.3303833007812,
- 0.0010909875854849815,
- 2.2894641996167248e-15,
- 94425837469696,
- 0.34217458963394165,
- 2.0603237680819727e-17,
- 87906598912,
- 7080751803662336,
- 0.000005512045390787534,
- 7.14127336841233e-16,
- 2980.96923828125,
- 2168419861221343200,
- 0.0008485119906254113,
- 0.029340136796236038,
- 7.466013585144538e-7,
- 3388161848544067600,
- 3421086174482006000
+ 318.4800720214844,
+ 0.00398249039426446,
+ 97.38143157958984,
+ 124.94144439697266,
+ 300.8932800292969,
+ 140.71298217773438,
+ 283.32550048828125,
+ 7.062208652496338,
+ 7.747018814086914,
+ 189.23854064941406,
+ 172.43321228027344,
+ 0.19152326881885529,
+ 245.8212890625,
+ 105.74638366699219,
+ 221.806640625,
+ 24.41554069519043,
+ 202.5444793701172,
+ 10.657630920410156,
+ 296.84356689453125,
+ 8.328523635864258,
+ 2.073643445968628,
+ 33.14323043823242,
+ 303.1522521972656,
+ 303.2897033691406
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor",
+ "inputs": {
+ "a": {
+ "shape": [2, 2, 2, 3],
+ "data": [
+ 1.4186520416325132,
+ 19.384846302672862,
+ 12.983916515701083,
+ 2.460315836803,
+ 7.818154966175683,
+ 6.944444510618668,
+ 12.183951502858129,
+ 17.91247403540764,
+ 11.35656818684932,
+ 8.924248275595188,
+ 17.63682367890858,
+ 11.49622917976384,
+ 18.51627975602645,
+ 2.2580489773802714,
+ 2.231948203000913,
+ 13.629855345962834,
+ 17.54841363842334,
+ 0.5390733851574936,
+ 5.891367616729561,
+ 0.12803148642270834,
+ 19.654494983574544,
+ 3.412272498152542,
+ 4.9450348267065225,
+ 4.437101298745225
+ ],
+ "type": "float32"
+ },
+ "b": {
+ "shape": [1],
+ "data": [0.5], // sqrt
+ "type": "float32",
+ "constant": true
+ }
+ },
+ "expected": {
+ "name": "output",
+ "shape": [2, 2, 2, 3],
+ "data": [
+ 1.19107186794281,
+ 4.402822494506836,
+ 3.6033201217651367,
+ 1.5685393810272217,
+ 2.7960963249206543,
+ 2.6352314949035645,
+ 3.490551710128784,
+ 4.23231315612793,
+ 3.369950771331787,
+ 2.9873480796813965,
+ 4.199621677398682,
+ 3.3906090259552,
+ 4.3030548095703125,
+ 1.5026806592941284,
+ 1.4939706325531006,
+ 3.6918632984161377,
+ 4.189082622528076,
+ 0.7342162132263184,
+ 2.4272139072418213,
+ 0.35781487822532654,
+ 4.4333391189575195,
+ 1.847233772277832,
+ 2.223743438720703,
+ 2.106442928314209
],
"type": "float32"
}
@@ -994,79 +777,6 @@
],
"type": "float32"
}
- },
- {
- "name": "pow float32 4D exponent tensor and broadcastable 4D positive base tensor",
- "inputs": {
- "a": {
- "shape": [1, 1, 1, 1],
- "data": [
- 11.594479317507522
- ],
- "type": "float32"
- },
- "b": {
- "shape": [2, 2, 2, 3],
- "data": [
- 17.84601042972939,
- -0.06310698009783522,
- -9.868203150557209,
- 11.177720889025082,
- -17.346274412274497,
- 11.862249907078805,
- -16.832276297112916,
- 2.657481705284937,
- -2.783346559701183,
- -13.756399883988184,
- 13.131383020668672,
- -0.4376337155223524,
- -15.678688537967744,
- 10.283306376871472,
- 14.89317426754188,
- -4.941208383494091,
- -14.231812435141862,
- 3.2646027287637835,
- 17.229148713687444,
- -2.885918185998449,
- -1.440015043233842,
- -5.757015935913907,
- 17.41126899618849,
- 17.415215284302022
- ],
- "type": "float32"
- }
- },
- "expected": {
- "name": "output",
- "shape": [2, 2, 2, 3],
- "data": [
- 9831930832107864000,
- 0.8567188382148743,
- 3.145953983429983e-11,
- 786871222272,
- 3.4610242370650813e-19,
- 4211286999040,
- 1.2196345930224334e-18,
- 673.3303833007812,
- 0.0010909875854849815,
- 2.2894641996167248e-15,
- 94425837469696,
- 0.34217458963394165,
- 2.0603237680819727e-17,
- 87906598912,
- 7080751803662336,
- 0.000005512045390787534,
- 7.14127336841233e-16,
- 2980.96923828125,
- 2168419861221343200,
- 0.0008485119906254113,
- 0.029340136796236038,
- 7.466013585144538e-7,
- 3388161848544067600,
- 3421086174482006000
- ],
- "type": "float32"
- }
}
]
}
\ No newline at end of file
diff --git a/tests/wpt/tests/webrtc-stats/supported-stats.https.html b/tests/wpt/tests/webrtc-stats/supported-stats.https.html
index 24b4d3f06f0..c2319964973 100644
--- a/tests/wpt/tests/webrtc-stats/supported-stats.https.html
+++ b/tests/wpt/tests/webrtc-stats/supported-stats.https.html
@@ -147,9 +147,9 @@ promise_test(async t => {
}
const remaining = JSON.parse(JSON.stringify(all));
- for (const type in remaining) {
- remaining[type] = new Set(remaining[type]);
- }
+ for (const type in remaining) {
+ remaining[type] = new Set(remaining[type]);
+ }
const pc1 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
@@ -175,7 +175,11 @@ promise_test(async t => {
await pc2.setLocalDescription();
await waitForIceGatheringState(pc2, ['complete']);
await pc1.setRemoteDescription(pc2.localDescription);
-
+ // Await the DTLS handshake.
+ await Promise.all([
+ listenToConnected(pc1),
+ listenToConnected(pc2),
+ ]);
const stats = await getAllStats(t, pc1);
// The focus of this test is not API correctness, but rather to provide an
diff --git a/tests/wpt/tests/xhr/blob-range.any.js b/tests/wpt/tests/xhr/blob-range.any.js
new file mode 100644
index 00000000000..2a5c54fc34f
--- /dev/null
+++ b/tests/wpt/tests/xhr/blob-range.any.js
@@ -0,0 +1,246 @@
+// See also /fetch/range/blob.any.js
+
+const supportedBlobRange = [
+ {
+ name: "A simple blob range request.",
+ data: ["A simple Hello, World! example"],
+ type: "text/plain",
+ range: "bytes=9-21",
+ content_length: 13,
+ content_range: "bytes 9-21/30",
+ result: "Hello, World!",
+ },
+ {
+ name: "A blob range request with no type.",
+ data: ["A simple Hello, World! example"],
+ type: undefined,
+ range: "bytes=9-21",
+ content_length: 13,
+ content_range: "bytes 9-21/30",
+ result: "Hello, World!",
+ },
+ {
+ name: "A blob range request with no end.",
+ data: ["Range with no end"],
+ type: "text/plain",
+ range: "bytes=11-",
+ content_length: 6,
+ content_range: "bytes 11-16/17",
+ result: "no end",
+ },
+ {
+ name: "A blob range request with no start.",
+ data: ["Range with no start"],
+ type: "text/plain",
+ range: "bytes=-8",
+ content_length: 8,
+ content_range: "bytes 11-18/19",
+ result: "no start",
+ },
+ {
+ name: "A simple blob range request with whitespace.",
+ data: ["A simple Hello, World! example"],
+ type: "text/plain",
+ range: "bytes= \t9-21",
+ content_length: 13,
+ content_range: "bytes 9-21/30",
+ result: "Hello, World!",
+ },
+ {
+ name: "Blob content with short content and a large range end",
+ data: ["Not much here"],
+ type: "text/plain",
+ range: "bytes=4-100000000000",
+ content_length: 9,
+ content_range: "bytes 4-12/13",
+ result: "much here",
+ },
+ {
+ name: "Blob content with short content and a range end matching content length",
+ data: ["Not much here"],
+ type: "text/plain",
+ range: "bytes=4-13",
+ content_length: 9,
+ content_range: "bytes 4-12/13",
+ result: "much here",
+ },
+ {
+ name: "Blob range with whitespace before and after hyphen",
+ data: ["Valid whitespace #1"],
+ type: "text/plain",
+ range: "bytes=5 - 10",
+ content_length: 6,
+ content_range: "bytes 5-10/19",
+ result: " white",
+ },
+ {
+ name: "Blob range with whitespace after hyphen",
+ data: ["Valid whitespace #2"],
+ type: "text/plain",
+ range: "bytes=-\t 5",
+ content_length: 5,
+ content_range: "bytes 14-18/19",
+ result: "ce #2",
+ },
+ {
+ name: "Blob range with whitespace around equals sign",
+ data: ["Valid whitespace #3"],
+ type: "text/plain",
+ range: "bytes \t =\t 6-",
+ content_length: 13,
+ content_range: "bytes 6-18/19",
+ result: "whitespace #3",
+ },
+];
+
+const unsupportedBlobRange = [
+ {
+ name: "Blob range with no value",
+ data: ["Blob range should have a value"],
+ type: "text/plain",
+ range: "",
+ },
+ {
+ name: "Blob range with incorrect range header",
+ data: ["A"],
+ type: "text/plain",
+ range: "byte=0-"
+ },
+ {
+ name: "Blob range with incorrect range header #2",
+ data: ["A"],
+ type: "text/plain",
+ range: "bytes"
+ },
+ {
+ name: "Blob range with incorrect range header #3",
+ data: ["A"],
+ type: "text/plain",
+ range: "bytes\t \t"
+ },
+ {
+ name: "Blob range request with multiple range values",
+ data: ["Multiple ranges are not currently supported"],
+ type: "text/plain",
+ range: "bytes=0-5,15-",
+ },
+ {
+ name: "Blob range request with multiple range values and whitespace",
+ data: ["Multiple ranges are not currently supported"],
+ type: "text/plain",
+ range: "bytes=0-5, 15-",
+ },
+ {
+ name: "Blob range request with trailing comma",
+ data: ["Range with invalid trailing comma"],
+ type: "text/plain",
+ range: "bytes=0-5,",
+ },
+ {
+ name: "Blob range with no start or end",
+ data: ["Range with no start or end"],
+ type: "text/plain",
+ range: "bytes=-",
+ },
+ {
+ name: "Blob range request with short range end",
+ data: ["Range end should be greater than range start"],
+ type: "text/plain",
+ range: "bytes=10-5",
+ },
+ {
+ name: "Blob range start should be an ASCII digit",
+ data: ["Range start must be an ASCII digit"],
+ type: "text/plain",
+ range: "bytes=x-5",
+ },
+ {
+ name: "Blob range should have a dash",
+ data: ["Blob range should have a dash"],
+ type: "text/plain",
+ range: "bytes=5",
+ },
+ {
+ name: "Blob range end should be an ASCII digit",
+ data: ["Range end must be an ASCII digit"],
+ type: "text/plain",
+ range: "bytes=5-x",
+ },
+ {
+ name: "Blob range should include '-'",
+ data: ["Range end must include '-'"],
+ type: "text/plain",
+ range: "bytes=x",
+ },
+ {
+ name: "Blob range should include '='",
+ data: ["Range end must include '='"],
+ type: "text/plain",
+ range: "bytes 5-",
+ },
+ {
+ name: "Blob range should include 'bytes='",
+ data: ["Range end must include 'bytes='"],
+ type: "text/plain",
+ range: "5-",
+ },
+ {
+ name: "Blob content with short content and a large range start",
+ data: ["Not much here"],
+ type: "text/plain",
+ range: "bytes=100000-",
+ },
+ {
+ name: "Blob content with short content and a range start matching the content length",
+ data: ["Not much here"],
+ type: "text/plain",
+ range: "bytes=13-",
+ },
+];
+
+supportedBlobRange.forEach(({ name, data, type, range, content_length, content_range, result }) => {
+ promise_test(async t => {
+ const blob = new Blob(data, { "type" : type });
+ const blobURL = URL.createObjectURL(blob);
+ t.add_cleanup(() => URL.revokeObjectURL(blobURL));
+ const xhr = new XMLHttpRequest();
+ xhr.open("GET", blobURL);
+ xhr.responseType = "text";
+ xhr.setRequestHeader("Range", range);
+ await new Promise(resolve => {
+ xhr.onloadend = resolve;
+ xhr.send();
+ });
+ assert_equals(xhr.status, 206, "HTTP status is 206");
+ assert_equals(xhr.getResponseHeader("Content-Type"), type || "", "Content-Type is " + xhr.getResponseHeader("Content-Type"));
+ assert_equals(xhr.getResponseHeader("Content-Length"), content_length.toString(), "Content-Length is " + xhr.getResponseHeader("Content-Length"));
+ assert_equals(xhr.getResponseHeader("Content-Range"), content_range, "Content-Range is " + xhr.getResponseHeader("Content-Range"));
+ assert_equals(xhr.responseText, result, "Response's body is correct");
+ const all = xhr.getAllResponseHeaders().toLowerCase();
+ assert_true(all.includes(`content-type: ${type || ""}`), "Expected Content-Type in getAllResponseHeaders()");
+ assert_true(all.includes(`content-length: ${content_length}`), "Expected Content-Length in getAllResponseHeaders()");
+ assert_true(all.includes(`content-range: ${content_range}`), "Expected Content-Range in getAllResponseHeaders()")
+ }, name);
+});
+
+unsupportedBlobRange.forEach(({ name, data, type, range }) => {
+ promise_test(t => {
+ const blob = new Blob(data, { "type" : type });
+ const blobURL = URL.createObjectURL(blob);
+ t.add_cleanup(() => URL.revokeObjectURL(blobURL));
+
+ const xhr = new XMLHttpRequest();
+ xhr.open("GET", blobURL, false);
+ xhr.setRequestHeader("Range", range);
+ assert_throws_dom("NetworkError", () => xhr.send());
+
+ xhr.open("GET", blobURL);
+ xhr.setRequestHeader("Range", range);
+ xhr.responseType = "text";
+ return new Promise((resolve, reject) => {
+ xhr.onload = reject;
+ xhr.onerror = resolve;
+ xhr.send();
+ });
+ }, name);
+});
diff --git a/tests/wpt/webgl/meta/conformance/context/context-release-with-workers.html.ini b/tests/wpt/webgl/meta/conformance/context/context-release-with-workers.html.ini
deleted file mode 100644
index d440058eae9..00000000000
--- a/tests/wpt/webgl/meta/conformance/context/context-release-with-workers.html.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-[context-release-with-workers.html]
- expected: CRASH