Add a basic compositing Animometer test
[WebKit-https.git] / PerformanceTests / Animometer / runner / resources / tests.js
1 var Headers = [
2     {
3         text: Strings.text.testName,
4         width: 27,
5         children: []
6     },
7     {
8         text: Strings.text.score,
9         width: 7,
10         children: []
11     },
12     {
13         text: Strings.text.experiments.complexity,
14         width: 27,
15         children:
16         [
17             { text: Strings.text.measurements.average, width: 7, children: [] },
18             { text: Strings.text.measurements.concern, width: 7, children: [] },
19             { text: Strings.text.measurements.stdev, width: 7, children: [] },
20             { text: Strings.text.measurements.percent, width: 6, children: [] },
21         ]
22     },
23     {
24         text: Strings.text.experiments.frameRate,
25         width: 24,
26         children:
27         [
28             { text: Strings.text.measurements.average, width: 6, children: [] },
29             { text: Strings.text.measurements.concern, width: 6, children: [] },
30             { text: Strings.text.measurements.stdev, width: 6, children: [] },
31             { text: Strings.text.measurements.percent, width: 6, children: [] },
32         ]
33     },
34     {
35         text: Strings.text.samples,
36         width: 15,
37         children:
38         [
39             { text: Strings.text.results.graph, width: 8, children: [] },
40             { text: Strings.text.results.json, 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?particleWidth=12&particleHeight=12&shape=circle",
66             name: "CSS bouncing circles"
67         },
68         { 
69             url: "bouncing-particles/bouncing-css-shapes.html?particleWidth=40&particleHeight=40&shape=rect&clip=star",
70             name: "CSS bouncing clipped rects"
71         },
72         { 
73             url: "bouncing-particles/bouncing-css-shapes.html?particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
74             name: "CSS bouncing gradient circles"
75         },
76         {
77             url: "bouncing-particles/bouncing-css-images.html?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?particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
82             name: "CSS bouncing PNG images"
83         },
84         {
85             url: "text/layering-text.html",
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?particleWidth=12&particleHeight=12&shape=circle",
95             name: "canvas bouncing circles"
96         },
97         { 
98             url: "bouncing-particles/bouncing-canvas-shapes.html?particleWidth=40&particleHeight=40&shape=rect&clip=star",
99             name: "canvas bouncing clipped rects"
100         },
101         { 
102             url: "bouncing-particles/bouncing-canvas-shapes.html?particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
103             name: "canvas bouncing gradient circles"
104         },
105         { 
106             url: "bouncing-particles/bouncing-canvas-images.html?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?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?particleWidth=12&particleHeight=12&shape=circle",
120             name: "SVG bouncing circles",
121         },
122         {
123             url: "bouncing-particles/bouncing-svg-shapes.html?particleWidth=40&particleHeight=40&shape=rect&clip=star",
124             name: "SVG bouncing clipped rects",
125         },
126         {
127             url: "bouncing-particles/bouncing-svg-shapes.html?particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
128             name: "SVG bouncing gradient circles"
129         },
130         {
131             url: "bouncing-particles/bouncing-svg-images.html?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?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",
230             name: "canvas electrons"
231         },
232         {
233             url: "examples/canvas-stars.html",
234             name: "canvas stars"
235         },
236     ]
237 ));
238
239 Suites.push(new Suite("Miscellaneous Tests",
240     [
241         {
242             url: "misc/compositing-transforms.html?particleWidth=50&particleHeight=50&filters=yes&imageSrc=../resources/yin-yang.svg",
243             name: "Composited Transforms"
244         },
245     ]
246 ));
247
248 function suiteFromName(name)
249 {
250     return Suites.find(function(suite) { return suite.name == name; });
251 }
252
253 function testFromName(suite, name)
254 {
255     return suite.tests.find(function(test) { return test.name == name; });
256 }