const URL = `data:text/xml, Tove Jani Reminder Don't forget me this weekend! `; add_task(async function xml_pretty_print_toggle() { await BrowserTestUtils.withNewTab(URL, async function (browser) { await SpecialPowers.spawn(browser, [], () => { let summary = content.document.documentElement.openOrClosedShadowRoot.querySelector( "summary" ); let details = summary.parentNode; ok(details.open, "Should be open"); summary.click(); ok(!details.open, "Should be closed"); }); }); });