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

Unified Diff: test/cctest/test-profile-generator.cc

Issue 130213009: Various extension-related cleanup and simplifications. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Whitespace Created 6 years, 11 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 | « test/cctest/test-log-stack-tracer.cc ('k') | test/cctest/trace-extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-profile-generator.cc
diff --git a/test/cctest/test-profile-generator.cc b/test/cctest/test-profile-generator.cc
index 0cd30ef8123bf21f48d9b2f7355e7ca5736a9948..e06063dc560236a9d68fceb4b3bf7ac8fa1d32ed 100644
--- a/test/cctest/test-profile-generator.cc
+++ b/test/cctest/test-profile-generator.cc
@@ -552,12 +552,9 @@ TEST(RecordStackTraceAtStartProfiling) {
// don't appear in the stack trace.
i::FLAG_use_inlining = false;
- v8::Isolate* isolate = CcTest::isolate();
- v8::HandleScope scope(isolate);
- const char* extensions[] = { "v8/profiler" };
- v8::ExtensionConfiguration config(1, extensions);
- v8::Local<v8::Context> context = v8::Context::New(isolate, &config);
- context->Enter();
+ v8::HandleScope scope(CcTest::isolate());
+ v8::Local<v8::Context> env = CcTest::NewContext(PROFILER_EXTENSION);
+ v8::Context::Scope context_scope(env);
CpuProfiler* profiler = CcTest::i_isolate()->cpu_profiler();
CHECK_EQ(0, profiler->GetProfilesCount());
@@ -630,10 +627,9 @@ TEST(ProfileNodeScriptId) {
// don't appear in the stack trace.
i::FLAG_use_inlining = false;
- const char* extensions[] = { "v8/profiler" };
- v8::ExtensionConfiguration config(1, extensions);
- LocalContext env(&config);
- v8::HandleScope hs(env->GetIsolate());
+ v8::HandleScope scope(CcTest::isolate());
+ v8::Local<v8::Context> env = CcTest::NewContext(PROFILER_EXTENSION);
+ v8::Context::Scope context_scope(env);
v8::CpuProfiler* profiler = env->GetIsolate()->GetCpuProfiler();
i::CpuProfiler* iprofiler = reinterpret_cast<i::CpuProfiler*>(profiler);
@@ -648,7 +644,7 @@ TEST(ProfileNodeScriptId) {
"stopProfiling();\n"));
script_b->Run();
CHECK_EQ(1, iprofiler->GetProfilesCount());
- const v8::CpuProfile* profile = ProfilerExtension::last_profile;
+ const v8::CpuProfile* profile = i::ProfilerExtension::last_profile;
const v8::CpuProfileNode* current = profile->GetTopDownRoot();
reinterpret_cast<ProfileNode*>(
const_cast<v8::CpuProfileNode*>(current))->Print(0);
@@ -733,10 +729,9 @@ TEST(LineNumber) {
TEST(BailoutReason) {
- const char* extensions[] = { "v8/profiler" };
- v8::ExtensionConfiguration config(1, extensions);
- LocalContext env(&config);
- v8::HandleScope hs(env->GetIsolate());
+ v8::HandleScope scope(CcTest::isolate());
+ v8::Local<v8::Context> env = CcTest::NewContext(PROFILER_EXTENSION);
+ v8::Context::Scope context_scope(env);
v8::CpuProfiler* profiler = env->GetIsolate()->GetCpuProfiler();
i::CpuProfiler* iprofiler = reinterpret_cast<i::CpuProfiler*>(profiler);
@@ -757,7 +752,7 @@ TEST(BailoutReason) {
"stopProfiling();"));
script->Run();
CHECK_EQ(1, iprofiler->GetProfilesCount());
- const v8::CpuProfile* profile = ProfilerExtension::last_profile;
+ const v8::CpuProfile* profile = i::ProfilerExtension::last_profile;
CHECK(profile);
const v8::CpuProfileNode* current = profile->GetTopDownRoot();
reinterpret_cast<ProfileNode*>(
« no previous file with comments | « test/cctest/test-log-stack-tracer.cc ('k') | test/cctest/trace-extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698