Bug 1174323 part 2 - Use native mouse move to improve robustness of screenClientXYConst subtest.
--- a/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html
+++ b/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html
@@ -83,19 +83,18 @@ https://bugzilla.mozilla.org/show_bug.cg
document.mozCancelFullScreen();
}
document.addEventListener("mozpointerlockchange", function (e) {
if (document.mozPointerLockElement === div) {
div.removeEventListener("mousemove", moveUnlocked, false);
div.addEventListener("mousemove", moveLocked, false);
divRect = div.getBoundingClientRect();
- synthesizeMouse(div, (divRect.width / 4) * 3, (divRect.height / 4) * 3, {
- type: "mousemove"
- }, window);
+ synthesizeNativeMouseMove(div, (divRect.width / 4) * 3,
+ (divRect.height / 4) * 3);
}
}, false);
function fullscreenchange() {
var screenX = window.screenX;
var screenY = window.screenY;
if (document.mozFullScreenElement === div) {
if (screenX != 0 || screenY != 0) {
@@ -103,24 +102,27 @@ https://bugzilla.mozilla.org/show_bug.cg
"We should only receive fullscreenchange once we've finished fullscreen transition " +
"window.screenX=" + screenX + " window.screenY=" + screenY);
setTimeout(fullscreenchange, 250);
return;
}
// Synthesize mouse event asynchronously
SimpleTest.executeSoon(function () {
div.addEventListener("mousemove", moveUnlocked, false);
- synthesizeMouseAtCenter(div, { type: "mousemove" }, window);
+ divRect = div.getBoundingClientRect();
+ synthesizeNativeMouseMove(div, divRect.width / 2, divRect.height / 2);
}, 0);
} else {
runTests();
SimpleTest.finish();
}
}
document.addEventListener("mozfullscreenchange", fullscreenchange, false);
function start() {
div = document.getElementById("div");
- div.mozRequestFullScreen();
+ synthesizeNativeMouseMove(div, 0, 0).then(() => {
+ div.mozRequestFullScreen();
+ });
}
</script>
</body>
</html>
--- a/dom/tests/mochitest/pointerlock/test_pointerlock-api.html
+++ b/dom/tests/mochitest/pointerlock/test_pointerlock-api.html
@@ -54,20 +54,16 @@ https://bugzilla.mozilla.org/show_bug.cg
"file_retargetMouseEvents.html",
"file_suppressSomeMouseEvents.html",
"file_targetOutOfFocus.html",
"file_withoutDOM.html",
"file_allowPointerLockSandboxFlag.html"
];
var gDisableList = [
- // Bug 1174323
- { file: "file_screenClientXYConst.html", platform: "MacIntel" },
- { file: "file_screenClientXYConst.html", platform: "Win32" },
- { file: "file_screenClientXYConst.html", platform: "Win64" },
];
var gTestWindow = null;
var gTestIndex = 0;
function nextTest() {
if (gTestWindow) {
gTestWindow.close();