Index: test/cctest/test-heap-profiler.cc |
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc |
index d695d7438fc3e1a00f2b0565c6622d6dd2e288b6..87e7a7d0f95ed53f5c85350fa71b29c2cdb0ddcd 100644 |
--- a/test/cctest/test-heap-profiler.cc |
+++ b/test/cctest/test-heap-profiler.cc |
@@ -252,6 +252,28 @@ TEST(HeapSnapshotHeapNumbers) { |
CHECK_EQ(v8::HeapGraphNode::kHeapNumber, b->GetType()); |
} |
+TEST(HeapSnapshotSlicedString) { |
+ v8::HandleScope scope; |
+ LocalContext env; |
+ CompileRun( |
+ "parent_string = \"123456789.123456789.123456789.123456789.123456789." |
+ "123456789.123456789.123456789.123456789.123456789." |
+ "123456789.123456789.123456789.123456789.123456789." |
+ "123456789.123456789.123456789.123456789.123456789.\";" |
+ "child_string = parent_string.slice(100);"); |
+ const v8::HeapSnapshot* snapshot = |
+ v8::HeapProfiler::TakeSnapshot(v8_str("strings")); |
+ const v8::HeapGraphNode* global = GetGlobalObject(snapshot); |
+ const v8::HeapGraphNode* parent_string = |
+ GetProperty(global, v8::HeapGraphEdge::kShortcut, "parent_string"); |
+ CHECK_NE(NULL, parent_string); |
+ const v8::HeapGraphNode* child_string = |
+ GetProperty(global, v8::HeapGraphEdge::kShortcut, "child_string"); |
+ CHECK_NE(NULL, child_string); |
+ const v8::HeapGraphNode* parent = |
+ GetProperty(child_string, v8::HeapGraphEdge::kInternal, "parent"); |
+ CHECK_EQ(parent_string, parent); |
+} |
TEST(HeapSnapshotInternalReferences) { |
v8::HandleScope scope; |