Bug 1189901: part 4: scroll: report custom test name. r=jmaher
☠☠ backed out by 9dfac0d146bc ☠ ☠
authorAvi Halachmi <avihpit@yahoo.com>
Tue, 27 Sep 2016 16:43:37 +0300
changeset 315361 926a610af8a723b75e0f4b5991f978f9e0d745ad
parent 315360 610b70634239c1dc46d4f5052666a09ce712601d
child 315362 647db9f59d9eb39a50de8fa31c1313781658305e
push id82138
push userahalachmi@mozilla.com
push dateTue, 27 Sep 2016 13:43:58 +0000
treeherdermozilla-inbound@14660f4f2b23 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1189901
milestone52.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 1189901: part 4: scroll: report custom test name. r=jmaher
testing/talos/talos/pageloader/chrome/tscroll.js
--- a/testing/talos/talos/pageloader/chrome/tscroll.js
+++ b/testing/talos/talos/pageloader/chrome/tscroll.js
@@ -7,16 +7,30 @@ function testScroll(target, stepSize, op
   var win;
   if (target == "content") {
     target = content.wrappedJSObject;
     win = content;
   } else {
     win = window;
   }
 
+  var result = {
+    names: [],
+    values: [],
+  };
+  // We report multiple results, so we base the name on the path.
+  // Everything after '/tp5n/' if exists (for tp5o_scroll), or the file name at
+  // the path if non-empty (e.g. with tscrollx), or the last dir otherwise (e.g.
+  // 'mydir' for 'http://my.domain/dir1/mydir/').
+  var href = win.location.href;
+  var testBaseName = href.split("/tp5n/")[1]
+                  || href.split("/").pop()
+                  || href.split("/").splice(-2, 1)[0]
+                  || "REALLY_WEIRD_URI";
+
   var report;
   /**
    * Sets up the value of 'report' as a function for reporting the test result[s].
    * Chooses between the "usual" tpRecordTime which the pageloader addon injects
    * to pages, or a custom function in case we're a framescript which pageloader
    * added to the tested page, or a debug tpRecordTime from talos-debug.js if
    * running in a plain browser.
    *
@@ -131,17 +145,19 @@ function testScroll(target, stepSize, op
             win.talosDebug.displayData = true; // In a browser: also display all data points.
 
           // For analysis (otherwise, it's too many data points for talos):
           var sum = 0;
           for (var i = 0; i < durations.length; i++)
             sum += Number(durations[i]);
 
           // Report average interval or (failsafe) 0 if no intervls were recorded
-          resolve(durations.length ? sum / durations.length : 0);
+          result.values.push(durations.length ? sum / durations.length : 0);
+          result.names.push(testBaseName);
+          resolve();
           return;
         }
 
         lastScrollPos = getPos();
         rAF(tick);
       }
 
       if (typeof(Profiler) !== "undefined") {
@@ -151,18 +167,18 @@ function testScroll(target, stepSize, op
     });
   }
 
   P_setupReportFn()
   .then(FP_wait(260))
   .then(gotoTop)
   .then(P_rAF)
   .then(P_syncScrollTest)
-  .then(function(result) { // function since 'report' might not be ready when invoking 'then'
-    report(result);
+  .then(function() {
+    report(result.values.join(","), 0, result.names.join(","));
   });
 }
 
 // This code below here is unique to tscroll.js inside of pageloader
 try {
   function handleMessageFromChrome(message) {
     var payload = message.data.details;
     testScroll(payload.target, payload.stepSize, 'PageLoader:RecordTime', payload.opt_numSteps);