d722af8f551566caf3c058acd38fc9d184ab9954
[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: "../tests/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: "../tests/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: "../tests/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: "../tests/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: "../tests/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: "../tests/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: "../tests/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: "../tests/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: "../tests/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: "../tests/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: "../tests/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: "../tests/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: "../tests/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: "../tests/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: "../tests/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: "../tests/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("Complex examples",
140     [
141         {
142             url: "../tests/examples/canvas-electrons.html?gain=1&addLimit=100&removeLimit=10",
143             name: "canvas electrons"
144         },
145         {
146             url: "../tests/examples/canvas-stars.html?gain=4&addLimit=100&removeLimit=5",
147             name: "canvas stars"
148         },
149     ]
150 ));
151
152 Suites.push(new Suite("Test Templates",
153     [
154         {
155             url: "../tests/template/template-css.html?gain=1&addLimit=100&removeLimit=5",
156             name: "CSS template"
157         },
158         {
159             url: "../tests/template/template-canvas.html?gain=1&addLimit=100&removeLimit=1000",
160             name: "canvas template"
161         },
162         {
163             url: "../tests/template/template-svg.html?gain=1&addLimit=100&removeLimit=5&<other_paramter>=<value>",
164             name: "SVG template"
165         },
166     ]
167 ));
168
169 function suiteFromName(name)
170 {
171     return Suites.find(function(suite) { return suite.name == name; });
172 }
173
174 function testFromName(suite, name)
175 {
176     return suite.tests.find(function(test) { return test.name == name; });
177 }