Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / compositing / squashing / squash-above-fixed-1.html
index c222cb4..26cf028 100644 (file)
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
+<script src="../../resources/run-after-display.js"></script>
 <style>
 .composited {
   -webkit-transform: translatez(0);
@@ -47,11 +48,13 @@ body {
 </style>
 
 <script>
-    if (window.testRunner)
+    if (window.testRunner) {
+        testRunner.waitUntilDone();
         testRunner.dumpAsText();
+    }
 
     if (window.internals) {
-        internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
+        internals.settings.setPreferCompositingToLCDTextEnabled(true);
         internals.settings.setLayerSquashingEnabled(true);
     }
 
@@ -60,31 +63,76 @@ body {
         if (!window.internals)
             return;
 
-        testRunner.display();
+        (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();
+                });
+
+            });
 
-        // Case 1
-        document.getElementById('Case1').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
+        }).then(function() {
 
-        // 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);
+          // Display the test results only after test is done so that it does not affect repaint rect results.
+          document.getElementById('testResults').style.display = "block";
 
-        // 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);
+          if (window.testRunner)
+              testRunner.notifyDone();
 
-        // 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);
+        }).catch(function(e) {
 
-        // Display the test results only after test is done so that it does not affect repaint rect results.
-        document.getElementById('testResults').style.display = "block";
+          console.error(e);
+          
+        });
     }
 </script>
 </head>