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

Unified Diff: test/cctest/test-heap-profiler.cc

Issue 17881005: Heap snapshot: Update user roots definition. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix a typo Created 7 years, 6 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 | « src/heap-snapshot-generator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap-profiler.cc
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc
index 2ca6e299494a906657d83520ac09da9a39aa1c93..afb06fc4a166bbed1b9b25b7df675d295f610c63 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -92,8 +92,9 @@ class NamedEntriesDetector {
static const v8::HeapGraphNode* GetGlobalObject(
const v8::HeapSnapshot* snapshot) {
CHECK_EQ(2, snapshot->GetRoot()->GetChildrenCount());
+ // The 0th-child is (GC Roots), 1st is the user root.
const v8::HeapGraphNode* global_obj =
- snapshot->GetRoot()->GetChild(0)->GetToNode();
+ snapshot->GetRoot()->GetChild(1)->GetToNode();
CHECK_EQ(0, strncmp("Object", const_cast<i::HeapEntry*>(
reinterpret_cast<const i::HeapEntry*>(global_obj))->name(), 6));
return global_obj;
@@ -658,7 +659,8 @@ TEST(HeapSnapshotJSONSerialization) {
" first_edge_indexes[i] = first_edge_index;\n"
" first_edge_index += edge_fields_count *\n"
" parsed.nodes[i * node_fields_count + edge_count_offset];\n"
- "}\n");
+ "}\n"
+ "first_edge_indexes[node_count] = first_edge_index;\n");
CHECK(!meta_analysis_result.IsEmpty());
// A helper function for processing encoded nodes.
@@ -682,7 +684,7 @@ TEST(HeapSnapshotJSONSerialization) {
"GetChildPosByProperty(\n"
" GetChildPosByProperty(\n"
" GetChildPosByProperty("
- " parsed.edges[edge_to_node_offset],"
+ " parsed.edges[edge_fields_count + edge_to_node_offset],"
" \"b\", property_type),\n"
" \"x\", property_type),"
" \"s\", property_type)");
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698