Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Errors

  • This test gets skipped with pattern: os == 'linux' && os_version == '18.04' && processor == 'x86_64' && asan OR os == 'linux' && os_version == '18.04' && processor == 'x86_64' && tsan OR os == 'linux' && os_version == '24.04' && processor == 'x86_64' && display == 'x11' && asan OR os == 'linux' && os_version == '24.04' && processor == 'x86_64' && display == 'x11' && tsan
  • This test failed 77 times in the preceding 30 days. quicksearch this test
  • Manifest: devtools/client/framework/test/browser.toml
/* Any copyright is dedicated to the Public Domain.
"use strict";
/**
* Check that tab descriptor survives after the page navigates and changes
* process.
*/
const EXAMPLE_COM_URI =
const EXAMPLE_ORG_URI =
add_task(async function () {
const tab = await addTab(EXAMPLE_COM_URI);
const toolbox = await gDevTools.showToolboxForTab(tab);
const target = toolbox.target;
const client = toolbox.commands.client;
info("Retrieve the initial list of tab descriptors");
const tabDescriptors = await client.mainRoot.listTabs();
const tabDescriptor = tabDescriptors.find(
d => decodeURIComponent(d.url) === EXAMPLE_COM_URI
);
ok(tabDescriptor, "Should have a descriptor actor for the tab");
info("Retrieve the target corresponding to the TabDescriptor");
const comTabTarget = await tabDescriptor.getTarget();
is(
target,
comTabTarget,
"The toolbox target is also the target associated with the tab descriptor"
);
const waitForDevToolsReload = await watchForDevToolsReload(
gBrowser.selectedBrowser,
{
isErrorPage: false,
waitForLoad: true,
}
);
await tabDescriptor.navigateTo(EXAMPLE_ORG_URI, true);
await waitForDevToolsReload();
info("Call list tabs again to update the tab descriptor forms");
await client.mainRoot.listTabs();
is(
decodeURIComponent(tabDescriptor.url),
EXAMPLE_ORG_URI,
"The existing descriptor now points to the new URI"
);
const newTarget = toolbox.target;
is(
comTabTarget.actorID,
null,
"With Fission or server side target switching, example.com target front is destroyed"
);
Assert.notEqual(
comTabTarget,
newTarget,
"With Fission or server side target switching, a new target was created for example.org"
);
const onDescriptorDestroyed = tabDescriptor.once("descriptor-destroyed");
await removeTab(tab);
info("Wait for descriptor destroyed event");
await onDescriptorDestroyed;
ok(tabDescriptor.isDestroyed(), "the descriptor front is really destroyed");
});