| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/timeline-test.js"></script> | 4 <script src="../../http/tests/inspector/timeline-test.js"></script> |
| 5 <script src="../../http/tests/inspector/layers-test.js"></script> | 5 <script src="../../http/tests/inspector/layers-test.js"></script> |
| 6 <style> | 6 <style> |
| 7 .layer { | 7 .layer { |
| 8 width: 100px; | 8 width: 100px; |
| 9 height: 100px; | 9 height: 100px; |
| 10 -webkit-transform: translateZ(10px); | 10 -webkit-transform: translateZ(10px); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 var pendingEventCount = 0; | 48 var pendingEventCount = 0; |
| 49 function loadSnapshot(record) | 49 function loadSnapshot(record) |
| 50 { | 50 { |
| 51 if (record.type !== WebInspector.TimelineModel.RecordType.UpdateLayerTre
e) | 51 if (record.type !== WebInspector.TimelineModel.RecordType.UpdateLayerTre
e) |
| 52 return; | 52 return; |
| 53 // Some updates may not produce new layer tree snapshot | 53 // Some updates may not produce new layer tree snapshot |
| 54 if (!record.data["layerTree"]) | 54 if (!record.data["layerTree"]) |
| 55 return; | 55 return; |
| 56 ++pendingEventCount; | 56 ++pendingEventCount; |
| 57 var layerTree = new WebInspector.AgentLayerTree(WebInspector.targetManag
er.activeTarget()); | 57 var layerTree = new WebInspector.AgentLayerTree(WebInspector.targetManag
er.mainTarget()); |
| 58 layerTree.setLayers(record.data["layerTree"], onLayersSet.bind(null, lay
erTree)); | 58 layerTree.setLayers(record.data["layerTree"], onLayersSet.bind(null, lay
erTree)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 function onLayersSet(layerTree) | 61 function onLayersSet(layerTree) |
| 62 { | 62 { |
| 63 InspectorTest.layerTreeModel.setLayerTree(layerTree); | 63 InspectorTest.layerTreeModel.setLayerTree(layerTree); |
| 64 InspectorTest.addResult("Layer tree dump:"); | 64 InspectorTest.addResult("Layer tree dump:"); |
| 65 InspectorTest.dumpLayerTree(); | 65 InspectorTest.dumpLayerTree(); |
| 66 if (--pendingEventCount) | 66 if (--pendingEventCount) |
| 67 return; | 67 return; |
| 68 InspectorTest.completeTest(); | 68 InspectorTest.completeTest(); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 </script> | 72 </script> |
| 73 </head> | 73 </head> |
| 74 | 74 |
| 75 <body onload="runTest()"> | 75 <body onload="runTest()"> |
| 76 <p> | 76 <p> |
| 77 Tests the Timeline API instrumentation of a Layout event | 77 Tests the Timeline API instrumentation of a Layout event |
| 78 </p> | 78 </p> |
| 79 </body> | 79 </body> |
| 80 </html> | 80 </html> |
| OLD | NEW |