Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector-protocol / layers / paint-profiler.html
blobe636ebcd16f8bdd6c29e414c742d5420f347a78e
1 <html>
2 <head>
3 <style type="text/css">
4 .composited {
5 position: absolute;
6 top: 25px;
7 left: 25px;
8 width: 50px;
9 height: 50px;
10 background-color: blue;
11 transform: translateZ(10px);
13 </style>
14 <script type="application/x-javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
15 <script type="application/x-javascript" src="layer-protocol-test.js"></script>
16 <script type="application/x-javascript">
18 function test()
20 var documentNode;
21 var initialLayers;
22 var modifiedLayers;
24 InspectorTest.enableLayerTreeAgent(gotLayerTree);
26 function gotLayerTree(layers)
28 var matchingLayers = layers.filter(function(layer) { return !!(layer.backendNodeId && layer.transform); });
29 InspectorTest.log("matchingLayers.length: " + matchingLayers.length);
30 var layerId = matchingLayers[0].layerId;
32 InspectorTest.sendCommand("LayerTree.makeSnapshot", {"layerId": layerId}, InspectorTest.wrapCallback(gotSnapshot));
34 var snapshotId;
35 function gotSnapshot(result)
37 snapshotId = result.snapshotId;
38 InspectorTest.sendCommand("LayerTree.profileSnapshot", {"snapshotId": snapshotId, "minRepeatCount":4, "minDuration": 0}, InspectorTest.wrapCallback(gotProfile));
40 function gotProfile(result)
42 var timings = result.timings;
43 InspectorTest.log("Profile array length: " + result.timings.length);
44 for (var i = 0; i < result.timings.length; ++i) {
45 InspectorTest.log("Profile subarray " + i + " length: " + result.timings[i].length);
46 for (var j = 0; j < result.timings[i].length; ++j)
47 InspectorTest.log("Profile timing [" + i + "][" + j + "] is a number: " + (result.timings[i][j] >= 0));
49 InspectorTest.sendCommand("LayerTree.replaySnapshot", {"snapshotId": snapshotId, "fromStep": 2, "toStep": result.timings[0].length - 2}, InspectorTest.wrapCallback(replayedSnapshot));
51 function replayedSnapshot(result)
53 InspectorTest.log("LayerTree.replaySnapshot returned valid image: " + /^data:image\/png;base64,/.test(result.dataURL));
54 InspectorTest.log("DONE!");
55 InspectorTest.completeTest();
59 </script>
60 <body onload="runTest()">
61 <div class="composited">
62 Sanity test for DevTools Paint Profiler.
63 </div>
64 </body>
65 </html>