Bug 1578979 - Wait after createHost to fix tests failing with devtools running in a content frame r=ochameau

Even though we still need to fix those awaits, this removes the need to use the pref in 3 tests.
We should ultimately investigate why our switchHost/createHost can sometimes resolve too early and make the tests fail.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2019-09-26 08:49:13 +00:00
Родитель 389a1827c2
Коммит d1f601ae62
3 изменённых файлов: 20 добавлений и 13 удалений

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

@ -25,12 +25,12 @@ function getTooltipContent(doc) {
}
add_task(async function() {
// Run DevTools in a chrome frame temporarily, otherwise this test is intermittent.
// See Bug 1571421.
await pushPref("devtools.toolbox.content-frame", false);
const [, , doc] = await createHost("bottom", TEST_URI);
// Creating a host is not correctly waiting when DevTools run in content frame
// See Bug 1571421.
await wait(1000);
const box1 = doc.getElementById("box1");
const box2 = doc.getElementById("box2");
const box3 = doc.getElementById("box3");

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

@ -16,18 +16,19 @@ add_task(async function() {
set: [["security.allow_unsafe_parent_loads", true]],
});
// Run DevTools in a chrome frame temporarily, otherwise this test is intermittent.
// See Bug 1571421.
await pushPref("devtools.toolbox.content-frame", false);
await addTab("about:blank");
const [host, win, doc] = await createHost("bottom", TEST_URI);
// Creating a host is not correctly waiting when DevTools run in content frame
// See Bug 1571421.
await wait(1000);
const tree = new TreeWidget(doc.querySelector("div"), {
defaultType: "store",
});
populateTree(tree, doc);
await testKeyboardInteraction(tree, win);
tree.destroy();
@ -126,7 +127,13 @@ async function testKeyboardInteraction(tree, win) {
const clicked = once(node, "click");
tree.once("select", pass);
click(node);
await Promise.all([event.promise, clicked]);
info("Wait for the click event");
await clicked;
info("Wait for the select event on tree");
await event.promise;
node = tree.root.children.firstChild.nextSibling.firstChild;
// node should not have selected class
ok(

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

@ -16,13 +16,13 @@ add_task(async function() {
set: [["security.allow_unsafe_parent_loads", true]],
});
// Run DevTools in a chrome frame temporarily, otherwise this test is intermittent.
// See Bug 1571421.
await pushPref("devtools.toolbox.content-frame", false);
await addTab("about:blank");
const [host, , doc] = await createHost("bottom", TEST_URI);
// Creating a host is not correctly waiting when DevTools run in content frame
// See Bug 1571421.
await wait(1000);
const tree = new TreeWidget(doc.querySelector("div"), {
defaultType: "store",
});