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

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

Issue 14845018: Allow for no samples in test-cpu-profiler/SampleWhenFrameIsNotSetup (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/cctest.status ('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 // 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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 601
602 const v8::CpuProfileNode* root = profile->GetTopDownRoot(); 602 const v8::CpuProfileNode* root = profile->GetTopDownRoot();
603 603
604 ScopedVector<v8::Handle<v8::String> > names(3); 604 ScopedVector<v8::Handle<v8::String> > names(3);
605 names[0] = v8::String::New(ProfileGenerator::kGarbageCollectorEntryName); 605 names[0] = v8::String::New(ProfileGenerator::kGarbageCollectorEntryName);
606 names[1] = v8::String::New(ProfileGenerator::kProgramEntryName); 606 names[1] = v8::String::New(ProfileGenerator::kProgramEntryName);
607 names[2] = v8::String::New("start"); 607 names[2] = v8::String::New("start");
608 CheckChildrenNames(root, names); 608 CheckChildrenNames(root, names);
609 609
610 const v8::CpuProfileNode* startNode = FindChild(root, "start"); 610 const v8::CpuProfileNode* startNode = FindChild(root, "start");
611 if (startNode->GetChildrenCount() > 0) { 611 // On slow machines there may be no meaningfull samples at all, skip the
612 // check there.
613 if (startNode && startNode->GetChildrenCount() > 0) {
612 CHECK_EQ(1, startNode->GetChildrenCount()); 614 CHECK_EQ(1, startNode->GetChildrenCount());
613 const v8::CpuProfileNode* delayNode = FindChild(startNode, "delay"); 615 const v8::CpuProfileNode* delayNode = FindChild(startNode, "delay");
614 if (delayNode->GetChildrenCount() > 0) { 616 if (delayNode->GetChildrenCount() > 0) {
615 CHECK_EQ(1, delayNode->GetChildrenCount()); 617 CHECK_EQ(1, delayNode->GetChildrenCount());
616 FindChild(delayNode, "loop"); 618 FindChild(delayNode, "loop");
617 } 619 }
618 } 620 }
619 621
620 cpu_profiler->DeleteAllCpuProfiles(); 622 cpu_profiler->DeleteAllCpuProfiles();
621 } 623 }
OLDNEW
« no previous file with comments | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698