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 {
toolbox.destroy();
}
gDevTools.emit("select-tool-command", toolId);
} else {
gDevTools.showToolbox(target, toolId).then(() => {
let target = devtools.TargetFactory.forTab(gBrowser.selectedTab);
let toolbox = gDevTools.getToolbox(target);
toolbox.fireCustomKey(toolId);
gDevTools.emit("select-tool-command", toolId);
});
}
},

View File

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