Bug 1447621 [wpt PR 10122] - [css-grid] Fix testing-utils.js, a=testonly
authorManuel Rego Casasnovas <rego@igalia.com>
Mon, 09 Apr 2018 17:30:20 +0000
changeset 467138 939bbbe074776987ae799ff3893c02b7ba5ab634
parent 467137 654918a6a5cdd917d6018b42980c318995609813
child 467139 7400f57873759665e8b21684fbeb45de01359641
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1447621, 10122, 973063, 544681
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/css/css-grid/grid-definition/support/testing-utils.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -501467,17 +501467,17 @@
    "57659c467b0abc12fc953edd6e96a07d2f15786e",
    "reftest"
   ],
   "css/css-grid/grid-definition/support/grid.css": [
    "6bb300b8baebf700481ea162fb7b41913fcca29c",
    "support"
   ],
   "css/css-grid/grid-definition/support/testing-utils.js": [
-   "7d6dc5106777942ad83e6bc570368af113f32d5f",
+   "bda861857e383f7e77e2aded1d1c9af1340cc126",
    "support"
   ],
   "css/css-grid/grid-items/anonymous-grid-item-001.html": [
    "1d684c1f3ba7867f711e0bec65f4f665ab6e67dd",
    "reftest"
   ],
   "css/css-grid/grid-items/explicitly-sized-grid-item-as-table.html": [
    "2d713db8aa5f79164259a2c7b2b3f6b89f8aeed4",
--- a/testing/web-platform/tests/css/css-grid/grid-definition/support/testing-utils.js
+++ b/testing/web-platform/tests/css/css-grid/grid-definition/support/testing-utils.js
@@ -1,29 +1,35 @@
 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");
     }
 
     function testGridTemplateColumnsRows(gridId, columnsStyle, rowsStyle, columnsComputedValue, rowsComputedValue) {
         test(function() {
             var grid = document.getElementById(gridId);
             grid.style.gridTemplateColumns = columnsStyle;
             grid.style.gridTemplateRows = rowsStyle;
             checkGridTemplateColumns(grid, columnsComputedValue);
             checkGridTemplateRows(grid, rowsComputedValue);
         }, "'" + gridId + "' with: grid-template-columns: " + columnsStyle  + "; and grid-template-rows: " + rowsStyle + ";");
     }
 
     function checkGridTemplateAreas(element, value) {
+        if (!Array.isArray(value))
+            value = new Array(value);
         assert_in_array(getComputedStyle(element).gridTemplateAreas, value, "gridTemplateAreas");
     }
 
     function testGridTemplateAreas(gridId, style, value) {
         test(function() {
             var grid = document.getElementById(gridId);
             grid.style.gridTemplateAreas = style;
             checkGridTemplateAreas(grid, value);