diff options
Diffstat (limited to 'devtools/client/inspector/markup/test/browser_markup_remove_xul_attributes.js')
-rw-r--r-- | devtools/client/inspector/markup/test/browser_markup_remove_xul_attributes.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/devtools/client/inspector/markup/test/browser_markup_remove_xul_attributes.js b/devtools/client/inspector/markup/test/browser_markup_remove_xul_attributes.js new file mode 100644 index 0000000000..89ac844149 --- /dev/null +++ b/devtools/client/inspector/markup/test/browser_markup_remove_xul_attributes.js @@ -0,0 +1,36 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test confirms that XUL attributes don't show up as empty +// attributes after being deleted + +const TEST_URL = URL_ROOT_SSL + "doc_markup_xul.xhtml"; + +add_task(async function () { + await SpecialPowers.pushPermissions([ + { type: "allowXULXBL", allow: true, context: URL_ROOT_SSL }, + ]); + + const { inspector } = await openInspectorForURL(TEST_URL); + + const panelFront = await getNodeFront("#test", inspector); + ok( + panelFront.hasAttribute("id"), + "panelFront has id attribute in the beginning" + ); + + info("Removing panel's id attribute"); + const onMutation = inspector.once("markupmutation"); + await removeContentPageElementAttribute("#test", "id"); + + info("Waiting for markupmutation"); + await onMutation; + + is( + panelFront.hasAttribute("id"), + false, + "panelFront doesn't have id attribute anymore" + ); +}); |