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