Bug 1317732 - Reduce logging in test_value_storage.html on Android only. r=dbaron, a=test-only
authorGeoff Brown <gbrown@mozilla.com>
Fri, 18 Nov 2016 15:00:41 -0700
changeset 352502 aca4526abbb954903cfdbf8ef794e291bc8ec0f9
parent 352501 245e0f8fa30487fede658f4fd7e03314027c3ab1
child 352503 9dbda637a860cdc3f9809209f50e47f110977ecf
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron, test-only
bugs1317732
milestone52.0a2
Bug 1317732 - Reduce logging in test_value_storage.html on Android only. r=dbaron, a=test-only
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);