Add a graphics benchmark
[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 Suites = [];
42
43 Suites.push({
44     name: "HTML Bouncing Particles",
45     prepare: function(runner, contentWindow, contentDocument)
46     {
47         return runner.waitForElement("#stage").then(function (element) {
48             return element;
49         });
50     },
51     
52     run: function(contentWindow, test, options, recordTable, progressBar)
53     {
54         return contentWindow.runBenchmark(this, test, options, recordTable, progressBar);
55     },
56
57     titles: Titles,
58     tests: [
59         { 
60             url: "../tests/bouncing-particles/bouncing-css-shapes.html?gain=1&addLimit=100&removeLimit=5&particleWidth=12&particleHeight=12&shape=circle",
61             name: "CSS bouncing circles"
62         },
63         { 
64             url: "../tests/bouncing-particles/bouncing-css-shapes.html?gain=1&addLimit=100&removeLimit=5&particleWidth=40&particleHeight=40&shape=rect&clip=star",
65             name: "CSS bouncing clipped rects"
66         },
67         { 
68             url: "../tests/bouncing-particles/bouncing-css-shapes.html?gain=1&addLimit=100&removeLimit=5&particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
69             name: "CSS bouncing gradient circles"
70         },
71         {
72             url: "../tests/bouncing-particles/bouncing-css-images.html?gain=0.4&addLimit=5&removeLimit=2&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
73             name: "CSS bouncing SVG images"
74         },
75         {
76             url: "../tests/bouncing-particles/bouncing-css-images.html?gain=1&addLimit=100&removeLimit=5&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
77             name: "CSS bouncing PNG images"
78         },
79         {
80             url: "../tests/text/layering-text.html?gain=4&addLimit=100&removeLimit=100",
81             name: "CSS layering text"
82         },
83     ]
84 });
85
86 Suites.push({
87     name: "Canvas Bouncing Particles",
88     prepare: function(runner, contentWindow, contentDocument)
89     {
90         return runner.waitForElement("#stage").then(function (element) {
91             return element;
92         });
93     },  
94     
95     run: function(contentWindow, test, options, recordTable, progressBar)
96     {
97         return contentWindow.runBenchmark(this, test, options, recordTable, progressBar);
98     },
99     
100     titles: Titles,
101     tests: [
102         { 
103             url: "../tests/bouncing-particles/bouncing-canvas-shapes.html?gain=4&addLimit=100&removeLimit=1000&particleWidth=12&particleHeight=12&shape=circle",
104             name: "canvas bouncing circles"
105         },
106         { 
107             url: "../tests/bouncing-particles/bouncing-canvas-shapes.html?gain=4&addLimit=100&removeLimit=1000&particleWidth=40&particleHeight=40&shape=rect&clip=star",
108             name: "canvas bouncing clipped rects"
109         },
110         { 
111             url: "../tests/bouncing-particles/bouncing-canvas-shapes.html?gain=4&addLimit=100&removeLimit=1000&particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
112             name: "canvas bouncing gradient circles"
113         },
114         { 
115             url: "../tests/bouncing-particles/bouncing-canvas-images.html?gain=0.4&addLimit=5&removeLimit=1&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
116             name: "canvas bouncing SVG images"
117         },
118         {
119             url: "../tests/bouncing-particles/bouncing-canvas-images.html?gain=4&addLimit=1000&removeLimit=1000&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
120             name: "canvas bouncing PNG images"
121         },
122     ]
123 });
124
125 Suites.push({
126     name: "SVG Bouncing Particles",
127     prepare: function(runner, contentWindow, contentDocument)
128     {
129         return runner.waitForElement("#stage").then(function (element) {
130             return element;
131         });
132     },
133     
134     run: function(contentWindow, test, options, recordTable, progressBar)
135     {
136         return contentWindow.runBenchmark(this, test, options, recordTable, progressBar);
137     },
138     
139     titles: Titles,
140     tests: [
141         {
142             url: "../tests/bouncing-particles/bouncing-svg-shapes.html?gain=6&addLimit=100&removeLimit=1000&particleWidth=12&particleHeight=12&shape=circle",
143             name: "SVG bouncing circles",
144         },
145         {
146             url: "../tests/bouncing-particles/bouncing-svg-shapes.html?gain=0.6&addLimit=10&removeLimit=1&particleWidth=40&particleHeight=40&shape=rect&clip=star",
147             name: "SVG bouncing clipped rects",
148         },
149         {
150             url: "../tests/bouncing-particles/bouncing-svg-shapes.html?gain=0.8&addLimit=10&removeLimit=4&particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
151             name: "SVG bouncing gradient circles"
152         },
153         {
154             url: "../tests/bouncing-particles/bouncing-svg-images.html?gain=0.4&addLimit=5&removeLimit=2&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
155             name: "SVG bouncing SVG images"
156         },
157         {
158             url: "../tests/bouncing-particles/bouncing-svg-images.html?gain=4&addLimit=100&removeLimit=5&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
159             name: "SVG bouncing PNG images"
160         },
161     ]
162 });
163
164 Suites.push({
165     name: "More complex examples",
166     prepare: function(runner, contentWindow, contentDocument)
167     {
168         return runner.waitForElement("#stage").then(function (element) {
169             return element;
170         });
171     },
172     
173     run: function(contentWindow, test, options, recordTable, progressBar)
174     {
175         return contentWindow.runBenchmark(this, test, options, recordTable, progressBar);
176     },
177     
178     titles: Titles,
179     tests: [
180         {
181             url: "../tests/examples/canvas-electrons.html?gain=1&addLimit=100&removeLimit=10",
182             name: "canvas electrons"
183         },
184         {
185             url: "../tests/examples/canvas-stars.html?gain=4&addLimit=100&removeLimit=5",
186             name: "canvas stars"
187         },
188     ]
189 });
190
191 Suites.push({
192     name: "Stage Templates (Can be used for new tests)",
193     prepare: function(runner, contentWindow, contentDocument)
194     {
195         return runner.waitForElement("#stage").then(function (element) {
196             return element;
197         });
198     },
199     
200     run: function(contentWindow, test, options, recordTable, progressBar)
201     {
202         return contentWindow.runBenchmark(this, test, options, recordTable, progressBar);
203     },
204     
205     titles: Titles,
206     tests: [
207         {
208             url: "../tests/template/template-css.html?gain=1&addLimit=100&removeLimit=5",
209             name: "CSS template"
210         },
211         {
212             url: "../tests/template/template-canvas.html?gain=1&addLimit=100&removeLimit=1000",
213             name: "canvas template"
214         },
215         {
216             url: "../tests/template/template-svg.html?gain=1&addLimit=100&removeLimit=5&<other_paramter>=<value>",
217             name: "SVG template"
218         },
219     ]
220 });
221
222 function suiteFromName(name)
223 {
224     return Suites.find(function(suite) { return suite.name == name; });
225 }
226
227 function testFromName(suite, name)
228 {
229     return suite.tests.find(function(test) { return test.name == name; });
230 }