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

Side by Side Diff: test/cctest/test-cpu-profiler.cc

Issue 3108004: Fix CPU profiler crash in start / stop sequence when non-existent name is passed (Closed)
Patch Set: Created 10 years, 4 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 unified diff | Download patch
« no previous file with comments | « src/profile-generator-inl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // 2 //
3 // Tests of profiles generator and utilities. 3 // Tests of profiles generator and utilities.
4 4
5 #ifdef ENABLE_LOGGING_AND_PROFILING 5 #ifdef ENABLE_LOGGING_AND_PROFILING
6 6
7 #include "v8.h" 7 #include "v8.h"
8 #include "cpu-profiler-inl.h" 8 #include "cpu-profiler-inl.h"
9 #include "cctest.h" 9 #include "cctest.h"
10 10
11 namespace i = v8::internal; 11 namespace i = v8::internal;
12 12
13 using i::CodeEntry; 13 using i::CodeEntry;
14 using i::CpuProfile; 14 using i::CpuProfile;
15 using i::CpuProfiler;
15 using i::CpuProfilesCollection; 16 using i::CpuProfilesCollection;
16 using i::ProfileGenerator; 17 using i::ProfileGenerator;
17 using i::ProfileNode; 18 using i::ProfileNode;
18 using i::ProfilerEventsProcessor; 19 using i::ProfilerEventsProcessor;
19 using i::TokenEnumerator; 20 using i::TokenEnumerator;
20 21
21 22
22 TEST(StartStop) { 23 TEST(StartStop) {
23 CpuProfilesCollection profiles; 24 CpuProfilesCollection profiles;
24 ProfileGenerator generator(&profiles); 25 ProfileGenerator generator(&profiles);
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 const i::List<ProfileNode*>* bottom_up_ddd_children = 219 const i::List<ProfileNode*>* bottom_up_ddd_children =
219 bottom_up_root_children[2]->children(); 220 bottom_up_root_children[2]->children();
220 CHECK_EQ(1, bottom_up_ddd_children->length()); 221 CHECK_EQ(1, bottom_up_ddd_children->length());
221 CHECK_EQ("5", bottom_up_ddd_children->last()->entry()->name()); 222 CHECK_EQ("5", bottom_up_ddd_children->last()->entry()->name());
222 const i::List<ProfileNode*>* bottom_up_ddd_stub_children = 223 const i::List<ProfileNode*>* bottom_up_ddd_stub_children =
223 bottom_up_ddd_children->last()->children(); 224 bottom_up_ddd_children->last()->children();
224 CHECK_EQ(1, bottom_up_ddd_stub_children->length()); 225 CHECK_EQ(1, bottom_up_ddd_stub_children->length());
225 CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name()); 226 CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name());
226 } 227 }
227 228
229
230 // http://crbug/51594
231 // This test must not crash.
232 TEST(CrashIfStoppingLastNonExistentProfile) {
233 InitializeVM();
234 TestSetup test_setup;
235 CpuProfiler::Setup();
236 CpuProfiler::StartProfiling("1");
237 CpuProfiler::StopProfiling("2");
238 CpuProfiler::StartProfiling("1");
239 CpuProfiler::StopProfiling("");
240 CpuProfiler::TearDown();
241 }
242
228 #endif // ENABLE_LOGGING_AND_PROFILING 243 #endif // ENABLE_LOGGING_AND_PROFILING
OLDNEW
« no previous file with comments | « src/profile-generator-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698