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

Unified Diff: LayoutTests/compositing/squashing/squash-above-fixed-1.html

Issue 191693002: Delay scrollContents until the next paint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix layout tests Created 6 years, 9 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
Index: LayoutTests/compositing/squashing/squash-above-fixed-1.html
diff --git a/LayoutTests/compositing/squashing/squash-above-fixed-1.html b/LayoutTests/compositing/squashing/squash-above-fixed-1.html
index 6fbf4439847f0680da37c63a49dad434555e187b..69336a87c7ab573801a081854eec934c74c33d19 100644
--- a/LayoutTests/compositing/squashing/squash-above-fixed-1.html
+++ b/LayoutTests/compositing/squashing/squash-above-fixed-1.html
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
+<script src="../../resources/run-after-display.js"></script>
<style>
.composited {
-webkit-transform: translatez(0);
@@ -47,8 +48,10 @@ body {
</style>
<script>
- if (window.testRunner)
+ if (window.testRunner) {
+ testRunner.waitUntilDone();
testRunner.dumpAsText();
+ }
if (window.internals) {
internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
@@ -60,29 +63,72 @@ body {
if (!window.internals)
return;
- // Case 1
- document.getElementById('Case1').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
-
- // Case 2
- window.internals.startTrackingRepaints(document);
- window.scrollTo(0, 80);
- document.getElementById('Case2').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
- window.internals.stopTrackingRepaints(document);
-
- // Case 3
- window.internals.startTrackingRepaints(document);
- window.scrollTo(0, 120);
- document.getElementById('Case3').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
- window.internals.stopTrackingRepaints(document);
-
- // Case 4
- window.internals.startTrackingRepaints(document);
- window.scrollTo(0, 170);
- document.getElementById('Case4').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
- window.internals.stopTrackingRepaints(document);
-
- // Display the test results only after test is done so that it does not affect repaint rect results.
- document.getElementById('testResults').style.display = "block";
+ (function() {
+
+ return new Promise(function(resolve) {
+ // Case 1
+ document.getElementById('Case1').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
+
+ resolve();
+ });
+
+ })().then(function() {
+
+ return new Promise(function(resolve) {
+
+ // Case 2
+ window.internals.startTrackingRepaints(document);
+ window.scrollTo(0, 80);
+ runAfterDisplay(function() {
+ document.getElementById('Case2').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
+ window.internals.stopTrackingRepaints(document);
+
+ resolve();
+ });
+
+ });
+
+ }).then(function() {
+
+ return new Promise(function(resolve) {
+
+ // Case 3
+ window.internals.startTrackingRepaints(document);
+ window.scrollTo(0, 120);
+ runAfterDisplay(function() {
+ document.getElementById('Case3').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
+ window.internals.stopTrackingRepaints(document);
+
+ resolve();
+ });
+
+ });
+
+ }).then(function() {
+
+ return new Promise(function(resolve) {
+
+ // Case 4
+ window.internals.startTrackingRepaints(document);
+ window.scrollTo(0, 170);
+ runAfterDisplay(function() {
+ document.getElementById('Case4').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
+ window.internals.stopTrackingRepaints(document);
+
+ resolve();
+ });
+
+ });
+
+ }).then(function() {
+
+ // Display the test results only after test is done so that it does not affect repaint rect results.
+ document.getElementById('testResults').style.display = "block";
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+
+ });
esprehn 2014/03/24 21:50:43 You need a catch() on the end to log exceptions. O
ykyyip 2014/03/24 22:15:03 Done.
}
</script>
</head>

Powered by Google App Engine
This is Rietveld 408576698