Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / layer-compositing-reasons.html
index a5926bd..0301022 100644 (file)
 <script src="../http/tests/inspector/inspector-test.js"></script>
 <script src="../http/tests/inspector/layers-test.js"></script>
 <script>
+if (window.internals) {
+    document.addEventListener('webkitAnimationStart', function() {
+        internals.pauseAnimations(0);
+    });
+}
+
 function test()
 {
     function dumpCompositingReasons(layer, callback)
@@ -18,9 +24,10 @@ function test()
         layer.requestCompositingReasons(function(reasons)
         {
             var node = WebInspector.domAgent.nodeForId(layer.nodeIdForSelfOrAncestor());
-            var label = node.appropriateSelectorFor(false);
+            var label = WebInspector.DOMPresentationUtils.fullQualifiedSelector(node, false);
             InspectorTest.addResult("Compositing reasons for " + label + ": " + reasons.sort().join(","));
-            callback();
+            if (callback)
+                callback();
         });
     }
 
@@ -36,17 +43,12 @@ function test()
         "preserve3d"
     ];
 
-    function iterateThroughLayers(nextLayerId)
-    {
-        if (nextLayerId >= idsToTest.length) {
-            InspectorTest.completeTest();
-            return;
-        }
-        dumpCompositingReasons(InspectorTest.findLayerByNodeIdAttribute(idsToTest[nextLayerId]), iterateThroughLayers.bind(this, nextLayerId + 1));
-    }
     function onGotLayers()
     {
-        dumpCompositingReasons(InspectorTest._layerTreeModel.contentRoot(), iterateThroughLayers.bind(this, 0));
+        dumpCompositingReasons(InspectorTest._layerTreeModel.contentRoot());
+        for (var i = 0; i < idsToTest.length - 1; ++i)
+            dumpCompositingReasons(InspectorTest.findLayerByNodeIdAttribute(idsToTest[i]));
+        dumpCompositingReasons(InspectorTest.findLayerByNodeIdAttribute(idsToTest[idsToTest.length - 1]), InspectorTest.completeTest.bind(InspectorTest));
     }
     InspectorTest.requestLayers(onGotLayers);
 }