Commit ca5d3397 authored by David Bokan's avatar David Bokan Committed by Commit Bot

Fix rootscroller layout test on slow bots

Add a rAF before starting the test. My guess is that on slow bots
the the gesture starts before the layers are initialized and pushed
to the compositor's acive tree so the entire gesture gets ignored.

Bug: 836623
Change-Id: I1c54e31b4fb064926d8ad94da4bb8d9751332067
Reviewed-on: https://chromium-review.googlesource.com/1034010Reviewed-by: default avatarSteve Kobes <skobes@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554761}
parent 63bc7b7a
...@@ -3217,9 +3217,6 @@ crbug.com/742670 [ Mac ] plugins/iframe-plugin-bgcolor.html [ Failure Pass ] ...@@ -3217,9 +3217,6 @@ crbug.com/742670 [ Mac ] plugins/iframe-plugin-bgcolor.html [ Failure Pass ]
crbug.com/780398 [ Mac ] plugins/mouse-capture-inside-shadow.html [ Failure Pass ] crbug.com/780398 [ Mac ] plugins/mouse-capture-inside-shadow.html [ Failure Pass ]
# Failing on Trusty Debug, disabled while investigating.
crbug.com/836623 [ Linux Debug ] virtual/android/rootscroller/gesture-scroll-document-not-root-scroller.html [ Failure ]
crbug.com/678346 [ Debug ] fast/dom/shadow/selections-in-shadow.html [ Pass Timeout ] crbug.com/678346 [ Debug ] fast/dom/shadow/selections-in-shadow.html [ Pass Timeout ]
crbug.com/678346 [ Win7 Mac Debug ] storage/indexeddb/index-cursor.html [ Pass Timeout ] crbug.com/678346 [ Win7 Mac Debug ] storage/indexeddb/index-cursor.html [ Pass Timeout ]
crbug.com/810254 [ Win7 ] storage/indexeddb/observer-frame.html [ Pass Timeout ] crbug.com/810254 [ Win7 ] storage/indexeddb/observer-frame.html [ Pass Timeout ]
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
}); });
} }
function waitForScrollAndCheck() { function waitForScroll() {
const MAX_FRAME = 500; const MAX_FRAME = 500;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
function tick(frames) { function tick(frames) {
...@@ -80,26 +80,28 @@ ...@@ -80,26 +80,28 @@
}); });
} }
window.onload = function() { // Do a rAF before actually starting the test to ensure we leave enough time
// to commit layers to the compositor before we start scrolling.
window.onload = function() { requestAnimationFrame(() => {
var rootscroller = document.querySelector('#rootscroller'); var rootscroller = document.querySelector('#rootscroller');
document.rootScroller = rootscroller; document.rootScroller = rootscroller;
promise_test( t => { promise_test( t => {
const GESTURE_SOURCE_TYPE = 2; // MOUSE_INPUT from synthetic_gesture_params.h const GESTURE_SOURCE_TYPE = 2; // MOUSE_INPUT from synthetic_gesture_params.h
return scrollDown(500, 100, 100, GESTURE_SOURCE_TYPE, 1000) return scrollDown(500, 100, 100, GESTURE_SOURCE_TYPE, 1000)
.then(waitForScrollAndCheck) .then(waitForScroll)
.then(() => { .then(() => {
if (window.internals) { if (window.internals) {
assert_equals(window.internals.effectiveRootScroller(document), assert_equals(window.internals.effectiveRootScroller(document),
rootscroller, rootscroller,
"Failed to set root scroller"); "Failed to set root scroller");
} }
assert_greater_than( assert_greater_than(
document.scrollingElement.scrollTop, 0, "Document must be scrolled"); document.scrollingElement.scrollTop, 0, "Document must be scrolled");
assert_equals( assert_equals(
rootscroller.scrollTop, 0, "RootScroller must not be scrolled"); rootscroller.scrollTop, 0, "RootScroller must not be scrolled");
}); });
}, "Gesture scrolling should scroll document."); }, "Gesture scrolling should scroll document.");
} });}
</script> </script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment