DevTools: Unflake test-cpu-profiler/JsNativeJsRuntimeJsSample
authoralph@chromium.org <alph@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 8 May 2014 09:47:17 +0000 (09:47 +0000)
committeralph@chromium.org <alph@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 8 May 2014 09:47:17 +0000 (09:47 +0000)
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

src/profile-generator.cc
test/cctest/cctest.status
test/cctest/test-cpu-profiler.cc

index 957f5db..e1e5236 100644 (file)
@@ -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(),
index fb73f7a..80a91a0 100644 (file)
@@ -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.
index 6cff742..52e0fd6 100644 (file)
@@ -1158,9 +1158,12 @@ TEST(FunctionApplySample) {
     const v8::CpuProfileNode* testNode =
         FindChild(env->GetIsolate(), startNode, "test");
     if (testNode) {
-      ScopedVector<v8::Handle<v8::String> > names(2);
+      ScopedVector<v8::Handle<v8::String> > 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();