Index: test/cctest/test-heap-profiler.cc |
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc |
index 1bd0e671d62fca4bdc8e2acb15426ee5df2d1e79..9f56b63d568dcee1b0896aae64e4fdfc565c3f4c 100644 |
--- a/test/cctest/test-heap-profiler.cc |
+++ b/test/cctest/test-heap-profiler.cc |
@@ -7,6 +7,7 @@ |
#include "cctest.h" |
#include "heap-profiler.h" |
#include "snapshot.h" |
+#include "debug.h" |
#include "utils-inl.h" |
#include "../include/v8-profiler.h" |
@@ -1563,6 +1564,30 @@ TEST(SfiAndJsFunctionWeakRefs) { |
} |
+TEST(NoDebugObjectInSnapshot) { |
+ v8::HandleScope scope; |
+ LocalContext env; |
+ |
+ v8::internal::Isolate::Current()->debug()->Load(); |
+ CompileRun("foo = {};"); |
+ const v8::HeapSnapshot* snapshot = |
+ v8::HeapProfiler::TakeSnapshot(v8_str("snapshot")); |
+ const v8::HeapGraphNode* root = snapshot->GetRoot(); |
+ int globals_count = 0; |
+ for (int i = 0; i < root->GetChildrenCount(); ++i) { |
+ const v8::HeapGraphEdge* edge = root->GetChild(i); |
+ if (edge->GetType() == v8::HeapGraphEdge::kShortcut) { |
+ ++globals_count; |
+ const v8::HeapGraphNode* global = edge->GetToNode(); |
+ const v8::HeapGraphNode* foo = |
+ GetProperty(global, v8::HeapGraphEdge::kProperty, "foo"); |
+ CHECK_NE(NULL, foo); |
+ } |
+ } |
+ CHECK_EQ(1, globals_count); |
+} |
+ |
+ |
TEST(PersistentHandleCount) { |
v8::HandleScope scope; |
LocalContext env; |