summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/boxmodel/test/browser_boxmodel_edit-position-visible-position-change.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /devtools/client/inspector/boxmodel/test/browser_boxmodel_edit-position-visible-position-change.js
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
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.js56
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"
+ );
+});