Add basic canvas 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=quadratic",
143             name: "Canvas quadratic segments"
144         },
145         {
146             url: "simple/simple-canvas-paths.html?pathType=bezier",
147             name: "Canvas bezier segments"
148         },
149         {
150             url: "simple/simple-canvas-paths.html?&pathType=arcTo",
151             name: "Canvas arcTo segments"
152         },
153         {
154             url: "simple/simple-canvas-paths.html?pathType=arc",
155             name: "Canvas arc segments"
156         },
157         {
158             url: "simple/simple-canvas-paths.html?pathType=rect",
159             name: "Canvas rects"
160         },
161         {
162             url: "simple/simple-canvas-paths.html?&pathType=arcToFill",
163             name: "Canvas arcTo segments, fill"
164         },
165         {
166             url: "simple/simple-canvas-paths.html?pathType=arcFill",
167             name: "Canvas arc segments, fill"
168         },
169         {
170             url: "simple/simple-canvas-paths.html?pathType=rectFill",
171             name: "Canvas rects, fill"
172         }
173     ]
174 ));
175
176 Suites.push(new Suite("Complex examples",
177     [
178         {
179             url: "examples/canvas-electrons.html?gain=1&addLimit=100&removeLimit=10",
180             name: "canvas electrons"
181         },
182         {
183             url: "examples/canvas-stars.html?gain=4&addLimit=100&removeLimit=5",
184             name: "canvas stars"
185         },
186     ]
187 ));
188
189 Suites.push(new Suite("Test Templates",
190     [
191         {
192             url: "template/template-css.html?gain=1&addLimit=100&removeLimit=5",
193             name: "CSS template"
194         },
195         {
196             url: "template/template-canvas.html?gain=1&addLimit=100&removeLimit=1000",
197             name: "canvas template"
198         },
199         {
200             url: "template/template-svg.html?gain=1&addLimit=100&removeLimit=5&<other_paramter>=<value>",
201             name: "SVG template"
202         },
203     ]
204 ));
205
206 function suiteFromName(name)
207 {
208     return Suites.find(function(suite) { return suite.name == name; });
209 }
210
211 function testFromName(suite, name)
212 {
213     return suite.tests.find(function(test) { return test.name == name; });
214 }