Index: test/cctest/test-cpu-profiler.cc |
diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc |
index a8f5b161d3d9cdaa6f22e6ae20fdf1293cfb1aab..4e4cf28c5cc888b7365129531f675e8d1e67bba1 100644 |
--- a/test/cctest/test-cpu-profiler.cc |
+++ b/test/cctest/test-cpu-profiler.cc |
@@ -47,7 +47,6 @@ static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc, |
i::Address frame2 = NULL, |
i::Address frame3 = NULL) { |
i::TickSample* sample = proc->TickSampleEvent(); |
- sample->state = i::OTHER; |
sample->pc = frame1; |
sample->function = frame1; |
sample->frames_count = 0; |
@@ -61,8 +60,28 @@ static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc, |
} |
} |
+namespace { |
+ |
+class TestSetup { |
+ public: |
+ TestSetup() |
+ : old_flag_prof_browser_mode_(i::FLAG_prof_browser_mode) { |
+ i::FLAG_prof_browser_mode = false; |
+ } |
+ |
+ ~TestSetup() { |
+ i::FLAG_prof_browser_mode = old_flag_prof_browser_mode_; |
+ } |
+ |
+ private: |
+ bool old_flag_prof_browser_mode_; |
+}; |
+ |
+} // namespace |
+ |
TEST(CodeEvents) { |
InitializeVM(); |
+ TestSetup test_setup; |
CpuProfilesCollection profiles; |
profiles.StartProfiling("", 1); |
ProfileGenerator generator(&profiles); |
@@ -129,6 +148,7 @@ static int CompareProfileNodes(const T* p1, const T* p2) { |
} |
TEST(TickEvents) { |
+ TestSetup test_setup; |
CpuProfilesCollection profiles; |
profiles.StartProfiling("", 1); |
ProfileGenerator generator(&profiles); |