Bug 1767787 - [devtools] Wait until default editor has focus in browser_styleeditor_bug_851132_middle_click.js r=nchevobbe

I could reproduce the intermittent locally and when it occurs, the initial editor actually didn't have focus.
I think that what happens is that we hit a race condition where the focus is stolen by the initial editor after we clicked on a new stylesheet
and switched to a new editor.

Differential Revision: https://phabricator.services.mozilla.com/D149952
This commit is contained in:
Julian Descottes 2022-06-22 07:20:06 +00:00
Родитель 5de1d5d3d8
Коммит 2c8736a218
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -14,6 +14,11 @@ add_task(async function() {
await ui.editors[0].getSourceEditor();
info("first editor selected");
await waitFor(
() => ui.editors[0].sourceEditor.hasFocus(),
"Wait until the initially selected editor grabs the focus"
);
info("Left-clicking on the second editor link.");
await clickOnStyleSheetLink(ui.editors[1], 0);