From 6d45c588698370f5bd0c424d18388a960ebb7a48 Mon Sep 17 00:00:00 2001 From: "tony@chromium.org" Date: Mon, 14 May 2012 19:28:47 +0000 Subject: [PATCH] Don't append log lines while perf tests are running. https://bugs.webkit.org/show_bug.cgi?id=86028 Reviewed by Ryosuke Niwa. In some tests, the extra DOM nodes can cause the test timing to change. Avoid adding DOM nodes until the test is over. When running in a browser, we append nodes as we run so the user can have some feedback. * resources/runner.js: (PerfTestRunner.log): Store the log lines in an array until the test is finished. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116984 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- PerformanceTests/ChangeLog | 14 ++++++++++++++ PerformanceTests/resources/runner.js | 11 +++++++++++ 2 files changed, 25 insertions(+) diff --git a/PerformanceTests/ChangeLog b/PerformanceTests/ChangeLog index 8d8809b..1ccdbfa 100644 --- a/PerformanceTests/ChangeLog +++ b/PerformanceTests/ChangeLog @@ -1,3 +1,17 @@ +2012-05-14 Tony Chang + + Don't append log lines while perf tests are running. + https://bugs.webkit.org/show_bug.cgi?id=86028 + + Reviewed by Ryosuke Niwa. + + In some tests, the extra DOM nodes can cause the test timing to change. + Avoid adding DOM nodes until the test is over. When running in a browser, + we append nodes as we run so the user can have some feedback. + + * resources/runner.js: + (PerfTestRunner.log): Store the log lines in an array until the test is finished. + 2012-05-14 Ryosuke Niwa Build fix. Don't adjust calls per iteration in the second run. diff --git a/PerformanceTests/resources/runner.js b/PerformanceTests/resources/runner.js index 65ac5cc..cfc9b16 100644 --- a/PerformanceTests/resources/runner.js +++ b/PerformanceTests/resources/runner.js @@ -24,6 +24,10 @@ PerfTestRunner.random = Math.random = function() { }; PerfTestRunner.log = function (text) { + if (this._logLines) { + this._logLines.push(text); + return; + } if (!document.getElementById("log")) { var pre = document.createElement('pre'); pre.id = 'log'; @@ -118,6 +122,12 @@ PerfTestRunner._runLoop = function () { window.setTimeout(function () { PerfTestRunner._runner(); }, 0); } else { this.logStatistics(this._results); + if (this._logLines) { + var logLines = this._logLines; + this._logLines = null; + var self = this; + logLines.forEach(function(text) { self.log(text); }); + } this._doneFunction(); if (window.layoutTestController) layoutTestController.notifyDone(); @@ -160,6 +170,7 @@ PerfTestRunner.initAndStartLoop = function() { this._completedRuns = -1; this.customRunFunction = null; this._results = []; + this._logLines = window.layoutTestController ? [] : null; this.log("Running " + this._runCount + " times"); this._runLoop(); } -- 2.7.4