diff options
Diffstat (limited to 'devtools/client/inspector/test/browser_inspector_pane-toggle-layout-invariant.js')
-rw-r--r-- | devtools/client/inspector/test/browser_inspector_pane-toggle-layout-invariant.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/devtools/client/inspector/test/browser_inspector_pane-toggle-layout-invariant.js b/devtools/client/inspector/test/browser_inspector_pane-toggle-layout-invariant.js new file mode 100644 index 0000000000..1abc7db975 --- /dev/null +++ b/devtools/client/inspector/test/browser_inspector_pane-toggle-layout-invariant.js @@ -0,0 +1,32 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test that documents with suppressed whitespace nodes are unaffected by the +// activation of the inspector panel. + +const TEST_URL = URL_ROOT + "doc_inspector_pane-toggle-layout-invariant.html"; + +async function getInvariantRect() { + return SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function () { + const invariant = content.document.getElementById("invariant"); + return invariant.getBoundingClientRect(); + }); +} + +add_task(async function () { + await addTab(TEST_URL); + + // Get the initial position of the "invariant" element. We'll later check it + // again and we'll expect to get the same value. + const beforeRect = await getInvariantRect(); + + // Open the inspector. + await openInspector(); + + const afterRect = await getInvariantRect(); + + is(afterRect.x, beforeRect.x, "invariant x should be same as initial value."); + is(afterRect.y, beforeRect.y, "invariant y should be same as initial value."); +}); |