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

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

Issue 1846723002: Gracefully handle unloaded scripts (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use find and inline script Created 4 years, 9 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/profiler/sampling-heap-profiler.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 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();
+ }
}
« no previous file with comments | « src/profiler/sampling-heap-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698