Bug 993580 - Fix webconsole error count test. r=pbrosset, a=lsblakk
authorGirish Sharma <scrapmachines@gmail.com>
Thu, 10 Apr 2014 02:30:01 +0530
changeset 192943 b4ddc9970bc77327ee8ff04f1b6afdd70eac233c
parent 192942 508f43d65a23c2efa0c88375c5e61d60ad688355
child 192944 daa9e5a292cabfd558b0e472693904e347c1810e
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbrosset, lsblakk
bugs993580
milestone30.0a2
Bug 993580 - Fix webconsole error count test. r=pbrosset, a=lsblakk
browser/devtools/framework/gDevTools.jsm
browser/devtools/shared/test/browser_toolbar_webconsole_errors_count.js
--- a/browser/devtools/framework/gDevTools.jsm
+++ b/browser/devtools/framework/gDevTools.jsm
@@ -314,17 +314,17 @@ DevTools.prototype = {
   },
 
   /**
    * Close the toolbox for a given target
    */
   closeToolbox: function DT_closeToolbox(target) {
     let toolbox = this._toolboxes.get(target);
     if (toolbox == null) {
-      return;
+      return promise.reject(null);
     }
     return toolbox.destroy();
   },
 
   /**
    * Called to tear down a tools provider.
    */
   _teardown: function DT_teardown() {
--- a/browser/devtools/shared/test/browser_toolbar_webconsole_errors_count.js
+++ b/browser/devtools/shared/test/browser_toolbar_webconsole_errors_count.js
@@ -188,20 +188,21 @@ function test() {
       },
       failure: testEnd,
     };
   }
 
   function testEnd() {
     document.getElementById("developer-toolbar-closebutton").doCommand();
     let target1 = TargetFactory.forTab(tab1);
-    gDevTools.closeToolbox(target1);
-    gBrowser.removeTab(tab1);
-    gBrowser.removeTab(tab2);
-    finish();
+    gDevTools.closeToolbox(target1).then(() => {
+      gBrowser.removeTab(tab1);
+      gBrowser.removeTab(tab2);
+      finish();
+    });
   }
 
   // Utility functions
 
   function getErrorsCount() {
     let count = webconsole.getAttribute("error-count");
     return count ? count : "0";
   }