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

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

Issue 13483017: Unify the way cctest initalizes the VM for each test case. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed presubmit errors. Created 7 years, 8 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-compiler.cc ('k') | test/cctest/test-disasm-arm.cc » ('j') | 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 0bf80003f86e0dbbc3fbb053965a38d953b89a5b..daf7e26724281702a124d573c5903a294ed1eb5d 100644
--- a/test/cctest/test-cpu-profiler.cc
+++ b/test/cctest/test-cpu-profiler.cc
@@ -51,14 +51,6 @@ TEST(StartStop) {
processor.Join();
}
-static v8::Persistent<v8::Context> env;
-
-static void InitializeVM() {
- if (env.IsEmpty()) env = v8::Context::New();
- v8::HandleScope scope(env->GetIsolate());
- env->Enter();
-}
-
static inline i::Address ToAddress(int n) {
return reinterpret_cast<i::Address>(n);
}
@@ -101,7 +93,7 @@ class TestSetup {
} // namespace
TEST(CodeEvents) {
- InitializeVM();
+ CcTest::InitializeVM();
i::Isolate* isolate = i::Isolate::Current();
i::Heap* heap = isolate->heap();
i::Factory* factory = isolate->factory();
@@ -217,7 +209,7 @@ TEST(TickEvents) {
// http://crbug/51594
// This test must not crash.
TEST(CrashIfStoppingLastNonExistentProfile) {
- InitializeVM();
+ CcTest::InitializeVM();
TestSetup test_setup;
CpuProfiler* profiler = i::Isolate::Current()->cpu_profiler();
profiler->StartProfiling("1");
@@ -268,7 +260,7 @@ TEST(Issue1398) {
TEST(DeleteAllCpuProfiles) {
- InitializeVM();
+ CcTest::InitializeVM();
TestSetup test_setup;
CpuProfiler* profiler = i::Isolate::Current()->cpu_profiler();
CHECK_EQ(0, profiler->GetProfilesCount());
« no previous file with comments | « test/cctest/test-compiler.cc ('k') | test/cctest/test-disasm-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698