Chromium Code Reviews| 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> |