Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Unified Diff: LayoutTests/scrollingcoordinator/resources/non-fast-scrollable-region-testing.js

Issue 878573004: Increase reliablity of scorllingcoordinator layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update test expectation Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/scrollingcoordinator/non-fast-scrollable-visibility-change.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/scrollingcoordinator/resources/non-fast-scrollable-region-testing.js
diff --git a/LayoutTests/scrollingcoordinator/resources/non-fast-scrollable-region-testing.js b/LayoutTests/scrollingcoordinator/resources/non-fast-scrollable-region-testing.js
index 594662b2f74d9db57abdc6c42c0881b1c338bfbe..ede3b04478da60f937dbb07e2481c66e1e17f7fa 100644
--- a/LayoutTests/scrollingcoordinator/resources/non-fast-scrollable-region-testing.js
+++ b/LayoutTests/scrollingcoordinator/resources/non-fast-scrollable-region-testing.js
@@ -4,17 +4,9 @@
if (window.internals)
window.internals.settings.setMockScrollbarsEnabled(true);
-function runNonFastScrollableRegionTest(scale) {
- var invScale;
- if (scale != undefined) {
- if (window.eventSender)
- eventSender.setPageScaleFactor(scale, 0, 0);
- // FIXME: This is a hack for applyPageScaleFactorInCompositor() == false.
- invScale = 1 / scale;
- } else {
- invScale = 1;
- }
-
+// Draws green overlays for non-fast scrollable regions. This provides a visual
+// feedback that is useful when running the test interactively.
+function drawNonFastScrollableRegionOverlays() {
var overlay = document.createElement("div");
overlay.style.position = "absolute";
overlay.style.left = 0;
@@ -27,10 +19,10 @@ function runNonFastScrollableRegionTest(scale) {
var patch = document.createElement("div");
patch.style.position = "absolute";
patch.style.backgroundColor = "#00ff00";
- patch.style.left = rect.left * invScale + "px";
- patch.style.top = rect.top * invScale + "px";
- patch.style.width = rect.width * invScale + "px";
- patch.style.height = rect.height * invScale + "px";
+ patch.style.left = rect.left + "px";
+ patch.style.top = rect.top + "px";
+ patch.style.width = rect.width + "px";
+ patch.style.height = rect.height + "px";
overlay.appendChild(patch);
}
@@ -38,3 +30,12 @@ function runNonFastScrollableRegionTest(scale) {
document.body.appendChild(overlay);
}
+// Waits for one RAF call to ensure compositing update has occurred and invokes task.
+function awaitCompsitingUpdate(task) {
+ window.requestAnimationFrame(task);
+}
+
+function rectToString(rect) {
+ return '[' + [rect.left, rect.top, rect.width, rect.height].join(', ') + ']';
+}
+
« no previous file with comments | « LayoutTests/scrollingcoordinator/non-fast-scrollable-visibility-change.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698