Add new benchmark tests.
[WebKit-https.git] / PerformanceTests / Animometer / resources / runner / benchmark-runner.js
index 21bc008..a2ac7b2 100644 (file)
@@ -94,10 +94,11 @@ BenchmarkRunner = Utilities.createClass(
         Utilities.extendObject(options, contentWindow.Utilities.parseParameters());
 
         var benchmark = new contentWindow.benchmarkClass(options);
+        document.body.style.backgroundColor = benchmark.backgroundColor();
         benchmark.run().then(function(results) {
-            var samplers = self._suitesSamplers[suite.name] || {};
-            samplers[test.name] = results;
-            self._suitesSamplers[suite.name] = samplers;
+            var suiteResults = self._suitesResults[suite.name] || {};
+            suiteResults[test.name] = results;
+            self._suitesResults[suite.name] = suiteResults;
 
             if (self._client && self._client.didRunTest)
                 self._client.didRunTest(suite, test);
@@ -115,7 +116,7 @@ BenchmarkRunner = Utilities.createClass(
     {
         if (!state) {
             state = new BenchmarkRunnerState(this._suites);
-            this._suitesSamplers = {};
+            this._suitesResults = {};
         }
 
         var suite = state.currentSuite();
@@ -153,8 +154,10 @@ BenchmarkRunner = Utilities.createClass(
             currentIteration++;
             if (currentIteration < self._client.iterationCount)
                 self.runAllSteps();
-            else if (this._client && this._client.didFinishLastIteration)
+            else if (this._client && this._client.didFinishLastIteration) {
+                document.body.style.backgroundColor = "";
                 self._client.didFinishLastIteration();
+            }
         }
 
         if (this._client && this._client.willStartFirstIteration)
@@ -168,7 +171,7 @@ BenchmarkRunner = Utilities.createClass(
         this._removeFrame();
 
         if (this._client && this._client.didRunSuites)
-            this._client.didRunSuites(this._suitesSamplers);
+            this._client.didRunSuites(this._suitesResults);
 
         if (this._runNextIteration)
             this._runNextIteration();