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

Unified Diff: LayoutTests/inspector/profiler/heap-snapshot.html

Issue 205993003: Simplify HeapSnapshotFilteredOrderedIterator implementation (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/devtools/front_end/HeapSnapshot.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/profiler/heap-snapshot.html
diff --git a/LayoutTests/inspector/profiler/heap-snapshot.html b/LayoutTests/inspector/profiler/heap-snapshot.html
index fb1d0e3796d53ce0a5227513883958836b233517..89edf4fc6352d016d22c823be030b509df492ee1 100644
--- a/LayoutTests/inspector/profiler/heap-snapshot.html
+++ b/LayoutTests/inspector/profiler/heap-snapshot.html
@@ -315,14 +315,20 @@ function test()
return node.type() === "object" && node.name() !== "B" && node.name() !== "D";
}
- var provider = new WebInspector.HeapSnapshotNodesProvider(snapshot, nodeFilter);
+ var allNodeIndexes = [];
+ for (var i = 0; i < snapshot._nodes.length; i += snapshot._nodeFieldCount)
+ allNodeIndexes.push(i);
+ var provider = new WebInspector.HeapSnapshotNodesProvider(snapshot, nodeFilter, allNodeIndexes);
// Sort by names in reverse order.
- InspectorTest.assertEquals(3, provider.length, "nodes provider length");
- provider.sort({fieldName1: "name", ascending1: false, fieldName2: "id", ascending2: false}, 0, 2, 3);
- InspectorTest.assertEquals(3, provider.length, "nodes provider length");
- var names = [];
- for (provider.rewind(); provider.hasNext(); provider.next())
- names.push(provider.item().name());
+ provider.sortAndRewind({fieldName1: "name", ascending1: false, fieldName2: "id", ascending2: false});
+ var range = provider.serializeItemsRange(0, 3);
+ InspectorTest.assertEquals(3, range.totalLength, "Node range total length");
+ InspectorTest.assertEquals(0, range.startPosition, "Node range start position");
+ InspectorTest.assertEquals(3, range.endPosition, "Node range end position");
+ var names = range.items.map(function(item)
+ {
+ return item.name;
+ });
InspectorTest.assertEquals("E,C,A", names.join(","), "nodes provider names");
},
@@ -336,12 +342,15 @@ function test()
}
var provider = snapshot.createEdgesProviderForTest(snapshot.rootNodeIndex, edgeFilter);
- InspectorTest.assertEquals(1, provider.length, "edges provider length");
- provider.sort({fieldName1: "!edgeName", ascending1: false, fieldName2: "id", ascending2: false}, 0, 0, 1);
- InspectorTest.assertEquals(1, provider.length, "edges provider length");
- var names = [];
- for (provider.rewind(); provider.hasNext(); provider.next())
- names.push(provider.item().name());
+ provider.sortAndRewind({fieldName1: "!edgeName", ascending1: false, fieldName2: "id", ascending2: false});
+ var range = provider.serializeItemsRange(0, 10);
+ InspectorTest.assertEquals(1, range.totalLength, "Edge range total length");
+ InspectorTest.assertEquals(0, range.startPosition, "Edge range start position");
+ InspectorTest.assertEquals(1, range.endPosition, "Edge range end position");
+ var names = range.items.map(function(item)
+ {
+ return item.name;
+ });
InspectorTest.assertEquals("b", names.join(","), "edges provider names");
},
« no previous file with comments | « no previous file | Source/devtools/front_end/HeapSnapshot.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698