| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 top_down_root_children->last()->children(); | 204 top_down_root_children->last()->children(); |
| 205 CHECK_EQ(1, top_down_bbb_children->length()); | 205 CHECK_EQ(1, top_down_bbb_children->length()); |
| 206 CHECK_EQ("5", top_down_bbb_children->last()->entry()->name()); | 206 CHECK_EQ("5", top_down_bbb_children->last()->entry()->name()); |
| 207 const i::List<ProfileNode*>* top_down_stub_children = | 207 const i::List<ProfileNode*>* top_down_stub_children = |
| 208 top_down_bbb_children->last()->children(); | 208 top_down_bbb_children->last()->children(); |
| 209 CHECK_EQ(1, top_down_stub_children->length()); | 209 CHECK_EQ(1, top_down_stub_children->length()); |
| 210 CHECK_EQ("ddd", top_down_stub_children->last()->entry()->name()); | 210 CHECK_EQ("ddd", top_down_stub_children->last()->entry()->name()); |
| 211 const i::List<ProfileNode*>* top_down_ddd_children = | 211 const i::List<ProfileNode*>* top_down_ddd_children = |
| 212 top_down_stub_children->last()->children(); | 212 top_down_stub_children->last()->children(); |
| 213 CHECK_EQ(0, top_down_ddd_children->length()); | 213 CHECK_EQ(0, top_down_ddd_children->length()); |
| 214 | |
| 215 const i::List<ProfileNode*>* bottom_up_root_children_unsorted = | |
| 216 profile->bottom_up()->root()->children(); | |
| 217 CHECK_EQ(3, bottom_up_root_children_unsorted->length()); | |
| 218 i::List<ProfileNode*> bottom_up_root_children(3); | |
| 219 bottom_up_root_children.AddAll(*bottom_up_root_children_unsorted); | |
| 220 bottom_up_root_children.Sort(&CompareProfileNodes); | |
| 221 CHECK_EQ("5", bottom_up_root_children[0]->entry()->name()); | |
| 222 CHECK_EQ("bbb", bottom_up_root_children[1]->entry()->name()); | |
| 223 CHECK_EQ("ddd", bottom_up_root_children[2]->entry()->name()); | |
| 224 const i::List<ProfileNode*>* bottom_up_stub_children = | |
| 225 bottom_up_root_children[0]->children(); | |
| 226 CHECK_EQ(1, bottom_up_stub_children->length()); | |
| 227 CHECK_EQ("bbb", bottom_up_stub_children->last()->entry()->name()); | |
| 228 const i::List<ProfileNode*>* bottom_up_bbb_children = | |
| 229 bottom_up_root_children[1]->children(); | |
| 230 CHECK_EQ(0, bottom_up_bbb_children->length()); | |
| 231 const i::List<ProfileNode*>* bottom_up_ddd_children = | |
| 232 bottom_up_root_children[2]->children(); | |
| 233 CHECK_EQ(1, bottom_up_ddd_children->length()); | |
| 234 CHECK_EQ("5", bottom_up_ddd_children->last()->entry()->name()); | |
| 235 const i::List<ProfileNode*>* bottom_up_ddd_stub_children = | |
| 236 bottom_up_ddd_children->last()->children(); | |
| 237 CHECK_EQ(1, bottom_up_ddd_stub_children->length()); | |
| 238 CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name()); | |
| 239 } | 214 } |
| 240 | 215 |
| 241 | 216 |
| 242 // http://crbug/51594 | 217 // http://crbug/51594 |
| 243 // This test must not crash. | 218 // This test must not crash. |
| 244 TEST(CrashIfStoppingLastNonExistentProfile) { | 219 TEST(CrashIfStoppingLastNonExistentProfile) { |
| 245 InitializeVM(); | 220 InitializeVM(); |
| 246 TestSetup test_setup; | 221 TestSetup test_setup; |
| 247 CpuProfiler::SetUp(); | 222 CpuProfiler::SetUp(); |
| 248 CpuProfiler::StartProfiling("1"); | 223 CpuProfiler::StartProfiling("1"); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 CHECK_EQ(NULL, v8::CpuProfiler::FindProfile(uid2)); | 393 CHECK_EQ(NULL, v8::CpuProfiler::FindProfile(uid2)); |
| 419 CHECK_EQ(p3, v8::CpuProfiler::FindProfile(uid3)); | 394 CHECK_EQ(p3, v8::CpuProfiler::FindProfile(uid3)); |
| 420 const_cast<v8::CpuProfile*>(p2)->Delete(); | 395 const_cast<v8::CpuProfile*>(p2)->Delete(); |
| 421 CHECK_EQ(1, v8::CpuProfiler::GetProfilesCount()); | 396 CHECK_EQ(1, v8::CpuProfiler::GetProfilesCount()); |
| 422 CHECK_EQ(NULL, v8::CpuProfiler::FindProfile(uid2)); | 397 CHECK_EQ(NULL, v8::CpuProfiler::FindProfile(uid2)); |
| 423 CHECK_EQ(p3, v8::CpuProfiler::FindProfile(uid3)); | 398 CHECK_EQ(p3, v8::CpuProfiler::FindProfile(uid3)); |
| 424 const_cast<v8::CpuProfile*>(p3)->Delete(); | 399 const_cast<v8::CpuProfile*>(p3)->Delete(); |
| 425 CHECK_EQ(0, CpuProfiler::GetProfilesCount()); | 400 CHECK_EQ(0, CpuProfiler::GetProfilesCount()); |
| 426 CHECK_EQ(NULL, v8::CpuProfiler::FindProfile(uid3)); | 401 CHECK_EQ(NULL, v8::CpuProfiler::FindProfile(uid3)); |
| 427 } | 402 } |
| OLD | NEW |