Add BenchmarkRunner patches with WebDriver support for each testing plan
[WebKit.git] / Tools / Scripts / webkitpy / benchmark_runner / data / patches / webdriver / ARES-6.patch
1 diff --git a/driver.js b/driver.js
2 index 26394093758..f6496f970ee 100644
3 --- a/driver.js
4 +++ b/driver.js
5 @@ -136,6 +136,18 @@ class Driver {
6          this._benchmark = this._iterator ? this._iterator.next().value : null;
7          if (!this._benchmark) {
8              if (!this._numIterations) {
9 +
10 +                let tests = {};
11 +                for (let [benchmark, results] of this._benchmarks) {
12 +                    let subtests = {};
13 +                    for (let subResultName of Results.subResults)
14 +                        subtests[subResultName] = {"metrics": {"Time": {"current": results[subResultName]._data}}};
15 +                    tests[benchmark.name] = {"metrics": {"Time" : ["Geometric"]}, "tests": subtests};
16 +                }
17 +
18 +                let content = JSON.stringify({"ARES-6": {"metrics" : {"Time" : ["Geometric"]}, "tests" : tests}});
19 +                window.webdriver_results = content;
20 +
21                  if (isInBrowser) {
22                      this._statusCell.innerHTML =
23                          (this._hadErrors ? "Failures encountered!" : "Restart");
24 diff --git a/index.html b/index.html
25 index 230657bac24..fb740f7f06d 100644
26 --- a/index.html
27 +++ b/index.html
28 @@ -11,6 +11,8 @@
29          document.getElementById("error").innerHTML = "ERROR: " + url + ":" + lineNumber + ": " + message;
30      }
31
32 +    window.onload = () => { setTimeout(() => driver.start(8), 3000); }
33 +
34      const isInBrowser = true;
35      </script>
36      <script src="driver.js"></script>