зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1681692. Add test. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D119480
This commit is contained in:
Родитель
66292dac3b
Коммит
76dc9ae62d
|
@ -0,0 +1,49 @@
|
|||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<style>
|
||||
.spacer {
|
||||
height: 50px;
|
||||
}
|
||||
.special {
|
||||
height: 200px;
|
||||
background-color: blue;
|
||||
}
|
||||
.special:hover {
|
||||
background-color: red;
|
||||
}
|
||||
</style>
|
||||
<div id="x" class="spacer"></div>
|
||||
<div id="x2" class="special"></div>
|
||||
<div style="margin-top: 100vh">
|
||||
<!-- this is here so it wrongly gets sent the events -->
|
||||
<iframe src="https://example.com/tests/layout/base/tests/helper_synthmousemove.html"></iframe>
|
||||
</div>
|
||||
<div style="height: 300vh"></div>
|
||||
<script>
|
||||
|
||||
async function runTest() {
|
||||
let thex = document.getElementById("x");
|
||||
let thex2 = document.getElementById("x2")
|
||||
synthesizeMouse(thex, 20, 20, {type: "mousemove"});
|
||||
opener.is(
|
||||
getComputedStyle(thex2).backgroundColor,
|
||||
"rgb(0, 0, 255)",
|
||||
"Part is blue"
|
||||
);
|
||||
|
||||
thex.remove();
|
||||
document.documentElement.getBoundingClientRect();
|
||||
await new Promise(r => requestAnimationFrame(r));
|
||||
await new Promise(r => requestAnimationFrame(r));
|
||||
opener.is(
|
||||
getComputedStyle(thex2).backgroundColor,
|
||||
"rgb(255, 0, 0)",
|
||||
"Part is red"
|
||||
);
|
||||
|
||||
opener.reportSuccess();
|
||||
window.close();
|
||||
}
|
||||
|
||||
SimpleTest.waitForFocus(runTest);
|
||||
</script>
|
|
@ -0,0 +1,3 @@
|
|||
<!doctype html>
|
||||
<title>helper_synthmousemove.html</title>
|
||||
<div></div>
|
|
@ -441,6 +441,10 @@ skip-if = toolkit == 'android' # Bug 1355844
|
|||
support-files =
|
||||
scroll_selection_into_view_window.html
|
||||
scroll_selection_into_view_window_frame.html
|
||||
[test_synthmousemove.html]
|
||||
support-files =
|
||||
helper_synthmousemove.html
|
||||
file_synthmousemove.html
|
||||
[test_transformed_scrolling_repaints.html]
|
||||
[test_transformed_scrolling_repaints_2.html]
|
||||
skip-if = (headless && os == 'mac') # Headless Bug 1414103
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<!doctype html>
|
||||
<title>test synth mouse moves go to the right place with fission</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
|
||||
<script>
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function runTest() {
|
||||
window.open("file_synthmousemove.html", "_blank");
|
||||
}
|
||||
|
||||
function reportSuccess() {
|
||||
ok(true, "reportSuccess");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
var smoothScrollPref = "general.smoothScroll";
|
||||
function prepareTest() {
|
||||
if (!SpecialPowers.getBoolPref("layout.reflow.synthMouseMove")) {
|
||||
ok(true, "layout.reflow.synthMouseMove is false, we can't run this test");
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
window.requestAnimationFrame(function() {
|
||||
SpecialPowers.pushPrefEnv({"set":[[smoothScrollPref, false]]}, runTest);
|
||||
});
|
||||
}
|
||||
|
||||
SimpleTest.waitForFocus(prepareTest);
|
||||
</script>
|
Загрузка…
Ссылка в новой задаче