Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

  • This test gets skipped with pattern: os == 'linux' && os_version == '22.04' && arch == 'x86_64' && display == 'wayland' OR os == 'linux' && os_version == '24.04' && arch == 'x86_64' && display == 'x11' OR os == 'mac' && os_version == '10.15' && arch == 'x86_64' OR os == 'mac' && os_version == '14.70' && arch == 'x86_64'
  • Manifest: dom/html/test/browser.toml
// Tests that the DOMDocElementInserted event is visible on the frame
add_task(async function () {
let tab = BrowserTestUtils.addTab(gBrowser);
let uri = "data:text/html;charset=utf-8,<html/>";
// Register synchronously before starting the load to avoid race condition
let eventPromise = BrowserTestUtils.waitForContentEvent(
tab.linkedBrowser,
"DOMDocElementInserted",
true
);
BrowserTestUtils.startLoadingURIString(tab.linkedBrowser, uri);
await eventPromise;
let loadedURI = await SpecialPowers.spawn(tab.linkedBrowser, [], function () {
return content.document.documentURI;
});
is(loadedURI, uri, "Should have seen the event for the right URI");
gBrowser.removeTab(tab);
});