PerfTestRunner should automatically create pre#log
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 21:35:51 +0000 (21:35 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 21:35:51 +0000 (21:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77469

Reviewed by Tony Chang.

Automatically generate <pre id="log"></pre> if there isn't one.

* Bindings/event-target-wrapper.html:
* DOM/Accessors.html:
* DOM/CloneNodes.html:
* DOM/CreateNodes.html:
* DOM/DOMDivWalk.html:
* DOM/DOMTable.html:
* DOM/DOMWalk.html:
* DOM/Events.html:
* DOM/GetElement.html:
* DOM/GridSort.html:
* DOM/Template.html:
* Dromaeo/dom-query.html:
* Dromaeo/resources/dromaeorunner.js:
* Parser/html-parser.html:
* Parser/html5-full-render.html:
* Parser/simple-url.html:
* Parser/tiny-innerHTML.html:
* Parser/url-parser.html:
* Parser/xml-parser.html:
* resources/runner.js:
(PerfTestRunner.log):
(PerfTestRunner.printStatistics):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106386 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
PerformanceTests/Bindings/event-target-wrapper.html
PerformanceTests/ChangeLog
PerformanceTests/DOM/Accessors.html
PerformanceTests/DOM/CloneNodes.html
PerformanceTests/DOM/CreateNodes.html
PerformanceTests/DOM/DOMDivWalk.html
PerformanceTests/DOM/DOMTable.html
PerformanceTests/DOM/DOMWalk.html
PerformanceTests/DOM/Events.html
PerformanceTests/DOM/GetElement.html
PerformanceTests/DOM/GridSort.html
PerformanceTests/DOM/Template.html
PerformanceTests/Dromaeo/dom-query.html
PerformanceTests/Dromaeo/resources/dromaeorunner.js
PerformanceTests/Parser/html-parser.html
PerformanceTests/Parser/html5-full-render.html
PerformanceTests/Parser/simple-url.html
PerformanceTests/Parser/tiny-innerHTML.html
PerformanceTests/Parser/url-parser.html
PerformanceTests/Parser/xml-parser.html
PerformanceTests/resources/runner.js

index a530a11..04ff844 100644 (file)
@@ -1,6 +1,5 @@
 <!DOCTYPE html>
 <body>
-<pre id="log"></pre>
 <script src="../resources/runner.js"></script>
 <a href="#">Click here to start</a>
 <script>
index ac47209..396b783 100644 (file)
@@ -1,5 +1,37 @@
 2012-01-31  Ryosuke Niwa  <rniwa@webkit.org>
 
+        PerfTestRunner should automatically create pre#log
+        https://bugs.webkit.org/show_bug.cgi?id=77469
+
+        Reviewed by Tony Chang.
+
+        Automatically generate <pre id="log"></pre> if there isn't one.
+
+        * Bindings/event-target-wrapper.html:
+        * DOM/Accessors.html:
+        * DOM/CloneNodes.html:
+        * DOM/CreateNodes.html:
+        * DOM/DOMDivWalk.html:
+        * DOM/DOMTable.html:
+        * DOM/DOMWalk.html:
+        * DOM/Events.html:
+        * DOM/GetElement.html:
+        * DOM/GridSort.html:
+        * DOM/Template.html:
+        * Dromaeo/dom-query.html:
+        * Dromaeo/resources/dromaeorunner.js:
+        * Parser/html-parser.html:
+        * Parser/html5-full-render.html:
+        * Parser/simple-url.html:
+        * Parser/tiny-innerHTML.html:
+        * Parser/url-parser.html:
+        * Parser/xml-parser.html:
+        * resources/runner.js:
+        (PerfTestRunner.log):
+        (PerfTestRunner.printStatistics):
+
+2012-01-31  Ryosuke Niwa  <rniwa@webkit.org>
+
         runner.js in performance tests should define a class
         https://bugs.webkit.org/show_bug.cgi?id=77074
 
index fbad29f..7bb96a3 100644 (file)
@@ -2,7 +2,6 @@
 <html>
 <body>
 <div id="container"><span id="benchmark_content"></span></div>
-<pre id="log"></pre>
 <script type="text/javascript" src="../resources/runner.js"></script>
 <script type="text/javascript" src="resources/dom-perf.js"></script>
 <script type="text/javascript" src="resources/dom-perf/accessors.js"></script>
index a8dbbaa..4aef2b5 100644 (file)
@@ -2,7 +2,6 @@
 <html>
 <body>
 <div id="container"><span id="benchmark_content"></span></div>
-<pre id="log"></pre>
 <script type="text/javascript" src="../resources/runner.js"></script>
 <script type="text/javascript" src="resources/dom-perf.js"></script>
 <script type="text/javascript" src="resources/dom-perf/clonenodes.js"></script>
index 31f3e04..13e3d44 100644 (file)
@@ -2,7 +2,6 @@
 <html>
 <body>
 <div id="container"><span id="benchmark_content"></span></div>
-<pre id="log"></pre>
 <script type="text/javascript" src="../resources/runner.js"></script>
 <script type="text/javascript" src="resources/dom-perf.js"></script>
 <script type="text/javascript" src="resources/dom-perf/createnodes.js"></script>
index 960cf69..a46c14c 100644 (file)
@@ -2,7 +2,6 @@
 <html>
 <body>
 <div id="container"><span id="benchmark_content"></span></div>
-<pre id="log"></pre>
 <script type="text/javascript" src="../resources/runner.js"></script>
 <script type="text/javascript" src="resources/dom-perf.js"></script>
 <script type="text/javascript" src="resources/dom-perf/domdivwalk.js"></script>
index 5db09e8..1709963 100644 (file)
@@ -2,7 +2,6 @@
 <html>
 <body>
 <div id="container"><span id="benchmark_content"></span></div>
-<pre id="log"></pre>
 <script type="text/javascript" src="../resources/runner.js"></script>
 <script type="text/javascript" src="resources/dom-perf.js"></script>
 <script type="text/javascript" src="resources/dom-perf/domtable.js"></script>
index d270560..ffd71c5 100644 (file)
@@ -2,7 +2,6 @@
 <html>
 <body>
 <div id="container"><span id="benchmark_content"></span></div>
-<pre id="log"></pre>
 <script type="text/javascript" src="../resources/runner.js"></script>
 <script type="text/javascript" src="resources/dom-perf.js"></script>
 <script type="text/javascript" src="resources/dom-perf/domwalk.js"></script>
index 5b5e089..daca4e1 100644 (file)
@@ -2,7 +2,6 @@
 <html>
 <body>
 <div id="container"><span id="benchmark_content"></span></div>
-<pre id="log"></pre>
 <script type="text/javascript" src="../resources/runner.js"></script>
 <script type="text/javascript" src="resources/dom-perf.js"></script>
 <script type="text/javascript" src="resources/dom-perf/events.js"></script>
index 7d18b9b..ca6c655 100644 (file)
@@ -2,7 +2,6 @@
 <html>
 <body>
 <div id="container"><span id="benchmark_content"></span></div>
-<pre id="log"></pre>
 <script type="text/javascript" src="../resources/runner.js"></script>
 <script type="text/javascript" src="resources/dom-perf.js"></script>
 <script type="text/javascript" src="resources/dom-perf/getelement.js"></script>
index 82fbfc9..a89b3c9 100644 (file)
@@ -2,7 +2,6 @@
 <html>
 <body>
 <div id="container"><span id="benchmark_content"></span></div>
-<pre id="log"></pre>
 <script type="text/javascript" src="../resources/runner.js"></script>
 <script type="text/javascript" src="resources/dom-perf.js"></script>
 <script type="text/javascript" src="resources/dom-perf/gridsort.js"></script>
index 8241ccc..602586f 100644 (file)
@@ -2,7 +2,6 @@
 <html>
 <body>
 <div id="container"><span id="benchmark_content"></span></div>
-<pre id="log"></pre>
 <script type="text/javascript" src="../resources/runner.js"></script>
 <script type="text/javascript" src="resources/dom-perf.js"></script>
 <script type="text/javascript" src="resources/dom-perf/template.js"></script>
index 5743a06..89a806a 100644 (file)
@@ -11,6 +11,5 @@ $(document).ready(function() {
 </script>
 </head>
 <body>
-<pre id="console"></pre>
 </body>
 </html>
index d6b833d..136093e 100644 (file)
@@ -61,7 +61,7 @@
 
          teardown: function(data) {
              var scores = DRT.computeScores(data.result);
-             PerfTestRunner.printStatistics(scores, DRT.log);
+             PerfTestRunner.printStatistics(scores);
              window.setTimeout(function() {
                  if (window.layoutTestController)
                      layoutTestController.notifyDone();
@@ -75,7 +75,7 @@
          },
 
          log: function(text) {
-             document.getElementById("console").innerHTML += (text + "\n");
+             PerfTestRunner.log(text);
          }
      };
 
index a016ffa..6c1c062 100644 (file)
@@ -1,6 +1,5 @@
 <!DOCTYPE html>
 <body>
-<pre id="log"></pre>
 <script src="../resources/runner.js"></script>
 <script>
 var spec = PerfTestRunner.loadFile("resources/html5.html");
@@ -15,5 +14,6 @@ PerfTestRunner.run(function() {
     iframe.contentDocument.close();
     document.body.removeChild(iframe);
 }, 1);
+
 </script>
 </body>
index 78962ec..d84d0f4 100644 (file)
@@ -1,6 +1,5 @@
 <!DOCTYPE html>
 <body>
-<pre id="log"></pre>
 <script src="../resources/runner.js"></script>
 <script>
 var spec = loadFile("resources/html5.html");
index 7dbf992..689527e 100644 (file)
@@ -1,6 +1,5 @@
 <!DOCTYPE html>
 <body>
-<pre id="log"></pre>
 <script src="../resources/runner.js"></script>
 <script>
 var anchor = document.createElement("a");
index 4abdec6..07f0d92 100644 (file)
@@ -1,6 +1,5 @@
 <!DOCTYPE html>
 <body>
-<pre id="log"></pre>
 <script src="../resources/runner.js"></script>
 <script>
 PerfTestRunner.run(function() {
index 0483d67..00b51e7 100644 (file)
@@ -1,6 +1,5 @@
 <!DOCTYPE html>
 <body>
-<pre id="log"></pre>
 <script src="../resources/runner.js"></script>
 <script>
 var urls = PerfTestRunner.loadFile("resources/final-url-en").split("\n");
index 91c7b85..b29eb84 100644 (file)
@@ -1,6 +1,5 @@
 <!DOCTYPE html>
 <body>
-<pre id="log"></pre>
 <script src="../resources/runner.js"></script>
 <script>
 var domParser = new DOMParser();
index 18503ae..dd8a004 100644 (file)
@@ -2,6 +2,11 @@
 var PerfTestRunner = {};
 
 PerfTestRunner.log = function (text) {
+    if (!document.getElementById("log")) {
+        var pre = document.createElement('pre');
+        pre.id = 'log';
+        document.body.appendChild(pre);
+    }
     document.getElementById("log").innerHTML += text + "\n";
     window.scrollTo(0, document.body.height);
 }
@@ -52,16 +57,16 @@ PerfTestRunner.computeStatistics = function (times) {
 PerfTestRunner.logStatistics = function (times) {
     this.log("");
     var statistics = this.computeStatistics(times);
-    this.printStatistics(statistics, this.log);
+    this.printStatistics(statistics);
 }
 
-PerfTestRunner.printStatistics = function (statistics, printFunction) {
-    printFunction("");
-    printFunction("avg " + statistics.mean);
-    printFunction("median " + statistics.median);
-    printFunction("stdev " + statistics.stdev);
-    printFunction("min " + statistics.min);
-    printFunction("max " + statistics.max);
+PerfTestRunner.printStatistics = function (statistics) {
+    this.log("");
+    this.log("avg " + statistics.mean);
+    this.log("median " + statistics.median);
+    this.log("stdev " + statistics.stdev);
+    this.log("min " + statistics.min);
+    this.log("max " + statistics.max);
 }
 
 PerfTestRunner.gc = function () {