blob: 7a2fb77f105705b2ece7b7e495a3673f59faef94 [file] [log] [blame]
function getElementsByIds(ids) {
var result = [];
ids.forEach(function(id) {
result.push(document.getElementById(id));
});
return result;
}
function testSelectorIdsMatch(selector, ids, testName) {
test(function(){
var elements = document.querySelectorAll(selector);
assert_array_equals([...elements], getElementsByIds(ids));
}, testName);
}
function testSelectorElementsMatch(selector, elements, testName) {
test(function(){
assert_array_equals([...document.querySelectorAll(selector)], elements);
}, testName);
}