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

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

Issue 218393010: DevTools: Fix PostOrder calculation algorithm in heap snapshot. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressing 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 | LayoutTests/inspector/profiler/heap-snapshot-expected.txt » ('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 9f7477aff7a99f988e378667b9080aeb44026404..7cc03c4ccc6af57fb5f91767d6abcdf44fcfded4 100644
--- a/LayoutTests/inspector/profiler/heap-snapshot.html
+++ b/LayoutTests/inspector/profiler/heap-snapshot.html
@@ -30,6 +30,21 @@ function test()
function runTestSuiteInWorker()
{
var testSuite = [
+ function postOrderIndexBug()
+ {
+ var builder = new InspectorTest.HeapSnapshotBuilder();
+ var node1 = new InspectorTest.HeapNode("Node1");
+ var node2 = new InspectorTest.HeapNode("Node2");
+ builder.rootNode.linkNode(node1, InspectorTest.HeapEdge.Type.internal);
+ builder.rootNode.linkNode(node2, InspectorTest.HeapEdge.Type.internal);
+ node2.linkNode(node1, InspectorTest.HeapEdge.Type.internal);
+ var snapshot = builder.createJSHeapSnapshot();
+ var postOrderIndexes = snapshot._buildPostOrderIndex().nodeOrdinal2PostOrderIndex;
+ var nodeOrdinals = snapshot._buildPostOrderIndex().postOrderIndex2NodeOrdinal;
+ InspectorTest.assertEquals(JSON.stringify(new Uint32Array([2, 0, 1])), JSON.stringify(postOrderIndexes), "postOrderIndexes");
+ InspectorTest.assertEquals(JSON.stringify(new Uint32Array([1, 2, 0])), JSON.stringify(nodeOrdinals), "nodeOrdinals");
+ },
+
function heapSnapshotNodeSimpleTest()
{
var snapshot = InspectorTest.createJSHeapSnapshotMockObject();
@@ -130,7 +145,7 @@ function test()
{
var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress());
var postOrderIndex2NodeOrdinal = snapshot._buildPostOrderIndex().postOrderIndex2NodeOrdinal;
- var expected = [4,5,3,2,1,0];
+ var expected = [5,3,4,2,1,0];
for (var i = 0; i < expected.length; ++i)
InspectorTest.assertEquals(expected[i], postOrderIndex2NodeOrdinal[i], "Post ordered indexes");
},
« 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