Add isolated text tests for MotionMark
[WebKit-https.git] / PerformanceTests / MotionMark / resources / debug-runner / tests.js
1 /*
2  * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 Utilities.extendObject(Strings.text, {
26     samples: "Samples",
27     complexity: "Time Complexity",
28     frameRate: "FPS",
29     confidenceInterval: "80% Confidence Interval",
30     mergedRawComplexity: "Raw Complexity",
31     graph: "Graph"
32 });
33
34
35 Utilities.extendObject(Headers, {
36     details: [
37         {
38             title: Strings.text.graph
39         },
40         {
41             title: Strings.text.confidenceInterval,
42             children:
43             [
44                 {
45                     text: function(data) {
46                         return data[Strings.json.complexity][Strings.json.bootstrap].confidenceLow.toFixed(2);
47                     },
48                     className: "right pad-left pad-right"
49                 },
50                 {
51                     text: function(data) {
52                         return " - " + data[Strings.json.complexity][Strings.json.bootstrap].confidenceHigh.toFixed(2);
53                     },
54                     className: "left"
55                 },
56                 {
57                     text: function(data) {
58                         var bootstrap = data[Strings.json.complexity][Strings.json.bootstrap];
59                         return (100 * (bootstrap.confidenceLow / bootstrap.median - 1)).toFixed(2) + "%";
60                     },
61                     className: "left pad-left small"
62                 },
63                 {
64                     text: function(data) {
65                         var bootstrap = data[Strings.json.complexity][Strings.json.bootstrap];
66                         return "+" + (100 * (bootstrap.confidenceHigh / bootstrap.median - 1)).toFixed(2) + "%";
67                     },
68                     className: "left pad-left small"
69                 }
70             ]
71         },
72         {
73             title: Strings.text.complexity,
74             children:
75             [
76                 {
77                     text: function(data) {
78                         return data[Strings.json.controller][Strings.json.measurements.average].toFixed(2);
79                     },
80                     className: "average"
81                 },
82                 {
83                     text: function(data) {
84                         return [
85                             "± ",
86                             data[Strings.json.controller][Strings.json.measurements.percent].toFixed(2),
87                             "%"
88                         ].join("");
89                     },
90                     className: function(data) {
91                         var className = "stdev";
92
93                         if (data[Strings.json.controller][Strings.json.measurements.percent] >= 10)
94                             className += " noisy-results";
95                         return className;
96                     }
97                 }
98             ]
99         },
100         {
101             title: Strings.text.frameRate,
102             children:
103             [
104                 {
105                     text: function(data) {
106                         return data[Strings.json.frameLength][Strings.json.measurements.average].toFixed(2);
107                     },
108                     className: function(data, options) {
109                         var className = "average";
110                         if (Math.abs(data[Strings.json.frameLength][Strings.json.measurements.average] - options["frame-rate"]) >= 2)
111                             className += " noisy-results";
112                         return className;
113                     }
114                 },
115                 {
116                     text: function(data) {
117                         var frameRateData = data[Strings.json.frameLength];
118                         return [
119                             "± ",
120                             frameRateData[Strings.json.measurements.percent].toFixed(2),
121                             "%"
122                         ].join("");
123                     },
124                     className: function(data) {
125                         var className = "stdev";
126
127                         if (data[Strings.json.frameLength][Strings.json.measurements.percent] >= 10)
128                             className += " noisy-results";
129                         return className;
130                     }
131                 }
132             ]
133         },
134         {
135             title: Strings.text.mergedRawComplexity,
136             children:
137             [
138                 {
139                     text: function(data) {
140                         return data[Strings.json.complexity][Strings.json.complexity].toFixed(2);
141                     },
142                     className: "average"
143                 },
144                 {
145                     text: function(data) {
146                         return [
147                             "± ",
148                             data[Strings.json.complexity][Strings.json.measurements.stdev].toFixed(2),
149                             "ms"
150                         ].join("");
151                     },
152                     className: "stdev"
153                 }
154             ]
155         }
156     ]
157 })
158
159 ///////////
160 // Suites
161
162 Suites.push(new Suite("HTML suite",
163     [
164         {
165             url: "bouncing-particles/bouncing-css-shapes.html?particleWidth=12&particleHeight=12&shape=circle",
166             name: "CSS bouncing circles"
167         },
168         {
169             url: "bouncing-particles/bouncing-css-shapes.html?particleWidth=40&particleHeight=40&shape=rect&clip=star",
170             name: "CSS bouncing clipped rects"
171         },
172         {
173             url: "bouncing-particles/bouncing-css-shapes.html?particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
174             name: "CSS bouncing gradient circles"
175         },
176         {
177             url: "bouncing-particles/bouncing-css-shapes.html?particleWidth=80&particleHeight=80&shape=circle&blend",
178             name: "CSS bouncing blend circles"
179         },
180         {
181             url: "bouncing-particles/bouncing-css-shapes.html?particleWidth=80&particleHeight=80&shape=circle&filter",
182             name: "CSS bouncing filter circles"
183         },
184         {
185             url: "bouncing-particles/bouncing-css-images.html?particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
186             name: "CSS bouncing SVG images"
187         },
188         {
189             url: "bouncing-particles/bouncing-tagged-images.html?particleWidth=100&particleHeight=100",
190             name: "CSS bouncing tagged images"
191         },
192         {
193             url: "dom/leaves.html",
194             name: "Leaves 2.0"
195         },
196         {
197             url: "dom/focus.html",
198             name: "Focus 2.0"
199         },
200         {
201             url: "dom/particles.html",
202             name: "DOM particles, SVG masks"
203         },
204         {
205             url: "dom/compositing-transforms.html?particleWidth=50&particleHeight=50&filters=yes&imageSrc=../resources/yin-yang.svg",
206             name: "Composited Transforms"
207         }
208     ]
209 ));
210
211 Suites.push(new Suite("Canvas suite",
212     [
213         {
214             url: "bouncing-particles/bouncing-canvas-shapes.html?particleWidth=40&particleHeight=40&shape=rect&clip=star",
215             name: "canvas bouncing clipped rects"
216         },
217         {
218             url: "bouncing-particles/bouncing-canvas-shapes.html?particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
219             name: "canvas bouncing gradient circles"
220         },
221         {
222             url: "bouncing-particles/bouncing-canvas-images.html?particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
223             name: "canvas bouncing SVG images"
224         },
225         {
226             url: "bouncing-particles/bouncing-canvas-images.html?particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
227             name: "canvas bouncing PNG images"
228         },
229         {
230             url: "simple/simple-canvas-paths.html?pathType=strokes",
231             name: "Stroke shapes"
232         },
233         {
234             url: "simple/simple-canvas-paths.html?pathType=fills",
235             name: "Fill shapes"
236         },
237         {
238             url: "simple/tiled-canvas-image.html",
239             name: "Canvas put/get image data"
240         },
241     ]
242 ));
243
244 Suites.push(new Suite("SVG suite",
245     [
246         {
247             url: "bouncing-particles/bouncing-svg-shapes.html?particleWidth=12&particleHeight=12&shape=circle",
248             name: "SVG bouncing circles",
249         },
250         {
251             url: "bouncing-particles/bouncing-svg-shapes.html?particleWidth=40&particleHeight=40&shape=rect&clip=star",
252             name: "SVG bouncing clipped rects",
253         },
254         {
255             url: "bouncing-particles/bouncing-svg-shapes.html?particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
256             name: "SVG bouncing gradient circles"
257         },
258         {
259             url: "bouncing-particles/bouncing-svg-images.html?particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
260             name: "SVG bouncing SVG images"
261         },
262         {
263             url: "bouncing-particles/bouncing-svg-images.html?particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
264             name: "SVG bouncing PNG images"
265         },
266     ]
267 ));
268
269 Suites.push(new Suite("Text suite",
270     [
271         {
272             url: "text/design.html?corpus=latin",
273             name: "Design: Latin only (12 items)"
274         },
275         {
276             url: "text/design.html?corpus=cjk",
277             name: "Design: CJK only (12 items)"
278         },
279         {
280             url: "text/design.html?corpus=arabic",
281             name: "Design: RTL and complex scripts only (12 items)"
282         },
283         {
284             url: "text/design-6.html?corpus=latin",
285             name: "Design: Latin only (6 items)"
286         },
287         {
288             url: "text/design-6.html?corpus=cjk",
289             name: "Design: CJK only (6 items)"
290         },
291         {
292             url: "text/design-6.html?corpus=arabic",
293             name: "Design: RTL and complex scripts only (6 items)"
294         },
295     ]
296 ));
297
298 Suites.push(new Suite("3D Graphics",
299     [
300         {
301             url: "3d/webgl.html",
302             name: "WebGL"
303         },
304     ]
305 ));
306
307 Suites.push(new Suite("Basic canvas path suite",
308     [
309         {
310             url: "simple/simple-canvas-paths.html?pathType=line&lineCap=butt",
311             name: "Canvas line segments, butt caps"
312         },
313         {
314             url: "simple/simple-canvas-paths.html?pathType=line&lineCap=round",
315             name: "Canvas line segments, round caps"
316         },
317         {
318             url: "simple/simple-canvas-paths.html?pathType=line&lineCap=square",
319             name: "Canvas line segments, square caps"
320         },
321         {
322             url: "simple/simple-canvas-paths.html?pathType=linePath&lineJoin=bevel",
323             name: "Canvas line path, bevel join"
324         },
325         {
326             url: "simple/simple-canvas-paths.html?pathType=linePath&lineJoin=round",
327             name: "Canvas line path, round join"
328         },
329         {
330             url: "simple/simple-canvas-paths.html?pathType=linePath&lineJoin=miter",
331             name: "Canvas line path, miter join"
332         },
333         {
334             url: "simple/simple-canvas-paths.html?pathType=linePath&lineDash=1",
335             name: "Canvas line path with dash pattern"
336         },
337         {
338             url: "simple/simple-canvas-paths.html?pathType=quadratic",
339             name: "Canvas quadratic segments"
340         },
341         {
342             url: "simple/simple-canvas-paths.html?pathType=quadraticPath",
343             name: "Canvas quadratic path"
344         },
345         {
346             url: "simple/simple-canvas-paths.html?pathType=bezier",
347             name: "Canvas bezier segments"
348         },
349         {
350             url: "simple/simple-canvas-paths.html?pathType=bezierPath",
351             name: "Canvas bezier path"
352         },
353         {
354             url: "simple/simple-canvas-paths.html?&pathType=arcTo",
355             name: "Canvas arcTo segments"
356         },
357         {
358             url: "simple/simple-canvas-paths.html?pathType=arc",
359             name: "Canvas arc segments"
360         },
361         {
362             url: "simple/simple-canvas-paths.html?pathType=rect",
363             name: "Canvas rects"
364         },
365         {
366             url: "simple/simple-canvas-paths.html?pathType=ellipse",
367             name: "Canvas ellipses"
368         },
369         {
370             url: "simple/simple-canvas-paths.html?pathType=lineFill",
371             name: "Canvas line path, fill"
372         },
373         {
374             url: "simple/simple-canvas-paths.html?pathType=quadraticFill",
375             name: "Canvas quadratic path, fill"
376         },
377         {
378             url: "simple/simple-canvas-paths.html?pathType=bezierFill",
379             name: "Canvas bezier path, fill"
380         },
381         {
382             url: "simple/simple-canvas-paths.html?&pathType=arcToFill",
383             name: "Canvas arcTo segments, fill"
384         },
385         {
386             url: "simple/simple-canvas-paths.html?pathType=arcFill",
387             name: "Canvas arc segments, fill"
388         },
389         {
390             url: "simple/simple-canvas-paths.html?pathType=rectFill",
391             name: "Canvas rects, fill"
392         },
393         {
394             url: "simple/simple-canvas-paths.html?pathType=ellipseFill",
395             name: "Canvas ellipses, fill"
396         }
397     ]
398 ));