Bug 1172120 - Add more logging for browser_perf-marker-details-01.js and similar tests, r=me
authorVictor Porof <vporof@mozilla.com>
Thu, 18 Jun 2015 15:29:51 -0400
changeset 249946 6602f26b004ceb8f72a205b16df54038077f2935
parent 249788 1679ea0f802f1160031327dd34762b9150d28891
child 249947 3fff7decfb61c1fcbe9d75e0b15411642fa3ece6
push id61393
push usercbook@mozilla.com
push dateMon, 22 Jun 2015 12:44:45 +0000
treeherdermozilla-inbound@4b47c3f074a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1172120
milestone41.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 1172120 - Add more logging for browser_perf-marker-details-01.js and similar tests, r=me
browser/devtools/performance/test/browser_perf-marker-details-01.js
browser/devtools/performance/test/browser_timeline-filters-01.js
browser/devtools/performance/test/browser_timeline-waterfall-sidebar.js
--- a/browser/devtools/performance/test/browser_perf-marker-details-01.js
+++ b/browser/devtools/performance/test/browser_perf-marker-details-01.js
@@ -18,69 +18,73 @@ function* spawnTest() {
     return { submarkers: markers };
   };
 
   const MARKER_TYPES = [
     "Styles", "Reflow", "Paint", "ConsoleTime", "TimeStamp"
   ];
 
   yield startRecording(panel);
+  ok(true, "Recording has started.");
+
   yield waitUntil(() => {
-    // Wait until we get 3 different markers.
+    // Wait until we get all the different markers.
     let markers = PerformanceController.getCurrentRecording().getMarkers();
     return MARKER_TYPES.every(type => markers.some(m => m.name === type));
   });
-  yield stopRecording(panel);
 
-  // Select everything
-  let timeline = OverviewView.graphs.get("timeline");
-  let rerendered = WaterfallView.once(EVENTS.WATERFALL_RENDERED);
-  timeline.setSelection({ start: 0, end: timeline.width });
-  yield rerendered;
+  yield stopRecording(panel);
+  ok(true, "Recording has ended.");
+
+  info("No need to select everything in the timeline.");
+  info("All the markers should be displayed by default.");
 
   let bars = $$(".waterfall-marker-bar");
   let markers = PerformanceController.getCurrentRecording().getMarkers();
 
   ok(bars.length >= MARKER_TYPES.length, `Got at least ${MARKER_TYPES.length} markers (1)`);
   ok(markers.length >= MARKER_TYPES.length, `Got at least ${MARKER_TYPES.length} markers (2)`);
 
   const tests = {
     ConsoleTime: function (marker) {
+      info("Got `ConsoleTime` marker with data: " + JSON.stringify(marker));
       shouldHaveStack($, "startStack", marker);
       shouldHaveStack($, "endStack", marker);
       shouldHaveLabel($, "Timer Name:", "!!!", marker);
       return true;
     },
     TimeStamp: function (marker) {
+      info("Got `TimeStamp` marker with data: " + JSON.stringify(marker));
       shouldHaveLabel($, "Label:", "go", marker);
       shouldHaveStack($, "stack", marker);
       return true;
     },
     Styles: function (marker) {
+      info("Got `Styles` marker with data: " + JSON.stringify(marker));
       if (marker.restyleHint) {
         shouldHaveLabel($, "Restyle Hint:", marker.restyleHint.replace(/eRestyle_/g, ""), marker);
       }
       if (marker.stack) {
         shouldHaveStack($, "stack", marker);
         return true;
       }
     },
     Reflow: function (marker) {
+      info("Got `Reflow` marker with data: " + JSON.stringify(marker));
       if (marker.stack) {
         shouldHaveStack($, "stack", marker);
         return true;
       }
     }
   };
 
   // Keep track of all marker tests that are finished so we only
   // run through each marker test once, so we don't spam 500 redundant
   // tests.
   let testsDone = [];
-  let TOTAL_TESTS = 4;
 
   for (let i = 0; i < bars.length; i++) {
     let bar = bars[i];
     let m = markers[i];
     EventUtils.sendMouseEvent({ type: "mousedown" }, bar);
 
     if (tests[m.name]) {
       if (testsDone.indexOf(m.name) === -1) {
@@ -88,17 +92,17 @@ function* spawnTest() {
         if (fullTestComplete) {
           testsDone.push(m.name);
         }
       }
     } else {
       info(`TODO: Need to add marker details tests for ${m.name}`);
     }
 
-    if (testsDone.length === TOTAL_TESTS) {
+    if (testsDone.length === Object.keys(tests).length) {
       break;
     }
   }
 
   yield teardown(panel);
   finish();
 }
 
--- a/browser/devtools/performance/test/browser_timeline-filters-01.js
+++ b/browser/devtools/performance/test/browser_timeline-filters-01.js
@@ -20,16 +20,17 @@ function* spawnTest() {
     // Wait until we get 3 different markers.
     let markers = PerformanceController.getCurrentRecording().getMarkers();
     return markers.some(m => m.name == "Styles") &&
            markers.some(m => m.name == "Reflow") &&
            markers.some(m => m.name == "Paint");
   });
 
   yield stopRecording(panel);
+  ok(true, "Recording has ended.");
 
   // Push some fake markers of a type we do not have a blueprint for
   let markers = PerformanceController.getCurrentRecording().getMarkers();
   let endTime = markers[markers.length - 1].end;
   markers.push({ name: "CustomMarker", start: endTime + EPSILON, end: endTime + (EPSILON * 2) });
   markers.push({ name: "CustomMarker", start: endTime + (EPSILON * 3), end: endTime + (EPSILON * 4) });
 
   // Invalidate marker cache
--- a/browser/devtools/performance/test/browser_timeline-waterfall-sidebar.js
+++ b/browser/devtools/performance/test/browser_timeline-waterfall-sidebar.js
@@ -28,16 +28,19 @@ function* spawnTest() {
     return markers.some(m => m.name == "Styles") &&
            markers.some(m => m.name == "Reflow") &&
            markers.some(m => m.name == "Paint");
   });
 
   yield stopRecording(panel);
   ok(true, "Recording has ended.");
 
+  info("No need to select everything in the timeline.");
+  info("All the markers should be displayed by default.");
+
   let bars = $$(".waterfall-marker-bar");
   let markers = PerformanceController.getCurrentRecording().getMarkers();
 
   ok(bars.length > 2, "Got at least 3 markers (1)");
   ok(markers.length > 2, "Got at least 3 markers (2)");
 
   let toMs = ms => L10N.getFormatStrWithNumbers("timeline.tick", ms);