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

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

Issue 1474353002: Remove easy to remove calls to Isolate::Current() from api.cc (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: update Created 5 years, 1 month 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
Index: test/cctest/test-profile-generator.cc
diff --git a/test/cctest/test-profile-generator.cc b/test/cctest/test-profile-generator.cc
index 65d1a83bc41192d61ecc38147d4dd4d4453213f8..689b2ba110821e0366aa774566d5469a70bbf50e 100644
--- a/test/cctest/test-profile-generator.cc
+++ b/test/cctest/test-profile-generator.cc
@@ -51,7 +51,8 @@ using i::Vector;
TEST(ProfileNodeFindOrAddChild) {
- ProfileTree tree;
+ CcTest::InitializeVM();
+ ProfileTree tree(CcTest::i_isolate());
ProfileNode* node = tree.root();
CodeEntry entry1(i::Logger::FUNCTION_TAG, "aaa");
ProfileNode* childNode1 = node->FindOrAddChild(&entry1);
@@ -75,8 +76,9 @@ TEST(ProfileNodeFindOrAddChild) {
TEST(ProfileNodeFindOrAddChildForSameFunction) {
+ CcTest::InitializeVM();
const char* aaa = "aaa";
- ProfileTree tree;
+ ProfileTree tree(CcTest::i_isolate());
ProfileNode* node = tree.root();
CodeEntry entry1(i::Logger::FUNCTION_TAG, aaa);
ProfileNode* childNode1 = node->FindOrAddChild(&entry1);
@@ -122,10 +124,11 @@ class ProfileTreeTestHelper {
TEST(ProfileTreeAddPathFromEnd) {
+ CcTest::InitializeVM();
CodeEntry entry1(i::Logger::FUNCTION_TAG, "aaa");
CodeEntry entry2(i::Logger::FUNCTION_TAG, "bbb");
CodeEntry entry3(i::Logger::FUNCTION_TAG, "ccc");
- ProfileTree tree;
+ ProfileTree tree(CcTest::i_isolate());
ProfileTreeTestHelper helper(&tree);
CHECK(!helper.Walk(&entry1));
CHECK(!helper.Walk(&entry2));
@@ -181,7 +184,8 @@ TEST(ProfileTreeAddPathFromEnd) {
TEST(ProfileTreeCalculateTotalTicks) {
- ProfileTree empty_tree;
+ CcTest::InitializeVM();
+ ProfileTree empty_tree(CcTest::i_isolate());
CHECK_EQ(0u, empty_tree.root()->self_ticks());
empty_tree.root()->IncrementSelfTicks();
CHECK_EQ(1u, empty_tree.root()->self_ticks());
@@ -191,7 +195,7 @@ TEST(ProfileTreeCalculateTotalTicks) {
Vector<CodeEntry*> e1_path_vec(
e1_path, sizeof(e1_path) / sizeof(e1_path[0]));
- ProfileTree single_child_tree;
+ ProfileTree single_child_tree(CcTest::i_isolate());
single_child_tree.AddPathFromEnd(e1_path_vec);
single_child_tree.root()->IncrementSelfTicks();
CHECK_EQ(1u, single_child_tree.root()->self_ticks());
@@ -206,7 +210,7 @@ TEST(ProfileTreeCalculateTotalTicks) {
Vector<CodeEntry*> e2_e1_path_vec(e2_e1_path,
sizeof(e2_e1_path) / sizeof(e2_e1_path[0]));
- ProfileTree flat_tree;
+ ProfileTree flat_tree(CcTest::i_isolate());
ProfileTreeTestHelper flat_helper(&flat_tree);
flat_tree.AddPathFromEnd(e1_path_vec);
flat_tree.AddPathFromEnd(e1_path_vec);
@@ -233,7 +237,7 @@ TEST(ProfileTreeCalculateTotalTicks) {
Vector<CodeEntry*> e3_path_vec(
e3_path, sizeof(e3_path) / sizeof(e3_path[0]));
- ProfileTree wide_tree;
+ ProfileTree wide_tree(CcTest::i_isolate());
ProfileTreeTestHelper wide_helper(&wide_tree);
wide_tree.AddPathFromEnd(e1_path_vec);
wide_tree.AddPathFromEnd(e1_path_vec);
« include/v8.h ('K') | « test/cctest/test-heap-profiler.cc ('k') | tools/v8heapconst.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698