Bug 1317732 - Reduce logging in test_value_storage.html on Android only; r=dbaron
authorGeoff Brown <gbrown@mozilla.com>
Fri, 18 Nov 2016 15:00:41 -0700
changeset 323529 07ed7e5fa5ff504ce36ce72758dc9418ef6035c3
parent 323528 f05fed01586c799de59edb4a7628f494978dcacc
child 323530 5d5b77bd538895c2cb305ccd4b0842cc754509ce
push id21
push usermaklebus@msu.edu
push dateThu, 01 Dec 2016 06:22:08 +0000
reviewersdbaron
bugs1317732
milestone53.0a1
Bug 1317732 - Reduce logging in test_value_storage.html on Android only; r=dbaron
layout/style/test/test_value_storage.html
--- a/layout/style/test/test_value_storage.html
+++ b/layout/style/test/test_value_storage.html
@@ -86,16 +86,34 @@ var gPropertyShorthands = {};
 
 var gElement = document.getElementById("testnode");
 var gDeclaration = gElement.style;
 var gComputedStyle = window.getComputedStyle(gElement, "");
 
 var gPrereqDeclaration =
   document.getElementById("prereqsheet").sheet.cssRules[0].style;
 
+// On Android, avoid most 'TEST-PASS' logging by overriding
+// SimpleTest.is/isnot, to improve performance
+if (navigator.appVersion.indexOf("Android") >= 0) {
+  is = function is(a, b, name)
+  {
+    var pass = Object.is(a, b);
+    if (!pass)
+      SimpleTest.is(a, b, name);
+  }
+
+  isnot = function isnot(a, b, name)
+  {
+    var pass = !Object.is(a, b);
+    if (!pass)
+      SimpleTest.isnot(a, b, name);
+  }
+}
+
 // Returns true if propA and propB are equivalent, considering aliasing.
 // (i.e. if one is an alias of the other, or if they're both aliases of
 // the same 3rd property)
 function are_properties_aliased(propA, propB)
 {
   // If either property is an alias, replace it with the property it aliases.
   if ("alias_for" in gCSSProperties[propA]) {
     propA = gCSSProperties[propA].alias_for;
@@ -150,17 +168,17 @@ function test_property(property)
     var step1comp;
     var step1comps = [];
     if (info.type != CSS_TYPE_TRUE_SHORTHAND)
       step1comp = gComputedStyle.getPropertyValue(property);
     if ("subproperties" in info)
       for (idx in info.subproperties)
         step1comps.push(gComputedStyle.getPropertyValue(info.subproperties[idx]));
 
-    isnot(step1val, "", "setting '" + value + "' on '" + property + "'");
+    SimpleTest.isnot(step1val, "", "setting '" + value + "' on '" + property + "'");
     if ("subproperties" in info)
       for (idx in info.subproperties) {
         var subprop = info.subproperties[idx];
         if (value_has_variable_reference &&
             (!info.alias_for || info.type == CSS_TYPE_TRUE_SHORTHAND)) {
           is(gDeclaration.getPropertyValue(subprop), "",
              "setting '" + value + "' on '" + property + "' (for '" + subprop + "')");
           test_other_shorthands_empty(value, subprop);