3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/timeline-test.js"></script>
5 <script src="../../http/tests/inspector/layers-test.js"></script>
10 transform: translateZ(10px);
17 var element = document.createElement("div");
18 element.className = "layer";
19 document.body.appendChild(element);
22 function pageStep0(doneCallback)
24 requestAnimationFrame(pageStep1.bind(this, doneCallback));
27 function pageStep1(doneCallback)
30 requestAnimationFrame(pageStep2.bind(this, doneCallback));
33 function pageStep2(doneCallback)
36 requestAnimationFrame(doneCallback);
41 InspectorTest.invokeAsyncWithTimeline("pageStep0", onTimelineStopped);
43 function onTimelineStopped()
45 InspectorTest.printTimelineRecords(null, loadSnapshot);
48 var pendingEventCount = 0;
49 function loadSnapshot(record)
51 if (record.type() !== WebInspector.TimelineModel.RecordType.UpdateLayerTree)
53 // Some updates may not produce new layer tree snapshot
54 if (!record.data()["layerTree"])
57 var layerTree = new WebInspector.AgentLayerTree(WebInspector.targetManager.mainTarget());
58 layerTree.setLayers(record.data()["layerTree"], onLayersSet.bind(null, layerTree));
61 function onLayersSet(layerTree)
63 InspectorTest.layerTreeModel.setLayerTree(layerTree);
64 InspectorTest.addResult("Layer tree dump:");
65 InspectorTest.dumpLayerTree();
66 if (--pendingEventCount)
68 InspectorTest.completeTest();
75 <body onload="runTest()">
77 Tests the Timeline API instrumentation of a Layout event