Bug 1092451 - Ensure waiting for frames button update before resolving toolbox.open. r=past
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 03 Nov 2014 13:52:00 -0500
changeset 213966 92073635b516f8e522ab0f494ffc9df3fcec6309
parent 213965 26bc4268f868ccca19336a56bae4663153649aee
child 213967 a51796d31cf46a10f312da649b673522ad0f585d
push id27769
push userkwierso@gmail.com
push dateWed, 05 Nov 2014 03:53:35 +0000
treeherdermozilla-central@62990ec7ad78 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs1092451
milestone36.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 1092451 - Ensure waiting for frames button update before resolving toolbox.open. r=past
browser/devtools/framework/toolbox.js
--- a/browser/devtools/framework/toolbox.js
+++ b/browser/devtools/framework/toolbox.js
@@ -263,17 +263,17 @@ Toolbox.prototype = {
     let deferred = promise.defer();
 
     return this._host.create().then(iframe => {
       let deferred = promise.defer();
 
       let domReady = () => {
         this.isReady = true;
 
-        this._listFrames();
+        let framesPromise = this._listFrames();
 
         this.closeButton = this.doc.getElementById("toolbox-close");
         this.closeButton.addEventListener("command", this.destroy, true);
 
         gDevTools.on("pref-changed", this._prefChanged);
 
         let framesMenu = this.doc.getElementById("command-button-frames");
         framesMenu.addEventListener("command", this.selectFrame, true);
@@ -304,17 +304,18 @@ Toolbox.prototype = {
           // console input will receive focus.
           let splitConsolePromise = promise.resolve();
           if (Services.prefs.getBoolPref(SPLITCONSOLE_ENABLED_PREF)) {
             splitConsolePromise = this.openSplitConsole();
           }
 
           promise.all([
             splitConsolePromise,
-            buttonsPromise
+            buttonsPromise,
+            framesPromise
           ]).then(() => {
             this.emit("ready");
             deferred.resolve();
           }, deferred.reject);
         });
       };
 
       // Load the toolbox-level actor fronts and utilities now
@@ -1224,23 +1225,23 @@ Toolbox.prototype = {
                                toolName, this.target.url || this.target.name);
     this._host.setTitle(title);
   },
 
   _listFrames: function (event) {
     if (!this._target.form || !this._target.form.actor) {
       // We are not targetting a regular TabActor
       // it can be either an addon or browser toolbox actor
-      return;
+      return promise.resolve();
     }
     let packet = {
       to: this._target.form.actor,
       type: "listFrames"
     };
-    this._target.client.request(packet, resp => {
+    return this._target.client.request(packet, resp => {
       this._updateFrames(null, { frames: resp.frames });
     });
   },
 
   selectFrame: function (event) {
     let windowId = event.target.getAttribute("data-window-id");
     let packet = {
       to: this._target.form.actor,