Bug 1685413 - [devtools] Re-enable devtools/client/dom/test/browser_dom_fission_target_switching.js test for Fission. r=ladybenko.

The test used to fail after navigating because the expected property
wasn't displayed.
Here we're trying to work around that by:
- using the navigateTo helper function, which takes care of waiting for the right events
- awaiting until the property is displayed (since it wasn't before), just in case the
rendering takes more time than expected.

Differential Revision: https://phabricator.services.mozilla.com/D101783
This commit is contained in:
Nicolas Chevobbe 2021-01-15 15:52:51 +00:00
Родитель adced38f36
Коммит 1c5bbdcbf4
2 изменённых файлов: 5 добавлений и 15 удалений

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

@ -12,7 +12,6 @@ support-files =
[browser_dom_array.js]
[browser_dom_basic.js]
[browser_dom_fission_target_switching.js]
skip-if = fission # Disable frequent fission intermittents Bug 1675020
[browser_dom_nodes_highlight.js]
[browser_dom_nodes_select.js]
[browser_dom_refresh.js]

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

@ -15,33 +15,24 @@ add_task(async function() {
info("Open a page that runs in the parent process");
const { panel } = await addTestTab(PARENT_PROCESS_URI);
let _aProperty = getRowByLabel(panel, "_a");
const _aProperty = getRowByLabel(panel, "_a");
let buttonProperty = getRowByLabel(panel, "button");
ok(!_aProperty, "There is no _a property on the about:robots page");
ok(buttonProperty, "There is, however, a button property on this page");
info("Navigate to a page that runs in the content process");
const toolbox = panel.getToolbox();
// Wait for the DOM panel to refresh.
const onPropertiesFetched = waitForDispatch(panel, "FETCH_PROPERTIES");
// Also wait for the toolbox to switch to the new target, to avoid hanging requests when
// the test ends.
const onTargetSwitched = toolbox.targetList.once("switched-target");
await navigateTo(CONTENT_PROCESS_URI);
await onPropertiesFetched;
await toolbox.target.navigateTo({ url: CONTENT_PROCESS_URI });
await waitFor(() => getRowByLabel(panel, "_a"));
ok(true, "This time, the _a property exists on this content process page");
await Promise.all([onPropertiesFetched, onTargetSwitched]);
_aProperty = getRowByLabel(panel, "_a");
buttonProperty = getRowByLabel(panel, "button");
ok(
_aProperty,
"This time, the _a property exists on this content process page"
);
ok(
!buttonProperty,
"There is, however, no more button property on this page"