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 /dom/base/test/test_suppressed_events_and_scrolling.html | |
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 'dom/base/test/test_suppressed_events_and_scrolling.html')
-rw-r--r-- | dom/base/test/test_suppressed_events_and_scrolling.html | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/dom/base/test/test_suppressed_events_and_scrolling.html b/dom/base/test/test_suppressed_events_and_scrolling.html new file mode 100644 index 0000000000..2a1d5ea493 --- /dev/null +++ b/dom/base/test/test_suppressed_events_and_scrolling.html @@ -0,0 +1,47 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <title>Test event suppression and scrolling</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" href="/tests/SimpleTest/test.css"/> + <script> + SimpleTest.waitForExplicitFinish(); + + function run() { + let testWin = window.open("file_suppressed_events_and_scrolling.html"); + // The order of xhrDone and didScroll is random. + let xhrDone = false; + let didScroll = false; + window.onmessage = function(e) { + let iframeWindow = testWin.document.body.firstChild.contentWindow; + info(e.data); + if (e.data == "doscroll") { + iframeWindow.scrollTo(0, 1500); + } else if (e.data == "xhr_done") { + xhrDone = true; + if (didScroll) { + iframeWindow.scrollTo(0, 3000); + } + } else if (e.data == "didscroll") { + if (didScroll && xhrDone) { + // We got the second scroll event. + ok(true, "Should have got two scroll events"); + testWin.close(); + SimpleTest.finish(); + } + didScroll = true; + if (xhrDone) { + iframeWindow.scrollTo(0, 3000); + } + } + } + } + </script> +</head> +<body onload="run()"> +<p id="display"></p> +<div id="content" style="display: none"></div> +<pre id="test"></pre> +</body> +</html> |