Add an option to output the results of the graphics benchmark in JSON format
[WebKit-https.git] / PerformanceTests / Animometer / runner / resources / tests.js
1 var Headers = [
2     {
3         text: Strings["TEXT_TESTNAME"][0],
4         width: 27,
5         children: []
6     },
7     {
8         text: Strings["TEXT_SCORE"][0],
9         width: 7,
10         children: []
11     },
12     {
13         text: Strings["TEXT_EXPERIMENTS"][0],
14         width: 27,
15         children:
16         [
17             { text: Strings["TEXT_MEASUREMENTS"][0], width: 7, children: [] },
18             { text: Strings["TEXT_MEASUREMENTS"][1], width: 7, children: [] },
19             { text: Strings["TEXT_MEASUREMENTS"][2], width: 7, children: [] },
20             { text: Strings["TEXT_MEASUREMENTS"][3], width: 6, children: [] },
21         ]
22     },
23     {
24         text: Strings["TEXT_EXPERIMENTS"][1],
25         width: 24,
26         children:
27         [
28             { text: Strings["TEXT_MEASUREMENTS"][0], width: 6, children: [] },
29             { text: Strings["TEXT_MEASUREMENTS"][1], width: 6, children: [] },
30             { text: Strings["TEXT_MEASUREMENTS"][2], width: 6, children: [] },
31             { text: Strings["TEXT_MEASUREMENTS"][3], width: 6, children: [] },
32         ]
33     },
34     {
35         text: Strings["TEXT_SAMPLES"][0],
36         width: 15,
37         children:
38         [
39             { text: Strings["TEXT_RESULTS"][1], width: 8, children: [] },
40             { text: Strings["TEXT_RESULTS"][2], width: 7, children: [] },
41         ]
42     }
43 ];
44
45 var Suite = function(name, tests) {
46     this.name = name;
47     this.tests = tests;
48 };
49 Suite.prototype.prepare = function(runner, contentWindow, contentDocument)
50 {
51     return runner.waitForElement("#stage").then(function (element) {
52         return element;
53     });
54 };
55 Suite.prototype.run = function(contentWindow, test, options, recordTable, progressBar)
56 {
57     return contentWindow.runBenchmark(this, test, options, recordTable, progressBar);
58 };
59
60 var Suites = [];
61
62 Suites.push(new Suite("HTML suite",
63     [
64         { 
65             url: "bouncing-particles/bouncing-css-shapes.html?gain=1&addLimit=100&removeLimit=5&particleWidth=12&particleHeight=12&shape=circle",
66             name: "CSS bouncing circles"
67         },
68         { 
69             url: "bouncing-particles/bouncing-css-shapes.html?gain=1&addLimit=100&removeLimit=5&particleWidth=40&particleHeight=40&shape=rect&clip=star",
70             name: "CSS bouncing clipped rects"
71         },
72         { 
73             url: "bouncing-particles/bouncing-css-shapes.html?gain=1&addLimit=100&removeLimit=5&particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
74             name: "CSS bouncing gradient circles"
75         },
76         {
77             url: "bouncing-particles/bouncing-css-images.html?gain=0.4&addLimit=5&removeLimit=2&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
78             name: "CSS bouncing SVG images"
79         },
80         {
81             url: "bouncing-particles/bouncing-css-images.html?gain=1&addLimit=100&removeLimit=5&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
82             name: "CSS bouncing PNG images"
83         },
84         {
85             url: "text/layering-text.html?gain=4&addLimit=100&removeLimit=100",
86             name: "CSS layering text"
87         },
88     ]
89 ));
90
91 Suites.push(new Suite("Canvas suite",
92     [
93         { 
94             url: "bouncing-particles/bouncing-canvas-shapes.html?gain=4&addLimit=100&removeLimit=1000&particleWidth=12&particleHeight=12&shape=circle",
95             name: "canvas bouncing circles"
96         },
97         { 
98             url: "bouncing-particles/bouncing-canvas-shapes.html?gain=4&addLimit=100&removeLimit=1000&particleWidth=40&particleHeight=40&shape=rect&clip=star",
99             name: "canvas bouncing clipped rects"
100         },
101         { 
102             url: "bouncing-particles/bouncing-canvas-shapes.html?gain=4&addLimit=100&removeLimit=1000&particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
103             name: "canvas bouncing gradient circles"
104         },
105         { 
106             url: "bouncing-particles/bouncing-canvas-images.html?gain=0.4&addLimit=5&removeLimit=1&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
107             name: "canvas bouncing SVG images"
108         },
109         {
110             url: "bouncing-particles/bouncing-canvas-images.html?gain=4&addLimit=1000&removeLimit=1000&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
111             name: "canvas bouncing PNG images"
112         },
113     ]
114 ));
115
116 Suites.push(new Suite("SVG suite",
117     [
118         {
119             url: "bouncing-particles/bouncing-svg-shapes.html?gain=6&addLimit=100&removeLimit=1000&particleWidth=12&particleHeight=12&shape=circle",
120             name: "SVG bouncing circles",
121         },
122         {
123             url: "bouncing-particles/bouncing-svg-shapes.html?gain=0.6&addLimit=10&removeLimit=1&particleWidth=40&particleHeight=40&shape=rect&clip=star",
124             name: "SVG bouncing clipped rects",
125         },
126         {
127             url: "bouncing-particles/bouncing-svg-shapes.html?gain=0.8&addLimit=10&removeLimit=4&particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
128             name: "SVG bouncing gradient circles"
129         },
130         {
131             url: "bouncing-particles/bouncing-svg-images.html?gain=0.4&addLimit=5&removeLimit=2&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
132             name: "SVG bouncing SVG images"
133         },
134         {
135             url: "bouncing-particles/bouncing-svg-images.html?gain=4&addLimit=100&removeLimit=5&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
136             name: "SVG bouncing PNG images"
137         },
138     ]
139 ));
140
141 Suites.push(new Suite("Basic canvas path suite",
142     [
143         {
144             url: "simple/simple-canvas-paths.html?pathType=line&lineCap=butt",
145             name: "Canvas line segments, butt caps"
146         },
147         {
148             url: "simple/simple-canvas-paths.html?pathType=line&lineCap=round",
149             name: "Canvas line segments, round caps"
150         },
151         {
152             url: "simple/simple-canvas-paths.html?pathType=line&lineCap=square",
153             name: "Canvas line segments, square caps"
154         },
155         {
156             url: "simple/simple-canvas-paths.html?pathType=linePath&lineJoin=bevel",
157             name: "Canvas line path, bevel join"
158         },
159         {
160             url: "simple/simple-canvas-paths.html?pathType=linePath&lineJoin=round",
161             name: "Canvas line path, round join"
162         },
163         {
164             url: "simple/simple-canvas-paths.html?pathType=linePath&lineJoin=miter",
165             name: "Canvas line path, miter join"
166         },
167         {
168             url: "simple/simple-canvas-paths.html?pathType=linePath&lineDash=1",
169             name: "Canvas line path with dash pattern"
170         },
171         {
172             url: "simple/simple-canvas-paths.html?pathType=quadratic",
173             name: "Canvas quadratic segments"
174         },
175         {
176             url: "simple/simple-canvas-paths.html?pathType=quadraticPath",
177             name: "Canvas quadratic path"
178         },
179         {
180             url: "simple/simple-canvas-paths.html?pathType=bezier",
181             name: "Canvas bezier segments"
182         },
183         {
184             url: "simple/simple-canvas-paths.html?pathType=bezierPath",
185             name: "Canvas bezier path"
186         },
187         {
188             url: "simple/simple-canvas-paths.html?&pathType=arcTo",
189             name: "Canvas arcTo segments"
190         },
191         {
192             url: "simple/simple-canvas-paths.html?pathType=arc",
193             name: "Canvas arc segments"
194         },
195         {
196             url: "simple/simple-canvas-paths.html?pathType=rect",
197             name: "Canvas rects"
198         },
199         {
200             url: "simple/simple-canvas-paths.html?pathType=lineFill",
201             name: "Canvas line path, fill"
202         },
203         {
204             url: "simple/simple-canvas-paths.html?pathType=quadraticFill",
205             name: "Canvas quadratic path, fill"
206         },
207         {
208             url: "simple/simple-canvas-paths.html?pathType=bezierFill",
209             name: "Canvas bezier path, fill"
210         },
211         {
212             url: "simple/simple-canvas-paths.html?&pathType=arcToFill",
213             name: "Canvas arcTo segments, fill"
214         },
215         {
216             url: "simple/simple-canvas-paths.html?pathType=arcFill",
217             name: "Canvas arc segments, fill"
218         },
219         {
220             url: "simple/simple-canvas-paths.html?pathType=rectFill",
221             name: "Canvas rects, fill"
222         }
223     ]
224 ));
225
226 Suites.push(new Suite("Complex examples",
227     [
228         {
229             url: "examples/canvas-electrons.html?gain=1&addLimit=100&removeLimit=10",
230             name: "canvas electrons"
231         },
232         {
233             url: "examples/canvas-stars.html?gain=4&addLimit=100&removeLimit=5",
234             name: "canvas stars"
235         },
236     ]
237 ));
238
239 Suites.push(new Suite("Test Templates",
240     [
241         {
242             url: "template/template-css.html?gain=1&addLimit=100&removeLimit=5",
243             name: "CSS template"
244         },
245         {
246             url: "template/template-canvas.html?gain=1&addLimit=100&removeLimit=1000",
247             name: "canvas template"
248         },
249         {
250             url: "template/template-svg.html?gain=1&addLimit=100&removeLimit=5&<other_paramter>=<value>",
251             name: "SVG template"
252         },
253     ]
254 ));
255
256 function suiteFromName(name)
257 {
258     return Suites.find(function(suite) { return suite.name == name; });
259 }
260
261 function testFromName(suite, name)
262 {
263     return suite.tests.find(function(test) { return test.name == name; });
264 }