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 a530a11d0ebe931336e7cfce36fac90e70839c86..04ff844d28bffe3a21d92b86b1e78ed7d8f4a84f 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 ac472096b88ecbc783b26f86c54ce81581e5ea50..396b783455a9e8aa5dccc2148512ce4dd9ffce1a 100644 (file)
@@ -1,3 +1,35 @@
+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
index fbad29f0d3c9ebcb05c5e5d434015a43a6b7fb59..7bb96a37a8e5de43d638526689f3f2beb0df5fc8 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 a8dbbaabf6fe4ca2d05ba177d35baca7594a7203..4aef2b57f394feb8d30120397e24372ec17096a3 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 31f3e0428ae3f1191ed5442f7ceaa033cc1f170b..13e3d44feae5861f50e2ed031f1083f5a3d6db96 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 960cf695edb5f1b603274b50c87a546e0d17164d..a46c14caed381d5f2c4792058fb0f744835c0134 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 5db09e8e64032a8b99447da3d74fb6c7d883ea7f..1709963be8fd09ed82def1618b1b364c1f39f578 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 d2705600173f13e4f0e4adedb040e35d1c1227be..ffd71c5fa768b04192ee20cce634b92617bd248c 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 5b5e08978508b4c6f0a584200b16b9097086649f..daca4e136c1ffd3d9864fab7d39ee10f8e151008 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 7d18b9beec956dc34ac3c6a3a37298ba4d4757f7..ca6c65588c72268e5dcd57ae76cea7c3db02a7ea 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 82fbfc9da68e58069c320d021b32024fc8143c04..a89b3c960a5dff8b7eac2e4988a9d96f4e73325c 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 8241cccf2caa02618eda83cc9b1f2443c0385fd6..602586f665aa0746e8f8fbdd7f32f606f81b9c9f 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 5743a06ee5b84958ce33d43e749c825be6dddf40..89a806a048d839685584827b0046db8994aee316 100644 (file)
@@ -11,6 +11,5 @@ $(document).ready(function() {
 </script>
 </head>
 <body>
-<pre id="console"></pre>
 </body>
 </html>
index d6b833d52956d68be51b60019723808572ec872e..136093e8df45527329db6582bc6f440d0675a2bd 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 a016ffaac13b6b154055af025b18ee01bff1103f..6c1c06257e8cc3f2acccfe451110c190f39769fe 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 78962ec536f87c3c9c2e07307fc966c3c098e937..d84d0f497490b12f6a04681a4e974c33f3659800 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 7dbf9923869dcd9c9dcbc0454e8fc81c3a068f57..689527e4871cfbf6877768b37614d10df9f7312c 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 4abdec65c213bd34428fc41beb56f6691857d4d9..07f0d92f2efa16f53b31e04f093be6de093acfd4 100644 (file)
@@ -1,6 +1,5 @@
 <!DOCTYPE html>
 <body>
-<pre id="log"></pre>
 <script src="../resources/runner.js"></script>
 <script>
 PerfTestRunner.run(function() {
index 0483d672678f05e2e66e03094330234c8640f726..00b51e7aad49e4c5b5a7d6b2ab118a6ae1dae0d6 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 91c7b85dda4d9fa43d6dfd6928d5b45108c14c5c..b29eb84d7a2e8d52aa2652ab825a60facdace549 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 18503aeca90849dc201b4eb9db8791a5b6a503f5..dd8a0048f49507f35d61c92b9778dd5ca1f4853d 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 () {