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

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

Issue 207523004: Always use global indexes for nodes and edges in the heap snapshot representation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments 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 | « no previous file | LayoutTests/inspector/profiler/heap-snapshot-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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="heap-snapshot-test.js"></script> 4 <script src="heap-snapshot-test.js"></script>
5 <script> 5 <script>
6 6
7 function test() 7 function test()
8 { 8 {
9 WebInspector.inspectorView.showPanel("profiles"); 9 WebInspector.inspectorView.showPanel("profiles");
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 var names = []; 51 var names = [];
52 for (; iterator.hasNext(); iterator.next()) 52 for (; iterator.hasNext(); iterator.next())
53 names.push(iterator.item().name()); 53 names.push(iterator.item().name());
54 InspectorTest.assertEquals(",A,B,C,D,E", names.join(","), "node iterator"); 54 InspectorTest.assertEquals(",A,B,C,D,E", names.join(","), "node iterator");
55 }, 55 },
56 56
57 function heapSnapshotEdgeSimpleTest() 57 function heapSnapshotEdgeSimpleTest()
58 { 58 {
59 var snapshot = InspectorTest.createJSHeapSnapshotMockObject(); 59 var snapshot = InspectorTest.createJSHeapSnapshotMockObject();
60 var nodeRoot = snapshot.createNode(snapshot._rootNodeIndex); 60 var nodeRoot = snapshot.createNode(snapshot._rootNodeIndex);
61 var edgesRoot = nodeRoot.rawEdges(); 61 var edgeIterator = new WebInspector.HeapSnapshotEdgeIterator(nod eRoot);
62 InspectorTest.assertEquals(nodeRoot.edgesCount() * snapshot._edg eFieldsCount, edgesRoot.length, "rawEdges length"); 62 InspectorTest.assertEquals(true, edgeIterator.hasNext(), "has ed ges");
63 var edge = snapshot.createEdge(edgesRoot); 63 var edge = edgeIterator.item();
64 InspectorTest.assertEquals("shortcut", edge.type(), "edge type") ; 64 InspectorTest.assertEquals("shortcut", edge.type(), "edge type") ;
65 InspectorTest.assertEquals("a", edge.name(), "edge name"); 65 InspectorTest.assertEquals("a", edge.name(), "edge name");
66 InspectorTest.assertEquals("A", edge.node().name(), "edge node n ame"); 66 InspectorTest.assertEquals("A", edge.node().name(), "edge node n ame");
67
68 var edgesCount = 0;
69 for (; edgeIterator.hasNext(); edgeIterator.next())
70 ++edgesCount;
71 InspectorTest.assertEquals(nodeRoot.edgesCount(), edgesCount, "e dges count");
67 }, 72 },
68 73
69 function heapSnapshotEdgeIteratorTest() 74 function heapSnapshotEdgeIteratorTest()
70 { 75 {
71 var snapshot = InspectorTest.createJSHeapSnapshotMockObject(); 76 var snapshot = InspectorTest.createJSHeapSnapshotMockObject();
72 var nodeRoot = snapshot.createNode(snapshot._rootNodeIndex); 77 var nodeRoot = snapshot.createNode(snapshot._rootNodeIndex);
73 var names = []; 78 var names = [];
74 for (var iterator = nodeRoot.edges(); iterator.hasNext(); iterat or.next()) 79 for (var iterator = nodeRoot.edges(); iterator.hasNext(); iterat or.next())
75 names.push(iterator.item().name()); 80 names.push(iterator.item().name());
76 InspectorTest.assertEquals("a,b", names.join(","), "edge iterato r"); 81 InspectorTest.assertEquals("a,b", names.join(","), "edge iterato r");
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 "M": false, 290 "M": false,
286 "N": false, 291 "N": false,
287 "Window": true 292 "Window": true
288 }; 293 };
289 for (var nodes = snapshot._allNodes(); nodes.hasNext(); nodes.ne xt()) { 294 for (var nodes = snapshot._allNodes(); nodes.hasNext(); nodes.ne xt()) {
290 var node = nodes.item(); 295 var node = nodes.item();
291 InspectorTest.assertEquals(expectedCanBeQueried[node.name()] , node.canBeQueried(), "canBeQueried of \"" + node.name() + "\""); 296 InspectorTest.assertEquals(expectedCanBeQueried[node.name()] , node.canBeQueried(), "canBeQueried of \"" + node.name() + "\"");
292 } 297 }
293 }, 298 },
294 299
295 function heapSnapshotArraySliceTest()
296 {
297 var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.cre ateHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress());
298 var root = snapshot.rootNode();
299 var rawEdges = root.rawEdges();
300 InspectorTest.assertEquals(6, rawEdges.length);
301 InspectorTest.assertEquals(6, rawEdges.subarray(0).length);
302 InspectorTest.assertEquals(3, rawEdges.subarray(3).length);
303 InspectorTest.assertEquals(3, rawEdges.subarray(3, 6).length);
304 InspectorTest.assertEquals(3, rawEdges.subarray(0, 3).length);
305 InspectorTest.assertEquals(0, rawEdges.subarray(3, 3).length);
306 },
307
308 function heapSnapshotNodesProviderTest() 300 function heapSnapshotNodesProviderTest()
309 { 301 {
310 var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.cre ateHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()); 302 var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.cre ateHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress());
311 303
312 function nodeFilter(node) 304 function nodeFilter(node)
313 { 305 {
314 return node.type() === "object" && node.name() !== "B" && no de.name() !== "D"; 306 return node.type() === "object" && node.name() !== "B" && no de.name() !== "D";
315 } 307 }
316 308
317 var allNodeIndexes = []; 309 var allNodeIndexes = [];
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 </script> 397 </script>
406 </head> 398 </head>
407 399
408 <body onload="runTest()"> 400 <body onload="runTest()">
409 <p> 401 <p>
410 This test checks HeapSnapshots module. 402 This test checks HeapSnapshots module.
411 </p> 403 </p>
412 404
413 </body> 405 </body>
414 </html> 406 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/profiler/heap-snapshot-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698