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

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

Issue 1635005: Allow new CPU profiling subsystem to coexist nicely with the old one. (Closed)
Patch Set: Fix TickSampleEvent Created 10 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
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);
« src/cpu-profiler-inl.h ('K') | « src/v8.cc ('k') | test/cctest/test-profile-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698