Bug 1531838 - Reliably wait for click-to-play popup notification in private windows. r=johannh

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nihanth Subramanya 2019-04-10 22:11:39 +00:00
Родитель 4716e57f4c
Коммит d849a2f135
1 изменённых файлов: 6 добавлений и 2 удалений

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

@ -110,7 +110,9 @@ add_task(async function test2c() {
await createPrivateWindow(gHttpTestRoot + "plugin_test.html");
await topicObserved;
let popupNotification = gPrivateWindow.PopupNotifications.getNotification("click-to-play-plugins", gPrivateBrowser);
let popupNotification = await TestUtils.waitForCondition(() => {
return gPrivateWindow.PopupNotifications.getNotification("click-to-play-plugins", gPrivateBrowser);
}, "Waiting for click-to-play-plugins notification in the private window");
ok(popupNotification, "Test 2c, Should have a click-to-play notification");
await ContentTask.spawn(gPrivateBrowser, null, function() {
@ -172,7 +174,9 @@ add_task(async function test3c() {
await createPrivateWindow(gHttpTestRoot + "plugin_test.html");
await topicObserved;
let popupNotification = gPrivateWindow.PopupNotifications.getNotification("click-to-play-plugins", gPrivateBrowser);
let popupNotification = await TestUtils.waitForCondition(() => {
return gPrivateWindow.PopupNotifications.getNotification("click-to-play-plugins", gPrivateBrowser);
}, "Waiting for click-to-play-plugins notification in the private window");
ok(popupNotification, "Test 3c, Should have a click-to-play notification");
// Check the button status