browser_inspector_delete-selected-node-03.js (858B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 "use strict"; 4 5 // Test to ensure inspector can handle destruction of selected node inside an iframe. 6 7 const TEST_URL = URL_ROOT + "doc_inspector_delete-selected-node-01.html"; 8 9 add_task(async function () { 10 const { inspector } = await openInspectorForURL(TEST_URL); 11 12 info("Select a node inside the iframe"); 13 await selectNodeInFrames(["iframe", "span"], inspector); 14 15 info("Removing iframe."); 16 const onInspectorUpdated = inspector.once("inspector-updated"); 17 SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => { 18 content.document.querySelector("iframe").remove(); 19 }); 20 await onInspectorUpdated; 21 22 const body = await getNodeFront("body", inspector); 23 is(inspector.selection.nodeFront, body, "Selection is now the body node"); 24 });