зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1781618 - Make `test_bug620906.html` try to click scrollbar multiple times r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D199303
This commit is contained in:
Родитель
2594dc03cd
Коммит
0695aa49fe
|
@ -165,9 +165,6 @@ support-files = [
|
|||
|
||||
["test_bug612447.html"]
|
||||
|
||||
["test_bug620906.html"]
|
||||
skip-if = ["os == 'android'"] #TIMED_OUT
|
||||
|
||||
["test_bug622371.html"]
|
||||
|
||||
["test_bug625452.html"]
|
||||
|
@ -430,6 +427,9 @@ skip-if = ["os == 'android'"] #Bug 1575739
|
|||
|
||||
["test_defaultParagraphSeparatorBR_between_blocks.html"]
|
||||
|
||||
["test_doc_scrollbar_toggled_designMode_on_mousedown.html"]
|
||||
skip-if = ["os == 'android'"] # Needs interaction with the scrollbar
|
||||
|
||||
["test_dom_input_event_on_htmleditor.html"]
|
||||
|
||||
["test_dom_input_event_on_texteditor.html"]
|
||||
|
|
|
@ -29,19 +29,33 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=620906
|
|||
|
||||
/** Test for Bug 620906 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(function() {
|
||||
var iframe = document.querySelector("iframe");
|
||||
SimpleTest.waitForFocus(async () => {
|
||||
const iframe = document.querySelector("iframe");
|
||||
is(iframe.contentWindow.scrollY, 0, "Sanity check");
|
||||
var rect = iframe.getBoundingClientRect();
|
||||
setTimeout(function() {
|
||||
var onscroll = function() {
|
||||
iframe.contentWindow.removeEventListener("scroll", onscroll);
|
||||
const rect = iframe.getBoundingClientRect();
|
||||
const waitForTick = () => {
|
||||
return new Promise(resolve => requestAnimationFrame(
|
||||
() => requestAnimationFrame(resolve))
|
||||
);
|
||||
};
|
||||
await waitForTick();
|
||||
let scrollEventFired = false;
|
||||
iframe.contentWindow.addEventListener("scroll", () => {
|
||||
scrollEventFired = true;
|
||||
}, {once: true});
|
||||
for (let i = 0; i < 10; i++) {
|
||||
synthesizeMouse(iframe, rect.width - 4, rect.height / 2, { type: "mousemove" });
|
||||
synthesizeMouse(iframe, rect.width - 5, rect.height / 2, { type: "mousemove" });
|
||||
synthesizeMouse(iframe, rect.width - 5, rect.height / 2, {});
|
||||
await waitForTick();
|
||||
if (scrollEventFired) {
|
||||
isnot(iframe.contentWindow.scrollY, 0, "The scrollbar should work");
|
||||
SimpleTest.finish();
|
||||
};
|
||||
iframe.contentWindow.addEventListener("scroll", onscroll);
|
||||
synthesizeMouse(iframe, rect.width - 5, rect.height / 2, {});
|
||||
}, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
ok(false, "The scrollbar didn't work");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
|
||||
</script>
|
Загрузка…
Ссылка в новой задаче