Title: [137276] trunk/LayoutTests
Revision
137276
Author
ca...@chromium.org
Date
2012-12-11 02:31:17 -0800 (Tue, 11 Dec 2012)

Log Message

Unreviewed, rolling out r137266.
http://trac.webkit.org/changeset/137266
https://bugs.webkit.org/show_bug.cgi?id=104071

New test fails on WebKit Win7 and chromium mac

* inspector/profiler/cpu-profiler-profiling-without-inspector-expected.txt:
* inspector/profiler/cpu-profiler-profiling-without-inspector.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (137275 => 137276)


--- trunk/LayoutTests/ChangeLog	2012-12-11 10:20:05 UTC (rev 137275)
+++ trunk/LayoutTests/ChangeLog	2012-12-11 10:31:17 UTC (rev 137276)
@@ -1,3 +1,14 @@
+2012-12-11  Andrey Kosyakov  <ca...@chromium.org>
+
+        Unreviewed, rolling out r137266.
+        http://trac.webkit.org/changeset/137266
+        https://bugs.webkit.org/show_bug.cgi?id=104071
+
+        New test fails on WebKit Win7 and chromium mac
+
+        * inspector/profiler/cpu-profiler-profiling-without-inspector-expected.txt:
+        * inspector/profiler/cpu-profiler-profiling-without-inspector.html:
+
 2012-12-11  Kent Tamura  <tk...@chromium.org>
 
         INPUT_MULTIPLE_FIELDS_UI: Disable focus navigation by right/left keys in RTL locales

Modified: trunk/LayoutTests/inspector/profiler/cpu-profiler-profiling-without-inspector-expected.txt (137275 => 137276)


--- trunk/LayoutTests/inspector/profiler/cpu-profiler-profiling-without-inspector-expected.txt	2012-12-11 10:20:05 UTC (rev 137275)
+++ trunk/LayoutTests/inspector/profiler/cpu-profiler-profiling-without-inspector-expected.txt	2012-12-11 10:31:17 UTC (rev 137276)
@@ -1,9 +1,6 @@
 Tests that CPU profiling works.
 Doesn't open Inspector, uses console.profile....
 
-    doWork (line 40): ~400ms
-        functionA (line 27): ~400ms
-            sleep (line 18): ~200ms
-            functionB (line 23): ~200ms
-                sleep (line 18): ~200ms
 
+Found pageFunction
+

Modified: trunk/LayoutTests/inspector/profiler/cpu-profiler-profiling-without-inspector.html (137275 => 137276)


--- trunk/LayoutTests/inspector/profiler/cpu-profiler-profiling-without-inspector.html	2012-12-11 10:20:05 UTC (rev 137275)
+++ trunk/LayoutTests/inspector/profiler/cpu-profiler-profiling-without-inspector.html	2012-12-11 10:31:17 UTC (rev 137276)
@@ -1,91 +1,77 @@
 <html>
 <head>
-<script src="" type="application/x-_javascript_"></script>
-<script type="application/x-_javascript_">
+<script>
 
-if (window.testRunner) {
+if (window.testRunner)
     testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-}
-
 if (window.internals)
     internals.setJavaScriptProfilingEnabled(true);
 
-// Here and below, the opening brace is on the same line as function declaration
-// intendionally, as it compensates for differences between the ways JSC and V8
-// use to report source lines for functions (V8 reports line of function(), JSC
-// the line of the brace)
-function sleep(milliseconds) {
-    var spinUntil = Date.now() + milliseconds;
-    while (Date.now() < spinUntil) {}
-}
-
-function functionB() {
-    sleep(200);
-}
-
-function functionA() {
-    sleep(200);
-    functionB();
-}
-
-function startProfiling()
+function pageFunction()
 {
-    console.profile("outer1");
-    console.profile("inner1");  // [Chromium] Make sure we capture the current callstack.
-    // workaround for http://crbug.com/164304
-    setTimeout(doWork, 100);
+    console.profile("outer");
+    console.profile("inner");  // [Chromium] Make sure we capture the current callstack.
+    console.profileEnd("outer");
+    console.profileEnd("inner");
 }
 
-function doWork() {
-    functionA();
-    console.profileEnd("outer1");
-    console.profileEnd("inner1");
+function startTest()
+{
+    pageFunction();
     printResult();
     if (window.testRunner)
-         testRunner.notifyDone();
+        testRunner.notifyDone();
 }
 
-function startTest()
-{
-    startProfiling();
-}
-
 function printResult()
 {
+    var preElement = document.createElement("pre");
+    preElement.appendChild(document.createTextNode("\n"));
+
     var profiles = console.profiles;
     for (var i = 0; i < profiles.length; ++i) {
         var profile = ""
-        if (profile.title !== "inner1")
+        if (profile.title !== "inner")
             continue;
-        dumpNode(profile.head)
+        var functionName = "pageFunction";
+        if (findFunctionInProfile(profile.head, functionName))
+            preElement.appendChild(document.createTextNode("Found " + functionName));
+        else {
+            preElement.appendChild(document.createTextNode("!!! Not found " + functionName));
+            preElement.appendChild(document.createTextNode("\n\n"));
+            printProfileNodeWithoutTime(preElement, profile.head, "");
+        }
+        preElement.appendChild(document.createTextNode("\n"));
     }
+
+    document.getElementById("output").appendChild(preElement);
 }
 
-var functionsWhiteList = {
-    "sleep": 1,
-    "functionA": 1,
-    "functionB": 1,
-    "doWork": 1
-};
-
-function dumpNode(node, prefix)
+function printProfileNodeWithoutTime(preElement, node, space)
 {
     if (!node.visible)
         return;
-    prefix = prefix || "";
-    
-    const roundingThreshold = 100; // Time should be good within 100ms
-    var time = Math.round(node.totalTime / roundingThreshold) * roundingThreshold;
-    if (time && functionsWhiteList[node.functionName])
-        output(prefix + node.functionName + " (line " + node.lineNumber + "): ~" + time +"ms");
 
+    var line = space + node.functionName + " (line " + node.lineNumber + ")\n";
+    preElement.appendChild(document.createTextNode(line));
+
     var children = node.children();
     for (var i = 0; i < children.length; ++i)
-        dumpNode(children[i], prefix + "    ");
+        printProfileNodeWithoutTime(preElement, children[i], space + "   ");
 }
-</script>
 
+function findFunctionInProfile(node, functionName)
+{
+    if (node.functionName === functionName)
+        return true;
+    var children = node.children();
+    for (var i = 0; i < children.length; ++i)
+        if (findFunctionInProfile(children[i], functionName))
+            return true;
+    return false;
+}
+
+</script>
 </head>
 <body _onload_="startTest()">
 <p>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to