aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/html/semantics/selectors/pseudo-classes/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wpt/web-platform-tests/html/semantics/selectors/pseudo-classes/utils.js')
m---------tests/wpt/web-platform-tests0
-rw-r--r--tests/wpt/web-platform-tests/html/semantics/selectors/pseudo-classes/utils.js14
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests b/tests/wpt/web-platform-tests
deleted file mode 160000
-Subproject 29dfb8944e535d439ca94cf7d1b1d9138a8ad11
diff --git a/tests/wpt/web-platform-tests/html/semantics/selectors/pseudo-classes/utils.js b/tests/wpt/web-platform-tests/html/semantics/selectors/pseudo-classes/utils.js
new file mode 100644
index 00000000000..8f5497ec57e
--- /dev/null
+++ b/tests/wpt/web-platform-tests/html/semantics/selectors/pseudo-classes/utils.js
@@ -0,0 +1,14 @@
+function getElementsByIds(ids) {
+ var result = [];
+ ids.forEach(function(id) {
+ result.push(document.getElementById(id));
+ });
+ return result;
+}
+
+function testSelector(selector, expected, testName) {
+ test(function(){
+ var elements = document.querySelectorAll(selector);
+ assert_array_equals(elements, getElementsByIds(expected));
+ }, testName);
+}