Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: LayoutTests/http/tests/inspector/layers-test.js

Issue 195813010: DevTools: avoid using stale front-end node ids. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/inspector/layers/layer-tree-model.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.domAgent.nodeForId(layer.nodeIdForSelfOrAncestor ());
14 var label = WebInspector.DOMPresentationUtils.fullQualifiedSelector(node , false); 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
24 InspectorTest.dumpLayerTree = function(prefix, root) 24 InspectorTest.dumpLayerTree = function(prefix, root)
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 { 95 {
96 InspectorTest.layerTreeModel.addEventListener(WebInspector.LayerTreeMode l.Events.LayerTreeChanged, onLayerTreeChanged); 96 InspectorTest.layerTreeModel.addEventListener(WebInspector.LayerTreeMode l.Events.LayerTreeChanged, onLayerTreeChanged);
97 InspectorTest.layerTreeModel.enable(); 97 InspectorTest.layerTreeModel.enable();
98 function onLayerTreeChanged() 98 function onLayerTreeChanged()
99 { 99 {
100 InspectorTest.layerTreeModel.removeEventListener(WebInspector.LayerT reeModel.Events.LayerTreeChanged, onLayerTreeChanged); 100 InspectorTest.layerTreeModel.removeEventListener(WebInspector.LayerT reeModel.Events.LayerTreeChanged, onLayerTreeChanged);
101 callback(); 101 callback();
102 } 102 }
103 } 103 }
104 } 104 }
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/inspector/layers/layer-tree-model.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698