Backed out changeset fcdaffc1de9f (bug 1351148)

This commit is contained in:
Carsten "Tomcat" Book 2017-07-28 09:20:11 +02:00
Родитель 61867d079e
Коммит ce5804abb0
1 изменённых файлов: 16 добавлений и 40 удалений

Просмотреть файл

@ -1141,51 +1141,27 @@ function doTestZoom(aSettings, aCallback)
var scrollTop = gScrollableElement.scrollTop;
var scrollLeft = gScrollableElement.scrollLeft;
fullZoomChangePromise = new Promise(resolve => {
if (currentTest.expected & (kNegative | kPositive)) {
SpecialPowers.addChromeEventListener("FullZoomChange", function onFullZoomChange() {
if (SpecialPowers.getFullZoom(window) != 1) {
SpecialPowers.removeChromeEventListener("FullZoomChange", onFullZoomChange)
setTimeout(() => resolve(), 0);
}
});
} else {
resolve();
}
});
sendWheelAndWait(10, 10, event, function () {
is(gScrollableElement.scrollTop, scrollTop, description + "scrolled vertical");
is(gScrollableElement.scrollLeft, scrollLeft, description + "scrolled horizontal");
fullZoomChangePromise.then(() => {
// When input event prioritization is enabled, the wheel event may be
// dispatched to the content process before the message 'FullZoom' to
// zoom in/out. Waiting for the event 'FullZoomChange' and then check
// the result.
if (!(currentTest.expected & (kNegative | kPositive))) {
is(SpecialPowers.getFullZoom(window), 1.0, description + "zoomed");
if (!(currentTest.expected & (kNegative | kPositive))) {
is(SpecialPowers.getFullZoom(window), 1.0, description + "zoomed");
} else {
var isReverted = (currentTest.expected & kUseX) ? isXReverted :
(currentTest.expected & kUseY) ? isYReverted : false;
if ((!isReverted && (currentTest.expected & kNegative)) ||
(isReverted && (currentTest.expected & kPositive))) {
ok(SpecialPowers.getFullZoom(window) > 1.0,
description + "not zoomed in, got " + SpecialPowers.getFullZoom(window));
} else {
var isReverted = (currentTest.expected & kUseX) ? isXReverted :
(currentTest.expected & kUseY) ? isYReverted : false;
if ((!isReverted && (currentTest.expected & kNegative)) ||
(isReverted && (currentTest.expected & kPositive))) {
ok(SpecialPowers.getFullZoom(window) > 1.0,
description + "not zoomed in, got " + SpecialPowers.getFullZoom(window));
} else {
ok(SpecialPowers.getFullZoom(window) < 1.0,
description + "not zoomed out, got " + SpecialPowers.getFullZoom(window));
}
ok(SpecialPowers.getFullZoom(window) < 1.0,
description + "not zoomed out, got " + SpecialPowers.getFullZoom(window));
}
if (SpecialPowers.getFullZoom(window) != 1) {
// Only synthesizes key event to reset zoom when necessary to avoid
// triggering the next test before the key event is handled. In that
// case, the key event may break the next test.
synthesizeKey("0", { accelKey: true });
}
onZoomReset(function () {
hitEventLoop(doNextTest, 20);
});
}
synthesizeKey("0", { accelKey: true });
onZoomReset(function () {
hitEventLoop(doNextTest, 20);
});
});
}