Bug 991075 - Fix unhandled promise errors. r=jryans

This commit is contained in:
Jordan Santell 2014-06-12 18:03:00 +02:00
parent ebbeebd17b
commit 8126c1bb88
2 changed files with 14 additions and 12 deletions

View File

@ -501,12 +501,14 @@ let gDevToolsBrowser = {
} else { } else {
toolbox.destroy(); toolbox.destroy();
} }
gDevTools.emit("select-tool-command", toolId);
} else { } else {
gDevTools.showToolbox(target, toolId).then(() => { gDevTools.showToolbox(target, toolId).then(() => {
let target = devtools.TargetFactory.forTab(gBrowser.selectedTab); let target = devtools.TargetFactory.forTab(gBrowser.selectedTab);
let toolbox = gDevTools.getToolbox(target); let toolbox = gDevTools.getToolbox(target);
toolbox.fireCustomKey(toolId); toolbox.fireCustomKey(toolId);
gDevTools.emit("select-tool-command", toolId);
}); });
} }
}, },

View File

@ -58,7 +58,7 @@ function test()
} }
gDevTools.once("toolbox-ready", (e, toolbox) => { gDevTools.once("toolbox-ready", (e, toolbox) => {
inspectorShouldBeOpenAndHighlighting(toolbox.getCurrentPanel(), toolbox) inspectorShouldBeOpenAndHighlighting(toolbox.getCurrentPanel(), toolbox);
}); });
keysetMap.inspector.synthesizeKey(); keysetMap.inspector.synthesizeKey();
@ -74,30 +74,30 @@ function test()
aToolbox.once("picker-stopped", () => { aToolbox.once("picker-stopped", () => {
ok(true, "picker-stopped event received, highlighter stopped"); ok(true, "picker-stopped event received, highlighter stopped");
aToolbox.once("webconsole-ready", (e, panel) => { gDevTools.once("select-tool-command", () => {
webconsoleShouldBeSelected(aToolbox, panel); webconsoleShouldBeSelected(aToolbox);
}); });
keysetMap.webconsole.synthesizeKey(); keysetMap.webconsole.synthesizeKey();
}); });
}); });
} }
function webconsoleShouldBeSelected(aToolbox, panel) function webconsoleShouldBeSelected(aToolbox)
{ {
is (aToolbox.currentToolId, "webconsole"); is (aToolbox.currentToolId, "webconsole", "webconsole should be selected.");
aToolbox.once("jsdebugger-ready", (e, panel) => { gDevTools.once("select-tool-command", () => {
jsdebuggerShouldBeSelected(aToolbox, panel); jsdebuggerShouldBeSelected(aToolbox);
}); });
keysetMap.jsdebugger.synthesizeKey(); keysetMap.jsdebugger.synthesizeKey();
} }
function jsdebuggerShouldBeSelected(aToolbox, panel) function jsdebuggerShouldBeSelected(aToolbox)
{ {
is (aToolbox.currentToolId, "jsdebugger"); is (aToolbox.currentToolId, "jsdebugger", "jsdebugger should be selected.");
aToolbox.once("netmonitor-ready", (e, panel) => { gDevTools.once("select-tool-command", () => {
netmonitorShouldBeSelected(aToolbox, panel); netmonitorShouldBeSelected(aToolbox);
}); });
keysetMap.netmonitor.synthesizeKey(); keysetMap.netmonitor.synthesizeKey();
@ -105,7 +105,7 @@ function test()
function netmonitorShouldBeSelected(aToolbox, panel) function netmonitorShouldBeSelected(aToolbox, panel)
{ {
is (aToolbox.currentToolId, "netmonitor"); is (aToolbox.currentToolId, "netmonitor", "netmonitor should be selected.");
finishUp(); finishUp();
} }