Bug 1579042 - Fix race condition in tests after introducing tab descriptors r=ochameau

Depends on D63503

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2020-02-28 11:46:02 +00:00
Родитель b55ae3db68
Коммит 2070a97ab6
5 изменённых файлов: 13 добавлений и 2 удалений

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

@ -61,11 +61,13 @@ add_task(async function() {
"so that the about:devtools-toolbox tab loses focus"
);
newNavigator.gBrowser.selectedTab = newNavigator.gBrowser.addTab(
"about:blank",
"data:text/html,<title>TEST_TAB</title>",
{
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
}
);
await waitUntil(() => findDebugTargetByText("TEST_TAB", document));
clickInspectButton(inspectionTarget, document);
assertDevtoolsToolboxTabState(devtoolsURL);

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

@ -34,6 +34,8 @@ add_task(async function() {
info("closing the toolbox");
await removeTab(devtoolsTab);
await waitUntil(() => !findDebugTargetByText("Toolbox -", document));
info("removing about:debugging tab");
await removeTab(tab);
});

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

@ -53,6 +53,7 @@ async function testMainProcessTarget(name, description) {
await selectRuntime(RUNTIME_DEVICE_NAME, RUNTIME_APP_NAME, document);
info("Check debug target item of the main process");
await waitUntil(() => findDebugTargetByText(name, document));
const mainProcessItem = findDebugTargetByText(name, document);
ok(mainProcessItem, "Debug target item of the main process should display");
ok(

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

@ -311,12 +311,18 @@ async function connectToRuntime(deviceName, document) {
async function selectRuntime(deviceName, name, document) {
const sidebarItem = findSidebarItemByText(deviceName, document);
const store = document.defaultView.AboutDebugging.store;
const onSelectPageSuccess = waitForDispatch(store, "SELECT_PAGE_SUCCESS");
sidebarItem.querySelector(".qa-sidebar-link").click();
await waitUntil(() => {
const runtimeInfo = document.querySelector(".qa-runtime-name");
return runtimeInfo && runtimeInfo.textContent.includes(name);
});
info("Wait for SELECT_PAGE_SUCCESS to be dispatched");
await onSelectPageSuccess;
}
function getToolbox(win) {

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

@ -83,7 +83,7 @@ function testAttachRemovedTab() {
deferred.reject();
});
gTab2Front.attach().then(null, error => {
gTab2Front.reconfigure({}).then(null, error => {
ok(
error.message.includes("noSuchActor"),
"Actor is gone since the tab was removed."