Index: test/cctest/test-heap-profiler.cc |
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc |
index 87119b8571394118af54f9e48b6124faad2ca70d..a4218f31b2dfde6a45633cad6cab5428e1224283 100644 |
--- a/test/cctest/test-heap-profiler.cc |
+++ b/test/cctest/test-heap-profiler.cc |
@@ -2872,7 +2872,6 @@ static const v8::AllocationProfile::Node* FindAllocationProfileNode( |
return node; |
} |
- |
TEST(SamplingHeapProfiler) { |
v8::HandleScope scope(v8::Isolate::GetCurrent()); |
LocalContext env; |
@@ -2985,6 +2984,23 @@ TEST(SamplingHeapProfiler) { |
heap_profiler->StopSamplingHeapProfiler(); |
} |
+ |
+ // A test case with scripts unloaded before profile gathered |
+ { |
+ heap_profiler->StartSamplingHeapProfiler(64); |
+ CompileRun( |
+ "for (var i = 0; i < 1024; i++) {\n" |
+ " eval(\"new Array(100)\");\n" |
+ "}\n"); |
+ |
+ CcTest::heap()->CollectAllGarbage(); |
+ |
+ v8::base::SmartPointer<v8::AllocationProfile> profile( |
+ heap_profiler->GetAllocationProfile()); |
+ CHECK(!profile.is_empty()); |
+ |
+ heap_profiler->StopSamplingHeapProfiler(); |
+ } |
} |