Index: test/cctest/test-heap-profiler.cc |
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc |
index 53b4f7e118351fa1a850a45c80074c4551e74f6d..85caa3f957d42c5f5f9bdd446e455a9fa9dfadb9 100644 |
--- a/test/cctest/test-heap-profiler.cc |
+++ b/test/cctest/test-heap-profiler.cc |
@@ -10,6 +10,7 @@ |
#include "debug.h" |
#include "utils-inl.h" |
#include "../include/v8-profiler.h" |
+#include <ctype.h> |
mnaganov (inactive)
2012/04/19 13:52:29
System headers must go before project headers:
ht
alexeif
2012/04/19 15:27:43
Done.
|
namespace { |
@@ -1621,3 +1622,25 @@ TEST(PersistentHandleCount) { |
p_BBB.Dispose(); |
CHECK_EQ(global_handle_count, v8::HeapProfiler::GetPersistentHandleCount()); |
} |
+ |
+ |
+TEST(AllStrongGcRootsHaveNames) { |
+ v8::HandleScope scope; |
+ LocalContext env; |
+ |
+ CompileRun("foo = {};"); |
+ const v8::HeapSnapshot* snapshot = |
+ v8::HeapProfiler::TakeSnapshot(v8_str("snapshot")); |
+ const v8::HeapGraphNode* gc_roots = GetNode( |
+ snapshot->GetRoot(), v8::HeapGraphNode::kObject, "(GC roots)"); |
+ CHECK_NE(NULL, gc_roots); |
+ const v8::HeapGraphNode* strong_roots = GetNode( |
+ gc_roots, v8::HeapGraphNode::kObject, "(Strong roots)"); |
+ CHECK_NE(NULL, strong_roots); |
+ for (int i = 0; i < strong_roots->GetChildrenCount(); ++i) { |
+ const v8::HeapGraphEdge* edge = strong_roots->GetChild(i); |
+ CHECK_EQ(v8::HeapGraphEdge::kInternal, edge->GetType()); |
+ v8::String::AsciiValue name(edge->GetName()); |
+ CHECK(isalpha(**name)); |
+ } |
+} |