Bug 1375949 - Fix helper_touch_action_regions.html. r=kats

The test was assuming that processing an input event that causes async
scrolling will result in the async scroll being reflected on the next
composite. With the changes in this bug, that is no longer a valid assumption.

MozReview-Commit-ID: HAB3xnmF3vo

--HG--
extra : rebase_source : 86eca7c9f030a2bf4be87d8aa632a97584722191
This commit is contained in:
Botond Ballo 2017-06-28 17:45:40 -04:00
Родитель 179d5b6afb
Коммит dda8aeab18
1 изменённых файлов: 15 добавлений и 6 удалений

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

@ -182,6 +182,7 @@ function* test(testDriver) {
var rect = rectRelativeToScreen(scroller);
var lastSnapshot = getSnapshot(rect);
ok(true, "Got baseline snapshot");
var numDifferentSnapshotPairs = 0;
yield; // this will tell the chrome process to synthesize the touchstart event
// and then we wait to make sure it got processed:
@ -192,17 +193,25 @@ function* test(testDriver) {
yield;
ok(waitFor('touchmove', i), "Touchmove processed in chrome process");
// Take a snapshot after each touch move event. This forces
// a composite each time, even we don't get a vsync in this
// interval.
var snapshot = getSnapshot(rect);
if (i == 1) {
// The first touchmove is consumed to get us into the panning state, so
// no actual panning occurs
ok(lastSnapshot == snapshot, "Snapshot 1 was the same as baseline");
} else {
ok(lastSnapshot != snapshot, "Snapshot " + i + " was different from the previous one");
if (lastSnapshot != snapshot) {
numDifferentSnapshotPairs += 1;
}
lastSnapshot = snapshot;
}
// Check that the snapshot has changed since the baseline, indicating
// that the touch events caused async scrolling. Note that, since we
// orce a composite after each touch event, even if there is a frame
// of delay between APZ processing a touch event and the compositor
// applying the async scroll (bug 1375949), by the end of the gesture
// the snapshot should have changed.
ok(numDifferentSnapshotPairs > 0,
"The number of different snapshot pairs was " + numDifferentSnapshotPairs);
// Wait for the touchend as well, just for good form
yield;
ok(waitFor('touchend', 1), "Touchend processed in chrome process");