From: alph@chromium.org Date: Thu, 8 May 2014 09:47:17 +0000 (+0000) Subject: DevTools: Unflake test-cpu-profiler/JsNativeJsRuntimeJsSample X-Git-Tag: upstream/4.7.83~9225 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2221e08b5a3d9e0c52f54a72b596848df3c4ec1;p=platform%2Fupstream%2Fv8.git DevTools: Unflake test-cpu-profiler/JsNativeJsRuntimeJsSample BUG=v8:3308 LOG=N R=bmeurer@chromium.org, jochen@chromium.org, yurys@chromium.org Review URL: https://codereview.chromium.org/271683002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21198 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/profile-generator.cc b/src/profile-generator.cc index 957f5db..e1e5236 100644 --- a/src/profile-generator.cc +++ b/src/profile-generator.cc @@ -208,9 +208,9 @@ ProfileNode* ProfileNode::FindOrAddChild(CodeEntry* entry) { void ProfileNode::Print(int indent) { - OS::Print("%5u %*c %s%s %d #%d %s", + OS::Print("%5u %*s %s%s %d #%d %s", self_ticks_, - indent, ' ', + indent, "", entry_->name_prefix(), entry_->name(), entry_->script_id(), diff --git a/test/cctest/cctest.status b/test/cctest/cctest.status index fb73f7a..80a91a0 100644 --- a/test/cctest/cctest.status +++ b/test/cctest/cctest.status @@ -73,8 +73,6 @@ 'test-cpu-profiler/CollectCpuProfile': [PASS, FLAKY], # BUG(3287). 'test-cpu-profiler/SampleWhenFrameIsNotSetup': [PASS, FLAKY], - # BUG(3308). - 'test-cpu-profiler/JsNativeJsRuntimeJsSample': [PASS, FLAKY], ############################################################################ # Slow tests. diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc index 6cff742..52e0fd6 100644 --- a/test/cctest/test-cpu-profiler.cc +++ b/test/cctest/test-cpu-profiler.cc @@ -1158,9 +1158,12 @@ TEST(FunctionApplySample) { const v8::CpuProfileNode* testNode = FindChild(env->GetIsolate(), startNode, "test"); if (testNode) { - ScopedVector > names(2); + ScopedVector > names(3); names[0] = v8::String::NewFromUtf8(env->GetIsolate(), "bar"); names[1] = v8::String::NewFromUtf8(env->GetIsolate(), "apply"); + // apply calls "get length" before invoking the function itself + // and we may get hit into it. + names[2] = v8::String::NewFromUtf8(env->GetIsolate(), "get length"); CheckChildrenNames(testNode, names); } @@ -1343,7 +1346,11 @@ TEST(JsNativeJsRuntimeJsSample) { const v8::CpuProfileNode* barNode = GetChild(env->GetIsolate(), nativeFunctionNode, "bar"); - CHECK_EQ(1, barNode->GetChildrenCount()); + // The child is in fact a bound foo. + // A bound function has a wrapper that may make calls to + // other functions e.g. "get length". + CHECK_LE(1, barNode->GetChildrenCount()); + CHECK_GE(2, barNode->GetChildrenCount()); GetChild(env->GetIsolate(), barNode, "foo"); profile->Delete();