diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /devtools/client/inspector/boxmodel/test/browser_boxmodel_edit-position-visible-position-change.js | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | devtools/client/inspector/boxmodel/test/browser_boxmodel_edit-position-visible-position-change.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/devtools/client/inspector/boxmodel/test/browser_boxmodel_edit-position-visible-position-change.js b/devtools/client/inspector/boxmodel/test/browser_boxmodel_edit-position-visible-position-change.js new file mode 100644 index 0000000000..0cae75aaaf --- /dev/null +++ b/devtools/client/inspector/boxmodel/test/browser_boxmodel_edit-position-visible-position-change.js @@ -0,0 +1,56 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Tests that the 'Edit Position' button is still visible after +// layout is changed. +// see bug 1398722 + +const TEST_URI = ` + <div id="mydiv" style="background:tomato; + position:absolute; + top:10px; + left:10px; + width:100px; + height:100px"> +`; + +add_task(async function () { + await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI)); + const { inspector, boxmodel } = await openLayoutView(); + + await selectNode("#mydiv", inspector); + let editPositionButton = boxmodel.document.querySelector( + ".layout-geometry-editor" + ); + + ok( + isNodeVisible(editPositionButton), + "Edit Position button is visible initially" + ); + + const positionLeftTextbox = boxmodel.document.querySelector( + ".boxmodel-editable[title=position-left]" + ); + ok(isNodeVisible(positionLeftTextbox), "Position-left edit box exists"); + + info("Change the value of position-left and submit"); + const onUpdate = waitForUpdate(inspector); + EventUtils.synthesizeMouseAtCenter( + positionLeftTextbox, + {}, + boxmodel.document.defaultView + ); + EventUtils.synthesizeKey("8", {}, boxmodel.document.defaultView); + EventUtils.synthesizeKey("VK_RETURN", {}, boxmodel.document.defaultView); + + await onUpdate; + editPositionButton = boxmodel.document.querySelector( + ".layout-geometry-editor" + ); + ok( + isNodeVisible(editPositionButton), + "Edit Position button is still visible after layout change" + ); +}); |