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

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

Issue 15786004: Un-flake test-cpu-profiler/SampleWhenFrameIsNotSetup (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-cpu-profiler.cc
diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc
index 22af9e75b3e3e4135548c3528b31889a41dfe1eb..be745c815a672cdd236d3793f698a6a6ea0e4337 100644
--- a/test/cctest/test-cpu-profiler.cc
+++ b/test/cctest/test-cpu-profiler.cc
@@ -434,17 +434,23 @@ static const v8::CpuProfileNode* FindChild(const v8::CpuProfileNode* node,
const v8::CpuProfileNode* child = node->GetChild(i);
if (nameHandle->Equals(child->GetFunctionName())) return child;
}
- CHECK(false);
return NULL;
}
+static const v8::CpuProfileNode* GetChild(const v8::CpuProfileNode* node,
+ const char* name) {
+ const v8::CpuProfileNode* result = FindChild(node, name);
+ CHECK(result);
+ return result;
+}
+
+
static void CheckSimpleBranch(const v8::CpuProfileNode* node,
const char* names[], int length) {
for (int i = 0; i < length; i++) {
const char* name = names[i];
- node = FindChild(node, name);
- CHECK(node);
+ node = GetChild(node, name);
int expectedChildrenCount = (i == length - 1) ? 0 : 1;
CHECK_EQ(expectedChildrenCount, node->GetChildrenCount());
}
@@ -535,10 +541,10 @@ TEST(CollectCpuProfile) {
names[2] = v8::String::New("start");
CheckChildrenNames(root, names);
- const v8::CpuProfileNode* startNode = FindChild(root, "start");
+ const v8::CpuProfileNode* startNode = GetChild(root, "start");
CHECK_EQ(1, startNode->GetChildrenCount());
- const v8::CpuProfileNode* fooNode = FindChild(startNode, "foo");
+ const v8::CpuProfileNode* fooNode = GetChild(startNode, "foo");
CHECK_EQ(3, fooNode->GetChildrenCount());
const char* barBranch[] = { "bar", "delay", "loop" };
@@ -612,10 +618,10 @@ TEST(SampleWhenFrameIsNotSetup) {
// check there.
if (startNode && startNode->GetChildrenCount() > 0) {
CHECK_EQ(1, startNode->GetChildrenCount());
- const v8::CpuProfileNode* delayNode = FindChild(startNode, "delay");
+ const v8::CpuProfileNode* delayNode = GetChild(startNode, "delay");
if (delayNode->GetChildrenCount() > 0) {
CHECK_EQ(1, delayNode->GetChildrenCount());
- FindChild(delayNode, "loop");
+ GetChild(delayNode, "loop");
}
}
« 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