Bug 1518005 - Fix intermittent devotools test. r=bgrins

Wait for devtools panel to be ready before attempting to use it.

Differential Revision: https://phabricator.services.mozilla.com/D27160

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brendan Dahl 2019-04-11 21:08:04 +00:00
Родитель 6680ead353
Коммит 3a89c21f7f
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -29,8 +29,8 @@ function waitForPaused(dbg) {
});
}
function createDebuggerContext(toolbox) {
const panel = toolbox.getPanel("jsdebugger");
async function createDebuggerContext(toolbox) {
const panel = await toolbox.getPanelWhenReady("jsdebugger");
const win = panel.panelWin;
const { store, client, selectors, actions } = panel.getVarsForTests();
@ -76,7 +76,7 @@ add_task(async function() {
const target = await TargetFactory.forTab(gBrowser.selectedTab);
await gDevTools.showToolbox(target, "jsdebugger");
const dbg = createDebuggerContext(toolbox);
const dbg = await createDebuggerContext(toolbox);
await waitForPaused(dbg);