Bug 1187110 part 4: In test_extra_inherit_initial.html, only test every special-keyword with the first few values of each property (and then test one keyword per value). r=heycam
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 04 Aug 2015 14:05:22 -0700
changeset 287875 a5b09e238cd885aaf87cb18ac59263c1d34066f4
parent 287874 c4e7b4e83365ba58b6d6753aad25bed557ba9e5a
child 287876 f763ac7bd0bdb6f643c64c2ddb9275023719f59a
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1187110
milestone42.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 1187110 part 4: In test_extra_inherit_initial.html, only test every special-keyword with the first few values of each property (and then test one keyword per value). r=heycam
layout/style/test/test_extra_inherit_initial.html
--- a/layout/style/test/test_extra_inherit_initial.html
+++ b/layout/style/test/test_extra_inherit_initial.html
@@ -28,16 +28,18 @@ let gPropsNeedComma = {
   "font": true,
   "font-family": true,
   "voice-family": true,
 };
 
 let gElement = document.getElementById("testnode");
 let gDeclaration = gElement.style;
 
+let kValuesToTestThoroughly = 3;
+
 function test_property(property)
 {
   let info = gCSSProperties[property];
 
   let delim = (property in gPropsNeedComma) ? ", " : " ";
 
   function test_value_pair(relation, val1, val2, extraval) {
     let decl = property + ": " + val1 + delim + val2;
@@ -53,29 +55,41 @@ function test_property(property)
     } else {
       // Longhand property.
       is(gDeclaration.getPropertyValue(property), "",
          ["expected", extraval, "ignored", relation, "value in",
           "'" + decl + "'"].join(" "));
     }
   }
 
-  function test_value(value) {
+  function test_value(value, valueIdx) {
     let specialKeywords = [ "inherit", "initial", "unset" ];
-    for (let keyword of specialKeywords) {
+
+    if (valueIdx < kValuesToTestThoroughly) {
+      // For the first few values, we test each special-keyword both before
+      // and after the value.
+      for (let keyword of specialKeywords) {
+        test_value_pair("before", keyword, value, keyword);
+        test_value_pair("after", value, keyword, keyword);
+      }
+    } else {
+      // For later values, only test one keyword before & after it.
+      let keywordIdx =
+        (valueIdx - kValuesToTestThoroughly) % specialKeywords.length;
+      keyword = specialKeywords[keywordIdx];
       test_value_pair("before", keyword, value, keyword);
       test_value_pair("after", value, keyword, keyword);
     }
   }
 
   for (let idx in info.initial_values) {
-    test_value(info.initial_values[idx]);
+    test_value(info.initial_values[idx], idx);
   }
   for (let idx in info.other_values) {
-    test_value(info.initial_values[idx]);
+    test_value(info.initial_values[idx], idx);
   }
 }
 
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestLongerTimeout(4);
 
 function start_test() {
   for (let prop in gCSSProperties) {