Bug 1447621 [wpt PR 10122] - [css-grid] Fix testing-utils.js, a=testonly

Automatic update from web-platform-tests[css-grid] Fix testing-utils.js

We have been calling testGridTemplateColumnsRows() with
and without arrays.
Arrays are needed because the serialization of 2 tracks of the same size
can be "100px 100px" or "repeat(2, 100px)".
But in the rest of the cases we don't need an array,
so we call the method with a single value.
testGridTemplateColumnsRows() was not ready to support that,
and it wasn't actually checking anything in that case.

The patch modifies testing-utils.js, so it wraps values in an array
when required.
Now testGridTemplateColumnsRows() will be actually checking things.

Change-Id: I7e360677c391df74dedb474922bf5c04247141c5
Reviewed-on: https://chromium-review.googlesource.com/973063
Reviewed-by: Sergio Villar <svillar@igalia.com>
Commit-Queue: Manuel Rego Casasnovas <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#544681}

wpt-commits: 535e9629904e3f24ac891763d5d24b8475df5926
wpt-pr: 10122
wpt-commits: 535e9629904e3f24ac891763d5d24b8475df5926
wpt-pr: 10122
This commit is contained in:
Manuel Rego Casasnovas 2018-04-09 17:30:20 +00:00 коммит произвёл James Graham
Родитель b5eddf0c65
Коммит 45c68451a7
2 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -501472,7 +501472,7 @@
"support"
],
"css/css-grid/grid-definition/support/testing-utils.js": [
"7d6dc5106777942ad83e6bc570368af113f32d5f",
"bda861857e383f7e77e2aded1d1c9af1340cc126",
"support"
],
"css/css-grid/grid-items/anonymous-grid-item-001.html": [

Просмотреть файл

@ -1,10 +1,14 @@
var TestingUtils = (function() {
function checkGridTemplateColumns(element, value) {
if (!Array.isArray(value))
value = new Array(value);
assert_in_array(getComputedStyle(element).gridTemplateColumns, value, "gridTemplateColumns");
}
function checkGridTemplateRows(element, value) {
if (!Array.isArray(value))
value = new Array(value);
assert_in_array(getComputedStyle(element).gridTemplateRows, value, "gridTemplateRows");
}
@ -19,6 +23,8 @@ var TestingUtils = (function() {
}
function checkGridTemplateAreas(element, value) {
if (!Array.isArray(value))
value = new Array(value);
assert_in_array(getComputedStyle(element).gridTemplateAreas, value, "gridTemplateAreas");
}