diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /layout/xul/test/test_bug703150.xhtml | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.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 'layout/xul/test/test_bug703150.xhtml')
-rw-r--r-- | layout/xul/test/test_bug703150.xhtml | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/layout/xul/test/test_bug703150.xhtml b/layout/xul/test/test_bug703150.xhtml new file mode 100644 index 0000000000..4a7230bd49 --- /dev/null +++ b/layout/xul/test/test_bug703150.xhtml @@ -0,0 +1,74 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + xmlns:html="http://www.w3.org/1999/xhtml" + title="Test for Bug 703150"> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=703150 +--> + + <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> + <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> + +<scrollbar id="scrollbar" curpos="0" maxpos="500"/> + +<script class="testbody" type="application/javascript"> +<![CDATA[ +function doTest() +{ + var scrollbar = document.getElementById("scrollbar"); + var scrollbarThumb = null; + for (let child of SpecialPowers.InspectorUtils.getChildrenForNode(scrollbar, true, false)) { + if (child.nodeName === "slider") { + scrollbarThumb = SpecialPowers.unwrap(child.childNodes[0]); + } + } + + ok(scrollbarThumb, "Should find thumb"); + is(scrollbarThumb.nodeName, "thumb", "Should find thumb"); + + function mousedownHandler(aEvent) + { + aEvent.stopPropagation(); + } + window.addEventListener("mousedown", mousedownHandler, true); + + // Wait for finishing reflow... + SimpleTest.executeSoon(function () { + synthesizeMouseAtCenter(scrollbarThumb, { type: "mousedown" }); + + is(scrollbar.getAttribute("curpos"), "0", + "scrollbar thumb has been moved already"); + + synthesizeMouseAtCenter(scrollbar, { type: "mousemove" }); + + ok(scrollbar.getAttribute("curpos") > 0, + "scrollbar thumb hasn't been dragged"); + + synthesizeMouseAtCenter(scrollbarThumb, { type: "mouseup" }); + + window.removeEventListener("mousedown", mousedownHandler, true); + + SimpleTest.finish(); + }); +} + +SimpleTest.waitForExplicitFinish(); + +]]> +</script> + +<body id="html_body" xmlns="http://www.w3.org/1999/xhtml"> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=703150">Mozilla Bug 703150</a> +<p id="display"></p> + +<pre id="test"> +</pre> +<script> +addLoadEvent(doTest); +</script> +</body> + + +</window> |