Bug 1489219 - Wait until runtime page is ready;r=daisuke,ladybenko

--HG--
extra : rebase_source : df649e78f4cc0056962fde3dc77f3e2bf938983b
This commit is contained in:
Julian Descottes 2018-09-07 17:41:44 +02:00
parent eef1913bcb
commit bbfd3d0bae
3 changed files with 11 additions and 6 deletions

View File

@ -21,13 +21,13 @@ function selectPage(page) {
return;
}
dispatch({ type: PAGE_SELECTED, page });
if (page === PAGES.THIS_FIREFOX) {
dispatch(Actions.connectRuntime());
await dispatch(Actions.connectRuntime());
} else {
dispatch(Actions.disconnectRuntime());
await dispatch(Actions.disconnectRuntime());
}
dispatch({ type: PAGE_SELECTED, page });
};
}

View File

@ -54,7 +54,7 @@ class RuntimePage extends PureComponent {
return dom.article(
{
className: "page",
className: "page js-runtime-page",
},
RuntimeInfo({
icon: "chrome://branding/content/icon64.png",

View File

@ -18,7 +18,10 @@ const EXPECTED_TARGET_PANES = [
];
add_task(async function() {
const { document } = await openAboutDebugging();
const { document, tab } = await openAboutDebugging();
// Wait until the client connection was established.
await waitUntil(() => document.querySelector(".js-runtime-page"));
// Check that the selected sidebar item is "This Firefox"
const selectedSidebarItem = document.querySelector(".js-sidebar-item-selected");
@ -36,4 +39,6 @@ add_task(async function() {
ok(paneTitles.includes(expectedPane),
"Expected debug target category found: " + expectedPane);
});
await removeTab(tab);
});