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

Side by Side Diff: LayoutTests/inspector/profiler/heap-snapshot-test.js

Issue 204563002: Remove WebInspector.HeapSnapshotArraySlice (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
OLDNEW
1 var initialize_HeapSnapshotTest = function() { 1 var initialize_HeapSnapshotTest = function() {
2 2
3 InspectorTest.createHeapSnapshotMockFactories = function() { 3 InspectorTest.createHeapSnapshotMockFactories = function() {
4 4
5 InspectorTest.createJSHeapSnapshotMockObject = function() 5 InspectorTest.createJSHeapSnapshotMockObject = function()
6 { 6 {
7 return { 7 return {
8 _rootNodeIndex: 0, 8 _rootNodeIndex: 0,
9 _nodeTypeOffset: 0, 9 _nodeTypeOffset: 0,
10 _nodeNameOffset: 1, 10 _nodeNameOffset: 1,
(...skipping 11 matching lines...) Expand all
22 _realNodesLength: 18, 22 _realNodesLength: 18,
23 // Represents the following graph: 23 // Represents the following graph:
24 // (numbers in parentheses indicate node offset) 24 // (numbers in parentheses indicate node offset)
25 // 25 //
26 // -> A (3) --ac- C (9) -ce- E(15) 26 // -> A (3) --ac- C (9) -ce- E(15)
27 // a/ | / 27 // a/ | /
28 // "" (0) 1 - bc - 28 // "" (0) 1 - bc -
29 // b\ v / 29 // b\ v /
30 // -> B (6) -bd- D (12) 30 // -> B (6) -bd- D (12)
31 // 31 //
32 _nodes: [ 32 _nodes: new Uint32Array([
33 0, 0, 2, // 0: root 33 0, 0, 2, // 0: root
34 1, 1, 2, // 3: A 34 1, 1, 2, // 3: A
35 1, 2, 2, // 6: B 35 1, 2, 2, // 6: B
36 1, 3, 1, // 9: C 36 1, 3, 1, // 9: C
37 1, 4, 0, // 12: D 37 1, 4, 0, // 12: D
38 1, 5, 0], // 15: E 38 1, 5, 0]), // 15: E
39 _containmentEdges: [ 39 _containmentEdges: new Uint32Array([
40 2, 6, 3, // 0: shortcut 'a' to node 'A' 40 2, 6, 3, // 0: shortcut 'a' to node 'A'
41 1, 7, 6, // 3: property 'b' to node 'B' 41 1, 7, 6, // 3: property 'b' to node 'B'
42 0, 1, 6, // 6: element '1' to node 'B' 42 0, 1, 6, // 6: element '1' to node 'B'
43 1, 8, 9, // 9: property 'ac' to node 'C' 43 1, 8, 9, // 9: property 'ac' to node 'C'
44 1, 9, 9, // 12: property 'bc' to node 'C' 44 1, 9, 9, // 12: property 'bc' to node 'C'
45 1, 10, 12, // 15: property 'bd' to node 'D' 45 1, 10, 12, // 15: property 'bd' to node 'D'
46 1, 11, 15], // 18: property 'ce' to node 'E' 46 1, 11, 15]), // 18: property 'ce' to node 'E'
47 _strings: ["", "A", "B", "C", "D", "E", "a", "b", "ac", "bc", "bd", "ce" ], 47 _strings: ["", "A", "B", "C", "D", "E", "a", "b", "ac", "bc", "bd", "ce" ],
48 _firstEdgeIndexes: [0, 6, 12, 18, 21, 21, 21], 48 _firstEdgeIndexes: new Uint32Array([0, 6, 12, 18, 21, 21, 21]),
49 createNode: WebInspector.JSHeapSnapshot.prototype.createNode, 49 createNode: WebInspector.JSHeapSnapshot.prototype.createNode,
50 createEdge: WebInspector.JSHeapSnapshot.prototype.createEdge, 50 createEdge: WebInspector.JSHeapSnapshot.prototype.createEdge,
51 createRetainingEdge: WebInspector.JSHeapSnapshot.prototype.createRetaini ngEdge 51 createRetainingEdge: WebInspector.JSHeapSnapshot.prototype.createRetaini ngEdge
52 }; 52 };
53 }; 53 };
54 54
55 InspectorTest.createHeapSnapshotMockRaw = function() 55 InspectorTest.createHeapSnapshotMockRaw = function()
56 { 56 {
57 // Effectively the same graph as in createJSHeapSnapshotMockObject, 57 // Effectively the same graph as in createJSHeapSnapshotMockObject,
58 // but having full set of fields. 58 // but having full set of fields.
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 }, 312 },
313 "nodes": [], 313 "nodes": [],
314 "edges":[], 314 "edges":[],
315 "strings": [] 315 "strings": []
316 }; 316 };
317 317
318 for (var i = 0; i < this._nodes.length; ++i) 318 for (var i = 0; i < this._nodes.length; ++i)
319 this._nodes[i]._serialize(rawSnapshot); 319 this._nodes[i]._serialize(rawSnapshot);
320 320
321 rawSnapshot.strings = this._strings.slice(); 321 rawSnapshot.strings = this._strings.slice();
322 rawSnapshot.nodes = new Uint32Array(rawSnapshot.nodes);
323 rawSnapshot.edges = new Uint32Array(rawSnapshot.edges);
322 324
323 var meta = rawSnapshot.snapshot.meta; 325 var meta = rawSnapshot.snapshot.meta;
324 rawSnapshot.snapshot.edge_count = rawSnapshot.edges.length / meta.edge_f ields.length; 326 rawSnapshot.snapshot.edge_count = rawSnapshot.edges.length / meta.edge_f ields.length;
325 rawSnapshot.snapshot.node_count = rawSnapshot.nodes.length / meta.node_f ields.length; 327 rawSnapshot.snapshot.node_count = rawSnapshot.nodes.length / meta.node_f ields.length;
326 328
327 return rawSnapshot; 329 return rawSnapshot;
328 }, 330 },
329 331
330 _registerNode: function(node) 332 _registerNode: function(node)
331 { 333 {
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 function sortingComplete() 740 function sortingComplete()
739 { 741 {
740 dataGrid.removeEventListener(WebInspector.HeapSnapshotSortableDataGr id.Events.SortingComplete, sortingComplete, null); 742 dataGrid.removeEventListener(WebInspector.HeapSnapshotSortableDataGr id.Events.SortingComplete, sortingComplete, null);
741 callback(); 743 callback();
742 } 744 }
743 dataGrid.addEventListener(WebInspector.HeapSnapshotSortableDataGrid.Even ts.SortingComplete, sortingComplete, null); 745 dataGrid.addEventListener(WebInspector.HeapSnapshotSortableDataGrid.Even ts.SortingComplete, sortingComplete, null);
744 } 746 }
745 }; 747 };
746 748
747 }; 749 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698