Bug 797639 - Part 4: Fix Network Monitor test leaks. r=vporof
authorJ. Ryan Stinnett <jryans@gmail.com>
Wed, 14 May 2014 14:30:02 -0500
changeset 183120 1f71b3099720b947bbe8d5b5d5f46f1972dffe36
parent 183119 798860192cb48d867d3082bd7f10b607e9cdd661
child 183121 c0d4a7bb2d4153003ed8617f203ff29f985e08fd
push id6799
push userjryans@gmail.com
push dateWed, 14 May 2014 19:31:26 +0000
treeherderfx-team@1f71b3099720 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvporof
bugs797639
milestone32.0a1
Bug 797639 - Part 4: Fix Network Monitor test leaks. r=vporof
browser/devtools/netmonitor/test/browser_net_filter-04.js
browser/devtools/netmonitor/test/browser_net_simple-request.js
--- a/browser/devtools/netmonitor/test/browser_net_filter-04.js
+++ b/browser/devtools/netmonitor/test/browser_net_filter-04.js
@@ -18,17 +18,17 @@ function test() {
 
     is(Prefs.filters.length, 2,
       "All filter types were loaded as an array from the preferences.");
     is(Prefs.filters[0], "js",
       "The first filter type is correct.");
     is(Prefs.filters[1], "bogus",
       "The second filter type is invalid, but loaded anyway.");
 
-    waitForNetworkEvents(aMonitor, 7).then(() => {
+    waitForNetworkEvents(aMonitor, 8).then(() => {
       testFilterButtons(aMonitor, "js");
       ok(true, "Only the correct filter type was taken into consideration.");
 
       teardown(aMonitor).then(() => {
         let filters = Services.prefs.getCharPref("devtools.netmonitor.filters");
         is(filters, '["js"]',
           "The bogus filter type was ignored and removed from the preferences.");
 
--- a/browser/devtools/netmonitor/test/browser_net_simple-request.js
+++ b/browser/devtools/netmonitor/test/browser_net_simple-request.js
@@ -20,29 +20,29 @@ function test() {
     is(document.querySelector("#requests-menu-empty-notice")
       .hasAttribute("hidden"), false,
       "An empty notice should be displayed when the frontend is opened.");
     is(RequestsMenu.itemCount, 0,
       "The requests menu should be empty when the frontend is opened.");
     is(NetMonitorView.detailsPaneHidden, true,
       "The details pane should be hidden when the frontend is opened.");
 
-    aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.NETWORK_EVENT, () => {
+    waitForNetworkEvents(aMonitor, 1).then(() => {
       is(document.querySelector("#details-pane-toggle")
         .hasAttribute("disabled"), false,
         "The pane toggle button should be enabled after the first request.");
       is(document.querySelector("#requests-menu-empty-notice")
         .hasAttribute("hidden"), true,
         "The empty notice should be hidden after the first request.");
       is(RequestsMenu.itemCount, 1,
         "The requests menu should not be empty after the first request.");
       is(NetMonitorView.detailsPaneHidden, true,
         "The details pane should still be hidden after the first request.");
 
-      aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.NETWORK_EVENT, () => {
+      waitForNetworkEvents(aMonitor, 1).then(() => {
         is(document.querySelector("#details-pane-toggle")
           .hasAttribute("disabled"), false,
           "The pane toggle button should be still be enabled after a reload.");
         is(document.querySelector("#requests-menu-empty-notice")
           .hasAttribute("hidden"), true,
           "The empty notice should be still hidden after a reload.");
         is(RequestsMenu.itemCount, 1,
           "The requests menu should not be empty after a reload.");