OLD | NEW |
1 function initialize_LayerTreeTests() | 1 function initialize_LayerTreeTests() |
2 { | 2 { |
3 // FIXME: remove once out of experimental. | 3 // FIXME: remove once out of experimental. |
4 WebInspector.moduleManager.registerModule("layers"); | 4 WebInspector.moduleManager.registerModule("layers"); |
5 var extensions = WebInspector.moduleManager.extensions(WebInspector.Panel).f
orEach(function(extension) { | 5 var extensions = WebInspector.moduleManager.extensions(WebInspector.Panel).f
orEach(function(extension) { |
6 if (extension.module().name() === "layers") | 6 if (extension.module().name() === "layers") |
7 WebInspector.inspectorView.addPanel(new WebInspector.ModuleManagerEx
tensionPanelDescriptor(extension)); | 7 WebInspector.inspectorView.addPanel(new WebInspector.ModuleManagerEx
tensionPanelDescriptor(extension)); |
8 }); | 8 }); |
9 InspectorTest.layerTreeModel = WebInspector.inspectorView.panel("layers")._m
odel; | 9 InspectorTest.layerTreeModel = WebInspector.inspectorView.panel("layers")._m
odel; |
10 | 10 |
11 InspectorTest.labelForLayer = function(layer) | 11 InspectorTest.labelForLayer = function(layer) |
12 { | 12 { |
13 var node = WebInspector.domAgent.nodeForId(layer.nodeIdForSelfOrAncestor
()); | 13 var node = WebInspector.domModel.nodeForId(layer.nodeIdForSelfOrAncestor
()); |
14 var label = node ? WebInspector.DOMPresentationUtils.fullQualifiedSelect
or(node, false) : "<invalid node id>"; | 14 var label = node ? WebInspector.DOMPresentationUtils.fullQualifiedSelect
or(node, false) : "<invalid node id>"; |
15 var height = layer.height(); | 15 var height = layer.height(); |
16 var width = layer.width(); | 16 var width = layer.width(); |
17 if (height <= 200 && width <= 200) | 17 if (height <= 200 && width <= 200) |
18 label += " " + height + "x" + width; | 18 label += " " + height + "x" + width; |
19 if (typeof layer.__extraData !== "undefined") | 19 if (typeof layer.__extraData !== "undefined") |
20 label += " (" + layer.__extraData + ")"; | 20 label += " (" + layer.__extraData + ")"; |
21 return label; | 21 return label; |
22 } | 22 } |
23 | 23 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 }); | 72 }); |
73 } | 73 } |
74 | 74 |
75 InspectorTest.findLayerByNodeIdAttribute = function(nodeIdAttribute) | 75 InspectorTest.findLayerByNodeIdAttribute = function(nodeIdAttribute) |
76 { | 76 { |
77 var result; | 77 var result; |
78 function testLayer(layer) | 78 function testLayer(layer) |
79 { | 79 { |
80 if (!layer.nodeId()) | 80 if (!layer.nodeId()) |
81 return false; | 81 return false; |
82 var node = WebInspector.domAgent.nodeForId(layer.nodeId()); | 82 var node = WebInspector.domModel.nodeForId(layer.nodeId()); |
83 if (!node || node.getAttribute("id") !== nodeIdAttribute) | 83 if (!node || node.getAttribute("id") !== nodeIdAttribute) |
84 return false; | 84 return false; |
85 result = layer; | 85 result = layer; |
86 return true; | 86 return true; |
87 } | 87 } |
88 InspectorTest.layerTreeModel.forEachLayer(testLayer); | 88 InspectorTest.layerTreeModel.forEachLayer(testLayer); |
89 if (!result) | 89 if (!result) |
90 InspectorTest.addResult("ERROR: No layer for " + nodeIdAttribute); | 90 InspectorTest.addResult("ERROR: No layer for " + nodeIdAttribute); |
91 return result; | 91 return result; |
92 } | 92 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 { | 128 { |
129 function dumpScrollRectsForLayer(layer) | 129 function dumpScrollRectsForLayer(layer) |
130 { | 130 { |
131 InspectorTest.addObject(layer._scrollRects); | 131 InspectorTest.addObject(layer._scrollRects); |
132 } | 132 } |
133 | 133 |
134 InspectorTest.addResult("Model elements dump"); | 134 InspectorTest.addResult("Model elements dump"); |
135 InspectorTest.layerTreeModel.forEachLayer(dumpScrollRectsForLayer.bind(t
his)); | 135 InspectorTest.layerTreeModel.forEachLayer(dumpScrollRectsForLayer.bind(t
his)); |
136 } | 136 } |
137 } | 137 } |
OLD | NEW |