Split benchmark into two different pages
[WebKit-https.git] / PerformanceTests / Animometer / resources / runner / tests.js
1 var Headers = {
2     testName: [{ title: Strings.text.testName }],
3     score: [{ title: Strings.text.score, text: Strings.json.score }]
4 };
5
6 var Suite = function(name, tests) {
7     this.name = name;
8     this.tests = tests;
9 };
10 Suite.prototype.prepare = function(runner, contentWindow, contentDocument)
11 {
12     return runner.waitForElement("#stage").then(function (element) {
13         return element;
14     });
15 };
16 Suite.prototype.run = function(contentWindow, test, options, progressBar)
17 {
18     return contentWindow.runBenchmark(this, test, options, progressBar);
19 };
20
21 var Suites = [];
22
23 Suites.push(new Suite("Animometer",
24     [
25         {
26             url: "master/canvas-stage.html?pathType=arcs",
27             name: "Canvas arcs"
28         },
29         {
30             url: "master/canvas-stage.html?pathType=linePath&lineJoin=round&lineCap=round",
31             name: "Canvas line path, round join"
32         },
33         {
34             url: "master/canvas-stage.html?pathType=line&lineCap=square",
35             name: "Canvas line segments"
36         },
37     ]
38 ));
39
40 function suiteFromName(name)
41 {
42     return Suites.find(function(suite) { return suite.name == name; });
43 }
44
45 function testFromName(suite, name)
46 {
47     return suite.tests.find(function(test) { return test.name == name; });
48 }