Bug 1698771 - browser_PartnerLinkAttribution.js should wait for a rebuild event on the oneOffButtons instead of relying on the implicit initial TestUtils.waitForCondition timer, r=Standard8.

Differential Revision: https://phabricator.services.mozilla.com/D108616
This commit is contained in:
Florian Quèze 2021-03-17 17:39:36 +00:00
Родитель 93ae28290a
Коммит fed6316ae9
1 изменённых файлов: 6 добавлений и 2 удалений

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

@ -108,8 +108,12 @@ async function searchInSearchbar(inputText) {
sb.focus();
sb.value = inputText;
sb.textbox.controller.startSearch(inputText);
// Wait for the popup to show.
await BrowserTestUtils.waitForEvent(sb.textbox.popup, "popupshown");
// Wait for the popup to be shown and built.
let popup = sb.textbox.popup;
await Promise.all([
BrowserTestUtils.waitForEvent(popup, "popupshown"),
BrowserTestUtils.waitForEvent(popup.oneOffButtons, "rebuild"),
]);
// And then for the search to complete.
await BrowserTestUtils.waitForCondition(
() =>