Bug 1224088 - Ensure DOMContentLoaded and load markers don't interfere with browser_net_timeline_ticks.js. r=vporof
authorSami Jaktholm <sjakthol@outlook.com>
Fri, 20 Nov 2015 12:31:26 +0200
changeset 276432 39b4e4fe690ba6ecace461eef6c1cb13ca177a57
parent 276431 4747283cf161568291eba40c66b43a80989dfeff
child 276433 6724dd9550d7de2da86bc036df71ca3197e44b1b
push id69162
push usercbook@mozilla.com
push dateTue, 15 Dec 2015 13:52:23 +0000
treeherdermozilla-inbound@98d65afd9826 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvporof
bugs1224088
milestone45.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 1224088 - Ensure DOMContentLoaded and load markers don't interfere with browser_net_timeline_ticks.js. r=vporof The test checks that the time division ticks are correctly rendeded in the NetMonitor waterfall view. However, the new DOMContentLoaded and load markers might be drawn on top of these which causes the assertions to fail. These changes make the test remove the new markers and redraw the waterfall before asserting that the time ticks are correct.
devtools/client/netmonitor/test/browser_net_timeline_ticks.js
--- a/devtools/client/netmonitor/test/browser_net_timeline_ticks.js
+++ b/devtools/client/netmonitor/test/browser_net_timeline_ticks.js
@@ -4,17 +4,17 @@
 /**
  * Tests if timeline correctly displays interval divisions.
  */
 
 function test() {
   initNetMonitor(SIMPLE_URL).then(([aTab, aDebuggee, aMonitor]) => {
     info("Starting test... ");
 
-    let { document, L10N, NetMonitorView } = aMonitor.panelWin;
+    let { document, L10N, NetMonitorView, NetMonitorController } = aMonitor.panelWin;
     let { RequestsMenu } = NetMonitorView;
 
     // Disable transferred size column support for this test.
     // Without this, the waterfall only has enough room for one division, which
     // would remove most of the value of this test.
     document.querySelector("#requests-menu-transferred-header-box").hidden = true;
     document.querySelector("#requests-menu-item-template .requests-menu-transferred").hidden = true;
 
@@ -26,16 +26,21 @@ function test() {
       "No tick labels should be displayed when the frontend is opened.");
 
     ok(!RequestsMenu._canvas,
       "No canvas should be created when the frontend is opened.");
     ok(!RequestsMenu._ctx,
       "No 2d context should be created when the frontend is opened.");
 
     waitForNetworkEvents(aMonitor, 1).then(() => {
+      // Make sure the DOMContentLoaded and load markers don't interfere with
+      // this test by removing them and redrawing the waterfall (bug 1224088).
+      NetMonitorController.NetworkEventsHandler.clearMarkers();
+      RequestsMenu._flushWaterfallViews(true);
+
       ok(!document.querySelector("#requests-menu-waterfall-label"),
         "The timeline label should be hidden after the first request.");
       ok(document.querySelectorAll(".requests-menu-timings-division").length >= 3,
         "There should be at least 3 tick labels in the network requests header.");
 
       is(document.querySelectorAll(".requests-menu-timings-division")[0]
         .getAttribute("value"), L10N.getFormatStr("networkMenu.millisecond", 0),
         "The first tick label has an incorrect value");