Bug 1425954 Part 2: Update grid tests to check reporting of duplicated line names. draft
authorBrad Werth <bwerth@mozilla.com>
Mon, 18 Dec 2017 15:25:02 -0800
changeset 713598 87d11bb6b82a886563addb682af87fecfe9bc3b3
parent 713597 0d8de59041894c7c558736d861a7b46d13cc490e
child 713615 f3b7f73a2315acdc62db3ed682a6a309c6565330
push id93687
push userbwerth@mozilla.com
push dateWed, 20 Dec 2017 17:35:54 +0000
bugs1425954
milestone59.0a1
Bug 1425954 Part 2: Update grid tests to check reporting of duplicated line names. MozReview-Commit-ID: E0x7GXY9gUu
dom/grid/test/chrome/test_grid_lines.html
dom/grid/test/chrome/test_grid_repeats.html
--- a/dom/grid/test/chrome/test_grid_lines.html
+++ b/dom/grid/test/chrome/test_grid_lines.html
@@ -7,18 +7,18 @@
 <style>
 body {
   margin: 40px;
 }
 .wrapper {
   display: grid;
   width: 400px;
   grid-gap: 10px;
-  grid-template-columns: 50px [first] repeat(3, [divider] 100px) [last];
-  grid-template-rows: [top1] repeat(1, [top2] 50px) [bot];
+  grid-template-columns: 50px [first first] repeat(3, [divider] 100px) [last last last last];
+  grid-template-rows: [top1 top2] repeat(1, [top2 top2] 50px) [bot];
   background-color: #f00;
 }
 .box {
   background-color: #444;
   color: #fff;
 }
 </style>
 
@@ -50,53 +50,39 @@ function runTests() {
       // test column line numbers, positive and negative
       is(grid.cols.lines[3].number, 4, "Grid column line 4 positive number is as expected.");
       is(grid.cols.lines[3].negativeNumber, -2, "Grid column line 4 negative number is as expected.");
 
       // test column line names
       is(grid.cols.lines[0].names.length, 0, "Grid column line 1 has no names.");
 
       is(grid.cols.lines[1].names.length, 2, "Grid column line 2 has 2 names.");
-      isnot(grid.cols.lines[1].names.indexOf("first"), -1,
-        "Grid column line 2 has the name 'first'."
-      );
-      isnot(grid.cols.lines[1].names.indexOf("divider"), -1,
-        "Grid column line 2 has the name 'divider'."
-      );
+      is(grid.cols.lines[1].names + "", "first,divider", "Grid column line 2 has the names 'first,divider'.");
 
       is(grid.cols.lines[4].names.length, 1, "Grid column line 5 has 1 name.");
-      isnot(grid.cols.lines[4].names.indexOf("last"), -1,
-        "Grid column line 5 has the name 'last'."
-      );
+      is(grid.cols.lines[4].names + "", "last", "Grid column line 5 has the name 'last'.");
     }
   }
 
   // test property existence
   isnot(typeof(grid.rows.lines), "undefined", "Grid.rows.lines property exists.");
 
   if (typeof(grid.rows.lines) != "undefined") {
     // test column line count
     is(grid.rows.lines.length, 3,
       "Grid.rows.lines property has length that matches grid-template-rows."
     );
 
     if (grid.rows.lines.length == 3) {
       // test row line names
       is(grid.rows.lines[0].names.length, 2, "Grid row line 1 has 2 names.");
-      isnot(grid.rows.lines[0].names.indexOf("top1"), -1,
-        "Grid row line 1 has the name 'top1'."
-      );
-      isnot(grid.rows.lines[0].names.indexOf("top2"), -1,
-        "Grid row line 1 has the name 'top2'."
-      );
+      is(grid.rows.lines[0].names + "", "top1,top2", "Grid row line 1 has the names 'top1,top2'.");
 
       is(grid.rows.lines[1].names.length, 1, "Grid row line 2 has 1 name.");
-      isnot(grid.rows.lines[1].names.indexOf("bot"), -1,
-        "Grid row line 2 has the name 'bot'."
-      );
+      is(grid.rows.lines[1].names + "", "bot", "Grid row line 2 has the name 'bot'.");
 
       is(grid.rows.lines[2].names.length, 0, "Grid row line 3 has no names.");
     }
   }
 
   SimpleTest.finish();
 }
 </script>
--- a/dom/grid/test/chrome/test_grid_repeats.html
+++ b/dom/grid/test/chrome/test_grid_repeats.html
@@ -29,17 +29,17 @@ body {
 }
 .grid5 {
   grid-template-columns: [real-before] repeat(auto-fit, [before] 100px [after]) [real-after];
 }
 .grid6 {
   grid-template-columns: [first] 0px [real-before] repeat(auto-fit, [before] 100px [after]) [real-after];
 }
 .grid7 {
-  grid-template-columns: [real-before] repeat(auto-fit, [before] 100px [after]) [real-after] 0px [final];
+  grid-template-columns: [real-before before] repeat(auto-fit, [before] 100px [after]) [after real-after] 0px [final];
 }
 .grid8 {
   grid-template-columns: [real-before] repeat(auto-fit, [before] 1000px [after]) [real-after];
 }
 .grid9 {
   grid-template-columns: [real-before] repeat(auto-fit, 100px [after]) [real-after];
 }
 .grid10 {