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

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

Issue 18336002: Test that profiler is stopped when isolate is being disposed (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated v8.h comments Created 7 years, 6 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/cpu-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-cpu-profiler.cc
diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc
index 9a2496a72a96a77154be1003aab35b150300be8a..35f4bb4cbb5f0cd3b2a4bbe7048c997b4647433f 100644
--- a/test/cctest/test-cpu-profiler.cc
+++ b/test/cctest/test-cpu-profiler.cc
@@ -412,6 +412,26 @@ TEST(DeleteCpuProfileDifferentTokens) {
}
+TEST(GetProfilerWhenIsolateIsNotInitialized) {
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ CHECK(i::Isolate::Current()->IsDefaultIsolate());
+ CHECK(!i::Isolate::Current()->IsInitialized());
+ CHECK_EQ(NULL, isolate->GetCpuProfiler());
+ {
+ v8::Isolate::Scope isolateScope(isolate);
+ LocalContext env;
+ v8::HandleScope scope(isolate);
+ CHECK_NE(NULL, isolate->GetCpuProfiler());
+ isolate->GetCpuProfiler()->StartCpuProfiling(v8::String::New("Test"));
+ isolate->GetCpuProfiler()->StopCpuProfiling(v8::String::New("Test"));
+ }
+ CHECK(i::Isolate::Current()->IsInitialized());
+ CHECK_NE(NULL, isolate->GetCpuProfiler());
+ isolate->Dispose();
+ CHECK_EQ(NULL, isolate->GetCpuProfiler());
+}
+
+
static bool ContainsString(v8::Handle<v8::String> string,
const Vector<v8::Handle<v8::String> >& vector) {
for (int i = 0; i < vector.length(); i++) {
« no previous file with comments | « src/cpu-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698