e3481ca8838457e28289eca96d1ad1a49c933eff
[WebKit-https.git] / PerformanceTests / ChangeLog
1 2016-03-16  Jon Lee  <jonlee@apple.com>
2
3         Add a new benchmark test
4         https://bugs.webkit.org/show_bug.cgi?id=155570
5
6         Reviewed by Simon Fraser.
7
8         New Leaves test includes various image sizes and opacity.
9
10         * Animometer/resources/debug-runner/tests.js: Add it to the HTML test suite.
11         * Animometer/tests/dom/leaves.html: Added.
12         * Animometer/tests/dom/resources/leaves.js: Added. Override the
13         (Particle.call.reset): Uses a range of sizes, and opacity.
14         (Particle.call.animate): Opacity goes up then down. When it hits 0, reset the particle.
15         (Particle.call.move): Set transform and opacity.
16         * Animometer/tests/master/resources/leaves.js: Get rid of the closure so that it
17         can be used in this test. Update the relative path so that it works in both the master
18         and dom test suite.
19
20 2016-03-15  Simon Fraser  <simon.fraser@apple.com>
21
22         Add developer Animometer test that bounces P3-tagged images
23         https://bugs.webkit.org/show_bug.cgi?id=155511
24
25         Reviewed by Tim Horton.
26         
27         Add a test for rendering performance of tagged images. The 5 images are tagged
28         with the Display P3 colorspace.
29
30         * Animometer/resources/debug-runner/tests.js:
31         * Animometer/tests/bouncing-particles/bouncing-tagged-images.html: Added.
32         * Animometer/tests/bouncing-particles/resources/bouncing-tagged-images.js: Added.
33         * Animometer/tests/bouncing-particles/resources/image1.jpg: Added.
34         * Animometer/tests/bouncing-particles/resources/image2.jpg: Added.
35         * Animometer/tests/bouncing-particles/resources/image3.jpg: Added.
36         * Animometer/tests/bouncing-particles/resources/image4.jpg: Added.
37         * Animometer/tests/bouncing-particles/resources/image5.jpg: Added.
38
39 2016-03-09  Jon Lee  <jonlee@apple.com>
40
41         Enhance existing Animometer tests
42         https://bugs.webkit.org/show_bug.cgi?id=155261
43
44         Reviewed by Simon Fraser.
45
46         * Animometer/tests/master/resources/canvas-tests.js: Add a gradient to
47         the filled circles. To expose more of the gradient, add another circle.
48         (SimpleCanvasStage.call.animate): For each frame, create a gradient with
49         undulating stop points and colors. Fill the circles twice; once with
50         the solid color, and once with the gradient.
51
52         * Animometer/tests/master/resources/dom-particles.js: Refactor the
53         emission variables into a separate stage for this test. Add a colorOffset
54         variable to make the colors of each particle slightly different, since
55         the ramp controller can add large numbers of particles all at once, which
56         would otherwise get all the same color.
57         * Animometer/tests/master/resources/particles.js:
58         (initialize): Remove the code specific to the SVG mask test.
59
60         * Animometer/tests/master/resources/image-data.js:
61         (initialize): Remove unused local variable.
62         * Animometer/tests/master/resources/multiply.js:
63         (initialize): Make the test harder by adding more total particles.
64
65 2016-03-09  Jon Lee  <jonlee@apple.com>
66
67         Add text tests
68         https://bugs.webkit.org/show_bug.cgi?id=155257
69
70         Reviewed by Simon Fraser.
71
72         * Animometer/resources/extensions.js:
73         (UnitBezier.Utilities.createClass): Add a class that computes Bezier points
74         assuming that two of the control points are at (0,0) and (1,1). Taken from
75         WebCore/platform/graphics/UnitBezier.h
76         * Animometer/resources/runner/tests.js: Add a test for English text and one
77         for international text.
78         * Animometer/tests/master/international.html: Added.
79         * Animometer/tests/master/resources/text.js: Added. The test assumes there is
80         #template div which it will copy. The copies are placed behind the template, and
81         are set with different colors each frame. They are moved around with CSS transform.
82         * Animometer/tests/master/text.html: Added.
83
84         Remove the other text tests, since these ones cover the same techniques.
85         * Animometer/tests/text/layering-text.html: Removed.
86         * Animometer/tests/text/resources/layering-text.js: Removed.
87         * Animometer/tests/text/resources/text-boxes.js: Removed.
88         * Animometer/tests/text/text-boxes.html: Removed.
89         * Animometer/resources/debug-runner/tests.js:
90
91 2016-03-09  Jon Lee  <jonlee@apple.com>
92
93         Add a new image test
94         https://bugs.webkit.org/show_bug.cgi?id=155232
95
96         Reviewed by Dean Jackson.
97         Provisionally reviewed by Said Abou-Hallawa.
98
99         The image test renders PNGs and moves them with translate and rotate
100         transforms. Each particle has a lifetime, and when the lifetime ends or
101         the particle goes offscreen, it resets itself somewhere on the stage.
102
103         * Animometer/resources/debug-runner/tests.js: Remove the CSS bouncing PNG
104         images test, because this one tests the same technique.
105         * Animometer/resources/runner/tests.js: Added here as "Leaves".
106         * Animometer/tests/master/leaves.html: Added.
107         * Animometer/tests/master/resources/particles.js: Refactor out the parts
108         specific to the DOM particles test. Consequently make velocity a public
109         member.
110         (initialize): The options parameter is never used, so remove it.
111         (animate): Remove unused local variable.
112         * Animometer/tests/master/resources/leaves.js: Maintains a focal point that
113         moves back and forth across the canvas. That point affects the velocity
114         of the particles. When the focal point is on the leftmost side, it is
115         between [-6, -2], and set in reset(). When the focal point is on the rightmost
116         side, it will be from [2, 6].
117         * Animometer/tests/master/resources/dom-particles.js: Move JS specific to
118         this test here from particles.js.
119
120         New images.
121         * Animometer/tests/master/resources/compass100.png: Added.
122         * Animometer/tests/master/resources/console100.png: Added.
123         * Animometer/tests/master/resources/contribute100.png: Added.
124         * Animometer/tests/master/resources/debugger100.png: Added.
125         * Animometer/tests/master/resources/inspector100.png: Added.
126         * Animometer/tests/master/resources/layout100.png: Added.
127         * Animometer/tests/master/resources/performance100.png: Added.
128         * Animometer/tests/master/resources/script100.png: Added.
129         * Animometer/tests/master/resources/shortcuts100.png: Added.
130         * Animometer/tests/master/resources/standards100.png: Added.
131         * Animometer/tests/master/resources/storage100.png: Added.
132         * Animometer/tests/master/resources/styles100.png: Added.
133         * Animometer/tests/master/resources/timeline100.png: Added.
134
135 2016-03-03  Jon Lee  <jonlee@apple.com>
136
137         Add ability to retrieve raw data from release harness
138         https://bugs.webkit.org/show_bug.cgi?id=155026
139
140         Reviewed by Simon Fraser.
141
142         * Animometer/developer.html: Remove the special UI in the debug
143         harness.
144         * Animometer/resources/runner/animometer.css: Add styles for the
145         overlay.
146         * Animometer/resources/runner/animometer.js: Let 'j' show the JSON
147         results, but only if the overlay doesn't exist. Add 'esc' key to dismiss
148         the overlay.
149         (window.benchmarkController.selectResults): Cycle the cases around
150         so that the first 's' press selects both the benchmark score and
151         the individual test scores.
152         * Animometer/resources/debug-runner/animometer.css: Remove
153         unneeded rules.
154         * Animometer/resources/debug-runner/animometer.js: Make the same
155         call to handleKeyPress.
156
157 2016-03-03  Jon Lee  <jonlee@apple.com>
158
159         Make sure multiply test particles have at least some opacity
160         https://bugs.webkit.org/show_bug.cgi?id=155027
161
162         Reviewed by Simon Fraser.
163
164         * Animometer/tests/master/resources/multiply.js:
165         (initialize): Have the elements spin a little faster to make it
166         more obvious when the system is being stressed.
167         (_addTile):
168         (animate): Make sure each element being animated has at least 1%
169         opacity.
170
171 2016-03-03  Jon Lee  <jonlee@apple.com>
172
173         Update image test
174         https://bugs.webkit.org/show_bug.cgi?id=154962
175
176         Rubber-stamped by Darin Adler.
177
178         * Animometer/tests/master/image-data.html: Make each canvas have a compositing layer.
179         * Animometer/tests/master/resources/image-data.js:
180         (initialize): Update to load multiple images serially.
181         (_loadImage):
182         (tune): Use display instead of visibility. When showing an element anew, move it somewhere else.
183         (_createTestElement): Set up the element, refactor out placement of element to _refreshElement.
184         (_refreshElement): Place element in a tile grid.
185         (animate):
186         (_getRandomNeighboringPixelIndex): Use a more conservative distribution to make the effect last a little longer.
187         * Animometer/tests/master/resources/compass.svg: Added.
188         * Animometer/tests/master/resources/console.svg: Added.
189         * Animometer/tests/master/resources/contribute.svg: Added.
190         * Animometer/tests/master/resources/debugger.svg: Added.
191         * Animometer/tests/master/resources/inspector.svg: Added.
192         * Animometer/tests/master/resources/layout.svg: Added.
193         * Animometer/tests/master/resources/performance.svg: Added.
194         * Animometer/tests/master/resources/script.svg: Added.
195         * Animometer/tests/master/resources/shortcuts.svg: Added.
196         * Animometer/tests/master/resources/standards.svg: Added.
197         * Animometer/tests/master/resources/storage.svg: Added.
198         * Animometer/tests/master/resources/styles.svg: Added.
199         * Animometer/tests/master/resources/timeline.svg: Added.
200
201 2016-03-02  Jon Lee  <jonlee@apple.com>
202
203         Add some new controllers, and refine tests
204         https://bugs.webkit.org/show_bug.cgi?id=154914
205
206         Reviewed by Simon Fraser.
207
208         Improve tests.
209
210         * Animometer/tests/master/focus.html: Move each particle into a layer. Put the particle
211         in a container element. Expand the container element by the max blur radius, and clip
212         overflow. This way, when the blur is applied, it avoids causing layer resizes.
213         * Animometer/tests/master/resources/focus.js:
214         (FocusElement.Utilities.createClass): Create a container element, and put the particle
215         inside.
216         (hide): Set display:none.
217         (show): Set display:block.
218         (animate): Apply filters to the container element.
219         (FocusStage.call.initialize): Instead of inserting and removing elements from the DOM,
220         keep them in the stage, but set the display style instead. Use this._offsetIndex to
221         keep track of which elements are displayed.
222         (FocusStage.call.animate): Move some calculations around to avoid doing unneeded math.
223         (FocusStage.call.getBlurValue): Make sure elements are always blurred.
224         (FocusStage.call.getOpacityValue): Make sure elements have some opacity.
225         * Animometer/tests/master/resources/multiply.js: Have the particles on the edge of the
226         stage appear less black when the complexity gets large enough.
227         (tune): Have this._distanceFactor calculate the factor. Avoid calculating square root each
228         frame.
229
230 2016-03-02  Jon Lee  <jonlee@apple.com>
231
232         Add some new controllers, and refine tests
233         https://bugs.webkit.org/show_bug.cgi?id=154914
234
235         Reviewed by Simon Fraser.
236
237         Add a controller that centers around 30 fps instead of 60 fps.
238
239         * Animometer/developer.html: Add a new option.
240         * Animometer/resources/debug-runner/animometer.js:
241         * Animometer/resources/runner/animometer.js:
242         (this._processData.findRegression): When calculating the complexity-frameLength regression,
243         check the controller, and use a 30 fps baseline if needed.
244         * Animometer/resources/statistics.js:
245         (Regression.Utilities.createClass): Update to allow clients to specify the baseline
246         frame length.
247         * Animometer/tests/resources/main.js:
248         (tune): Override some of the constants in RampController. Move those constants out for
249         easier reading.
250
251         Add a fixed controller, with no step.
252
253         * Animometer/developer.html: Add a controller that takes no step.
254         * Animometer/resources/debug-runner/animometer.js:
255         * Animometer/tests/resources/main.js:
256         (Rotater.Utilities.createClass):
257
258         Switch to ramp controller as default.
259
260         * Animometer/developer.html: Increase the test length to 20 seconds.
261         * Animometer/resources/debug-runner/animometer.js: Rename the "adjustment" field to "controller"
262         since that is a more accurate description.
263         * Animometer/resources/debug-runner/graph.js:
264         * Animometer/resources/runner/animometer.js: Update preferences for release suite.
265
266 2016-02-26  Jon Lee  <jonlee@apple.com>
267
268         Address Dean's comments in 154673.
269
270         * Animometer/developer.html:
271         * Animometer/resources/debug-runner/animometer.js:
272         * Animometer/resources/debug-runner/graph.js:
273
274 2016-02-25  Jon Lee  <jonlee@apple.com>
275
276         Update animation benchmark and tests
277         https://bugs.webkit.org/show_bug.cgi?id=154673
278
279         Reviewed by Dean Jackson.
280
281         Update test visuals.
282
283         * Animometer/tests/master/resources/canvas-tests.js:
284         (CanvasLineSegment.Utilities.createClass): Line segments near the edge of the stage get clipped.
285         Update circle position and radius to minimize impact.
286         * Animometer/tests/master/resources/particles.js: Get rid of rotating gradient background, and
287         have 3 locations for emitting particles.
288         * Animometer/tests/master/resources/multiply.js: Update distance metric so that fringe tiles get
289         more color.
290         (initialize): Fix some of the math for laying out the tiles.
291         (animate): When a tile isn't used, set visibility: hidden.
292
293 2016-02-24  Jon Lee  <jonlee@apple.com>
294
295         Update animation benchmark and tests
296         https://bugs.webkit.org/show_bug.cgi?id=154673
297
298         Reviewed by Dean Jackson.
299
300         Update the ramp controller.
301
302         The controller refines the complexity interval to test across.
303
304         * Animometer/resources/statistics.js: Add functions that estimate cumulative distribution function.
305         (Regression): For the flat regression, force the first segment to be at 60 fps.
306         (valueAt): Add convenience function to return interpolated value based on the regression used.
307         (_calculateRegression): Include the number of points included for both segments, and the piecewise
308         errors.
309         * Animometer/tests/resources/math.js: Make the Kalman estimator subclass Experiment, and allow it
310         to be reset.
311
312         * Animometer/tests/resources/main.js: Initialize the tier such that it starts at 10^0 = 1.
313         Increase the number of ramps. Maintain three FPS thresholds-- the frame rate of interest, a limit
314         on the lowest FPS we care to go for later interpolation, and a minimum FPS threshold we want to
315         aim for each ramp. Also keep three estimators: a running average of the change point, a minimum
316         boundary for each ramp, and an estimator for all the frames within an interval. The first two
317         are used to determine the parameters of the next ramp, and the latter allows us to refine the
318         parameters.
319         (update): During the tier phase, it is possible that the highest complexity possible for a test
320         won't stress the system enough to trigger stopping the tier phase and transitioning to the ramps.
321         If the complexity doesn't change when going to the next tier, we've maxed the test out, and move
322         on. When the tier phase completed, turn off Controller.frameLengthEstimator, which estimates the
323         FPS at each tier.
324         (tune): At each interval, look at the confidence distribution of being on the 60 FPS side or the
325         slow side. If the slowest FPS we achieve at the ramp's maximum complexity is not at least
326         _fpsRampSlowThreshold, then increase the maximum complexity. If we ever achieve 60 FPS, increase
327         the ramp's minimum complexity to that level. If, at an even lower complexity, a glitch causes the
328         FPS to drop, we reset the minimum complexity.
329
330         Have the bootstrap calculation occur between tests. Clean up harness.
331
332         * Animometer/resources/debug-runner/animometer.js: Run bootstrap after a test has
333         completed to avoid doing all of it at the end before showing the results. Clean up
334         parameters being passed around.
335         * Animometer/resources/debug-runner/tests.js:
336         (text):
337         * Animometer/resources/runner/animometer.js:
338         (this._processData.calculateScore): Save the results to the same object holding the data.
339         (this._processData._processData): In the case where a file is dragged, calculate the score
340         serially. Grab the results object and move it to the results variable and remove it from
341         the data object. This avoids serializing the results into the JSON.
342         (this._processData.findRegression): Include the samples used for bootstrapping. Reduce the
343         resample size to shorten the wait.
344         * Animometer/resources/runner/benchmark-runner.js:
345         * Animometer/resources/statistics.js:
346         (bootstrap): Update how bootstrapData is sorted. In some regression results the mix of
347         floats and integers causes an alphabetical sort to occur.
348         * Animometer/resources/strings.js:
349
350         Add meta charset so that encodings between harness and test match.
351
352         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
353         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
354         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
355         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
356         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
357         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
358         * Animometer/tests/master/canvas-stage.html:
359         * Animometer/tests/master/focus.html:
360         * Animometer/tests/master/image-data.html:
361         * Animometer/tests/master/multiply.html:
362         * Animometer/tests/master/particles.html:
363         * Animometer/tests/misc/canvas-electrons.html:
364         * Animometer/tests/misc/canvas-stars.html:
365         * Animometer/tests/misc/compositing-transforms.html:
366         * Animometer/tests/simple/simple-canvas-paths.html:
367         * Animometer/tests/simple/tiled-canvas-image.html:
368         * Animometer/tests/template/template-canvas.html:
369         * Animometer/tests/template/template-css.html:
370         * Animometer/tests/template/template-svg.html:
371         * Animometer/tests/text/layering-text.html:
372         * Animometer/tests/text/text-boxes.html:
373
374         Update test harness reporting.
375
376         * Animometer/developer.html: Add missing meta charset.
377         * Animometer/index.html: Remove unnecessary utf-8 declaration.
378         * Animometer/resources/debug-runner/animometer.css: Add convenience classes for
379         formatting the results table.
380         * Animometer/resources/debug-runner/animometer.js: Adjust which stats are shown.
381         * Animometer/resources/debug-runner/tests.js: Display bootstrapping statistics.
382         * Animometer/resources/strings.js: Move strings not used by the release harness.
383
384         Switch to a pseudo-random number generator.
385
386         * Animometer/resources/statistics.js: Add a Pseudo class, with a simple
387         pseudo-random number generator.
388         (_calculateRegression): Reset the generator before running bootstrap.
389         (bootstrap): Deleted.
390
391         Replace Math.random with Pseudo.random.
392         * Animometer/tests/master/resources/canvas-tests.js:
393         * Animometer/tests/master/resources/focus.js:
394         * Animometer/tests/master/resources/particles.js:
395         * Animometer/tests/resources/main.js:
396
397         Use bootstrapping to get confidence interval in the breakpoint.
398
399         For the ramp controller, calculate the piecewise regression, and then use
400         bootstrapping in order to find the 95% confidence interval. Use the raw data.
401
402         * Animometer/developer.html: Default to the complexity graph. Add a legend
403         checkbox to toggle visibility of the bootstrap score and histogram.
404         * Animometer/resources/debug-runner/animometer.css: Make some more space to show
405         the old raw and average scores in the legend. Add new styles for the data.
406         * Animometer/resources/debug-runner/graph.js:
407         (_addRegressionLine): Allow passing an array for the variance bar tied to the
408         regression line. Now |stdev| is |range|.
409         (createComplexityGraph): Add bootstrap median, and overlay a histogram of
410         the bootstrap samples. Switch raw samples from circles to X's.
411         (onComplexityGraphOptionsChanged): Allow toggling of the bootstrap data.
412         (onGraphTypeChanged): Move the regressions for the raw and average samples to the
413         legend. In the subtitle use the bootstrap median, and include the 95% confidence
414         interval.
415         * Animometer/resources/runner/animometer.js:
416         (this._processData.findRegression): Factor out the code that determines which
417         samples to include when calculating the piecewise regression. For series that have
418         many samples, or a wider range of recorded complexities, throw away the 2.5%
419         lowest and highest samples before calculating the regression. Keep all samples
420         if the number of samples to regress is small or the range of complexities is
421         narrow.
422         (this._processData._calculateScore): Factor out regression calculation to
423         findRegression(). Bootstrap the change point of the regression. The score is the
424         median.
425         * Animometer/resources/statistics.js:
426         (_calculateRegression): Correct an issue in the calculation of the regression, where
427         the denominator can be 0.
428         (bootstrap): Template for bootstrapping. Create a bootstrap sample array, Create
429         re-samples by random selection with replacement. Return the 95% confidence samples,
430         the bootstrap median, mean, and the data itself.
431         * Animometer/resources/strings.js: Add bootstrap.
432         * Animometer/tests/resources/main.js:
433         (processSamples): Don't prematurely cut the sample data.
434
435         Fix graph drawing.
436
437         * Animometer/resources/debug-runner/animometer.js: Add spacing in the JSON output.
438         Multiple tests output a lot of JSON and can hang when selecting JSON with no whitespace.
439         * Animometer/resources/debug-runner/animometer.css:
440         (#complexity-graph .series.raw circle): Update the color.
441         * Animometer/resources/debug-runner/graph.js: Use the FPS axis instead of the
442         complexity axis, which can vary in domain. For determining the complexity domain,
443         only use samples after samplingTimeOffset.
444
445         Allow dropping results JSON.
446
447         * Animometer/developer.html: Add a button.
448         * Animometer/resources/debug-runner/animometer.css:
449         * Animometer/resources/debug-runner/animometer.js: Read the data and go straight
450         to the dashboard. With JSON output, write out only the options and the raw data.
451
452         Teach the harness to evaluate the samples and determine the test score.
453
454         This will allow us to update how the score is calculated separately from the samples recorded.
455         This also prepares the harness to be able to accept JSON of prior runs.
456
457         * Animometer/resources/strings.js: Clean up and remove unneeded strings and reduce some of the
458         hierarchy.
459         * Animometer/resources/debug-runner/tests.js: Update to use the new strings.
460
461         * Animometer/tests/resources/main.js: Allow all controllers to show a complexity-FPS graph.
462         (_processComplexitySamples): Factor out some of the sample processing done in the ramp
463         controller for the benefit of the other controllers. |complexitySamples| contains a list of
464         samples. Sort the samples by complexity. Optionally remove the top x% of samples.
465         Group them, and calculate distribution of samples within the same complexity, and add those as
466         new entries into |complexityAverageSamples|.
467         (Controller.processSamples): Move the code responsible for determining the complexity and FPS
468         scores out to ResultsDashboard. The structure of the data returned by the controller is:
469
470         {
471             controller: [time-regression, time-regression, ...], // optional, data specific to controller
472             marks: [...],
473             samples: {                    // all of the sample data
474                 controller: [...],
475                 complexity: [...],        // processed from controller samples
476                 complexityAverage: [...], // processed from complexity samples
477             }
478         }
479
480         (AdaptiveController.processSamples): Adding the target frame length is no longer necessary; we
481         now pass the test options to the graph.
482         (Regression): Move to statistics.js.
483         * Animometer/resources/statistics.js: Move Regression to here. Add a check if the sampling range
484         only contains one sample, since we cannot calculate a regression from one sample point.
485
486         Teach the test harness to evaluate the data.
487         * Animometer/resources/runner/animometer.js:
488         (ResultsDashboard): Store the options used to run the test and the computed results/score separately
489         from the data. The results are stored as:
490
491         {
492             score: /* geomean of iteration score */,
493             iterationsResults: [
494                 {
495                     score: /* geomean of tests */,
496                     testsResults: {
497                         suiteName: {
498                             testName: {
499                                 controller: {
500                                     average:
501                                     concern:
502                                     stdev:
503                                     percent:
504                                 },
505                                 frameLength: { ... },
506                                 complexity: {
507                                     complexity:
508                                     stdev:
509                                     segment1:
510                                     segment2:
511                                 },
512                                 complexityAverage: { ... }
513                             },
514                             testName: { ... },
515                         },
516                         ... next suite ...
517                     }
518                 },
519                 { ...next iteration... }
520             ]
521         }
522
523         * Animometer/resources/debug-runner/animometer.js: Pass options around instead of relying
524         on what was selected in the form. This will later allow for dropping previous results, and
525         using those runs' options when calculating scores.
526         (ResultsTable._addGraphButton): Simplify button action by using attached test data.
527         * Animometer/resources/debug-runner/graph.js: Refactor to use the data.
528
529         Consolidate JS files, and move statistics out to a separate JS.
530
531         Preparation for having the Controller only handle recording and storage of the samples,
532         and leave the evaluation of the test score out to the harness. Move Experiment to
533         a new statistics.js, where Regression will also eventually go. Get rid of algorithm.js
534         and move it to utilities.js since the Heap is used only for Experiments.
535
536         * Animometer/tests/resources/algorithm.js: Removed. Heap is in utilities.js.
537         * Animometer/tests/resources/sampler.js: Removed. Experiment is in statistics.js,
538         Sampler in main.js.
539         * Animometer/tests/resources/main.js: Move Sampler here.
540         * Animometer/resources/statistics.js: Added. Move Statistics and Experiment here.
541         * Animometer/resources/extensions.js: Move Heap here. Attach static method to create
542         a max or min heap to Heap, instead of a new Algorithm object.
543
544         Update JS files.
545         * Animometer/developer.html:
546         * Animometer/index.html:
547         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
548         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
549         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
550         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
551         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
552         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
553         * Animometer/tests/master/canvas-stage.html:
554         * Animometer/tests/master/focus.html:
555         * Animometer/tests/master/image-data.html:
556         * Animometer/tests/master/multiply.html:
557         * Animometer/tests/master/particles.html:
558         * Animometer/tests/misc/canvas-electrons.html:
559         * Animometer/tests/misc/canvas-stars.html:
560         * Animometer/tests/misc/compositing-transforms.html:
561         * Animometer/tests/simple/simple-canvas-paths.html:
562         * Animometer/tests/simple/tiled-canvas-image.html:
563         * Animometer/tests/template/template-canvas.html:
564         * Animometer/tests/template/template-css.html:
565         * Animometer/tests/template/template-svg.html:
566         * Animometer/tests/text/layering-text.html:
567         * Animometer/tests/text/text-boxes.html:
568
569         Fix the cursor in the graph analysis when the min
570         complexity is not 0.
571
572         * Animometer/resources/debug-runner/graph.js:
573         (_addRegression):
574         (createComplexityGraph):
575
576 2016-02-23  Geoffrey Garen  <ggaren@apple.com>
577
578         Fix some issues in MallocBench
579         https://bugs.webkit.org/show_bug.cgi?id=154600
580
581         Reviewed by Oliver Hunt.
582
583         * MallocBench/MallocBench.xcodeproj/project.pbxproj: Make nimlang.ops
584         a part of the build so that it copies to the right place for execution.
585
586         * MallocBench/MallocBench/Interpreter.cpp:
587         (Interpreter::Interpreter): Don't try to open .ops files for writing
588         because we're only going to read and we might need extra permissions to
589         write.
590
591         (Interpreter::~Interpreter): Give more context when opening a file fails
592         to help with debugging.
593
594         * MallocBench/MallocBench/stress.cpp:
595         (benchmark_stress): Reduce iterations to complete in less than 10 seconds.
596
597 2016-02-23  Michael Saboff  <msaboff@apple.com>
598
599         Unreviewed change to revert extraneous changes made part of change set 196955.
600
601         * MallocBench/MallocBench/Interpreter.cpp:
602         (Interpreter::doMallocOp):
603         (Interpreter::Thread::switchTo):
604         (writeData): Deleted.
605
606 2016-02-19  Michael Saboff  <msaboff@apple.com>
607
608         MallocBench: Added recording for nimlang website, new recording details and added new options
609         https://bugs.webkit.org/show_bug.cgi?id=154485
610
611         Reviewed by Geoff Garen.
612
613         Added new capabilities to MallocBench.  These include:
614             Added a recording of http://nim-lang.org/docs/lib.html.
615             Added thread id to the recording and the ability to playback switching threads in MallocBench
616             Added aligned allocations to recordings and the ability to playback
617             Added --use-thread-id option to honor recorded thread ids
618             Added --detailed-report to output remaining allocations by size after playback
619             Added --no-warmup to not run the warm up iteration
620
621         Changed the way that options are passed down to the benchmarks.  Instead of passing individual
622         boolean or numeric option values, just pass a reference the CommandLine itself.  Each benchmark
623         can access the options that are appropriate.  The Benchmark class also uses the options for
624         is parallel, run counts and warm up.
625
626         Added thread id and aligned malloc to the Op by noticing that structure padding and Opcode allowed
627         for another 32 bits of data.  Breaking that unused 32 bits into a 16 bit thread id value and a
628         16 bit log base 2 of the alignment for aligned malloc allowed for existing recordings to playback
629         without any incompatibilities.
630
631         Threaded operation is simulated by creating threads as needed.  As long as the next Op's thread id
632         is the same as the last, operation continues as normal.  When the next Op has a different thread id,
633         we switch to that thread using the shared Op stream to continue playing back.  There is a mutex to
634         assure that only one thread is really running at a time and a condition variable used to wait
635         that the current thread id matches each block thread's thread id.  This doesn't simulate true
636         concurrent threading, but is instead plays back Ops recorded for multiple thread faithfully.
637
638         * MallocBench/MallocBench.xcodeproj/project.pbxproj:
639         * MallocBench/MallocBench/Benchmark.cpp:
640         (deallocateHeap):
641         (Benchmark::Benchmark):
642         (Benchmark::runOnce):
643         (Benchmark::run):
644         * MallocBench/MallocBench/Benchmark.h:
645         (Benchmark::isValid):
646         * MallocBench/MallocBench/CommandLine.cpp:
647         (CommandLine::printUsage):
648         * MallocBench/MallocBench/CommandLine.h:
649         (CommandLine::isValid):
650         (CommandLine::benchmarkName):
651         (CommandLine::isParallel):
652         (CommandLine::useThreadID):
653         (CommandLine::detailedReport):
654         (CommandLine::warmUp):
655         (CommandLine::heapSize):
656         (CommandLine::runs):
657         * MallocBench/MallocBench/Interpreter.cpp:
658         (Interpreter::Interpreter):
659         (Interpreter::run):
660         (Interpreter::readOps):
661         (Interpreter::doOnSameThread):
662         (Interpreter::switchToThread):
663         (Interpreter::detailedReport):
664         (compute2toPower):
665         (writeData):
666         (Interpreter::doMallocOp):
667         (Interpreter::Thread::Thread):
668         (Interpreter::Thread::stop):
669         (Interpreter::Thread::~Thread):
670         (Interpreter::Thread::runThread):
671         (Interpreter::Thread::waitToRun):
672         (Interpreter::Thread::switchTo):
673         * MallocBench/MallocBench/Interpreter.h:
674         (Interpreter::Thread::isMainThread):
675         * MallocBench/MallocBench/alloc_free.cpp: Added.
676         (benchmark_alloc_free):
677         * MallocBench/MallocBench/alloc_free.h: Added.
678         * MallocBench/MallocBench/balloon.cpp:
679         (benchmark_balloon):
680         * MallocBench/MallocBench/balloon.h:
681         * MallocBench/MallocBench/big.cpp:
682         (benchmark_big):
683         * MallocBench/MallocBench/big.h:
684         * MallocBench/MallocBench/churn.cpp:
685         (benchmark_churn):
686         * MallocBench/MallocBench/churn.h:
687         * MallocBench/MallocBench/facebook.cpp:
688         (benchmark_facebook):
689         * MallocBench/MallocBench/facebook.h:
690         * MallocBench/MallocBench/flickr.cpp:
691         (benchmark_flickr):
692         (benchmark_flickr_memory_warning):
693         * MallocBench/MallocBench/flickr.h:
694         * MallocBench/MallocBench/fragment.cpp:
695         (validate):
696         (benchmark_fragment):
697         (benchmark_fragment_iterate):
698         * MallocBench/MallocBench/fragment.h:
699         * MallocBench/MallocBench/list.cpp:
700         (benchmark_list_allocate):
701         (benchmark_list_traverse):
702         * MallocBench/MallocBench/list.h:
703         * MallocBench/MallocBench/main.cpp:
704         (main):
705         * MallocBench/MallocBench/medium.cpp:
706         (benchmark_medium):
707         * MallocBench/MallocBench/medium.h:
708         * MallocBench/MallocBench/memalign.cpp:
709         (test):
710         (benchmark_memalign):
711         * MallocBench/MallocBench/memalign.h:
712         * MallocBench/MallocBench/message.cpp:
713         (benchmark_message_one):
714         (benchmark_message_many):
715         * MallocBench/MallocBench/message.h:
716         * MallocBench/MallocBench/nimlang.cpp: Added.
717         (benchmark_nimlang):
718         * MallocBench/MallocBench/nimlang.h: Added.
719         * MallocBench/MallocBench/nimlang.ops: Added.
720         * MallocBench/MallocBench/realloc.cpp:
721         (benchmark_realloc):
722         * MallocBench/MallocBench/realloc.h:
723         * MallocBench/MallocBench/reddit.cpp:
724         (benchmark_reddit):
725         (benchmark_reddit_memory_warning):
726         * MallocBench/MallocBench/reddit.h:
727         * MallocBench/MallocBench/stress.cpp:
728         (deallocate):
729         (benchmark_stress):
730         * MallocBench/MallocBench/stress.h:
731         * MallocBench/MallocBench/stress_aligned.cpp:
732         (benchmark_stress_aligned):
733         * MallocBench/MallocBench/stress_aligned.h:
734         * MallocBench/MallocBench/theverge.cpp:
735         (benchmark_theverge):
736         (benchmark_theverge_memory_warning):
737         * MallocBench/MallocBench/theverge.h:
738         * MallocBench/MallocBench/tree.cpp:
739         (benchmark_tree_allocate):
740         (benchmark_tree_traverse):
741         (benchmark_tree_churn):
742         * MallocBench/MallocBench/tree.h:
743         * MallocBench/run-malloc-benchmarks:
744
745 2016-02-11  Jon Lee  <jonlee@apple.com>
746
747         Fix a missing refactoring.
748
749         * Animometer/tests/master/resources/multiply.js:
750         (animate): Move to Utilities.lerp.
751         (_lerp): Deleted.
752
753 2016-02-10  Jon Lee  <jonlee@apple.com>
754
755         Add new benchmark tests.
756         https://bugs.webkit.org/show_bug.cgi?id=154063
757
758         Provisionally reviewed by Said Abou-Hallawa.
759
760         Add tests for get/put image data, filters, opacity, and css transforms.
761
762         * Animometer/resources/runner/benchmark-runner.js:
763         (_runBenchmarkAndRecordResults): Update the body background color to match that of
764         the stage.
765         (this._runNextIteration): Clear the background color style for the results page.
766         * Animometer/resources/runner/tests.js:
767         * Animometer/tests/master/focus.html: Added.
768         * Animometer/tests/master/image-data.html: Added.
769         * Animometer/tests/master/multiply.html: Added.
770         * Animometer/tests/master/resources/focus.js: Added.
771         * Animometer/tests/master/resources/image-data.js: Added.
772         * Animometer/tests/master/resources/multiply.js: Added.
773         * Animometer/tests/master/resources/stage.css: Move common styles out.
774         * Animometer/tests/resources/main.js: Update Stage.randomBool to use Math.random.
775         Add Stage.randomSign for randomly setting a direction. Add the notion of the
776         current timestamp of the test to Benchmark, since some animations cycle through
777         colors and rely on an incremental counter like the time.
778
779 2016-02-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
780
781         Add internal benchmark tests for CSS mix-blend-modes and filters
782         https://bugs.webkit.org/show_bug.cgi?id=154058
783
784         Provisionally reviewed by Jon Lee.
785
786         * Animometer/resources/debug-runner/tests.js: Include the new tests in the
787         "HTML suite" of the debug runner.
788
789         * Animometer/resources/extensions.js:
790         (Utilities.browserPrefix):
791         (Utilities.setElementPrefixedProperty): Utility functions to allow setting
792         prefixed style properties.
793
794         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
795         Set the mix-blend-mode and the filter to some random values if the options
796         of the test requested that.
797
798         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
799         (parseShapeParameters): Parse the url options "blend" and "filter" and set
800         the corresponding flags.
801
802         * Animometer/tests/resources/main.js:
803         (randomStyleMixBlendMode):
804         (randomStyleFilter): Return random mix-blend-mode and filter.
805
806 2016-02-08  Jon Lee  <jonlee@apple.com>
807
808         Add a ramp controller
809         https://bugs.webkit.org/show_bug.cgi?id=154028
810
811         Provisionally reviewed by Said Abou-Hallawa.
812
813         Enhance the graph to include a complexity-fps graph, in addition
814         to the time graph.
815
816         * Animometer/developer.html: Add a ramp option.
817         * Animometer/resources/debug-runner/animometer.css: Update the style.
818         * Animometer/resources/strings.js: Flatten the Strings.text constants.
819         * Animometer/resources/debug-runner/animometer.js:
820         (ResultsTable.call._addGraphButton): Refactor.
821         (ResultsTable.call._addTest): Add regression data.
822         (benchmarkController): Add a form that allows the user to switch between the two forms,
823         Add a form that allows the user to toggle different data. Hide certain header columns
824         depending on the selected controller.
825         * Animometer/resources/debug-runner/graph.js: Add the complexity regressions.
826         * Animometer/resources/debug-runner/tests.js: Add headers for the ramp results.
827         * Animometer/resources/runner/animometer.js:
828         (ResultsTable): If a header is disabled don't include them in _flattenedHeaders.
829         * Animometer/tests/resources/main.js:
830         (Controller): Allow options to specify the capacity for sample arrays.
831         (Regression): A piecewise regression that tries to fit a slope and a flat profile.
832         (_calculateRegression): Options can fix the slope and bias when calculating the minimal
833         error. Sweep across the samples in time (which could be backward depending on the controller)
834         and calculate the intersection point.
835         (RampController): This controller assumes that the target frame rate is below
836         58 FPS. It runs in two stages. The first stage quickly determines the order of
837         magnitude of objects needed to stress the system by the setting the complexity
838         to increasingly difficult tiers. Perform a series of ramps descending from a
839         high-water mark of complexity. The complexity needed to reach the target frame
840         length is done by performing a piecewise regression on each ramp, and track a
841         running average of these values. For the next ramp, make that running average
842         the center of the ramp. With a minimum complexity of 0, the high-water mark is
843         twice that average. The score is based on the highest complexity that can
844         reach 60 fps.
845
846 2016-02-08  Jon Lee  <jonlee@apple.com>
847
848         Address Said's comments on the benchmark, and do some clean up.
849
850         * Animometer/developer.html:
851         * Animometer/resources/debug-runner/animometer.css: Add styles for averages.
852         * Animometer/resources/debug-runner/animometer.js: Use the right
853         Strings constants.
854         * Animometer/resources/debug-runner/graph.js:
855         (_addRegressionLine): Add missing code to draw the line and standard
856         deviation highlight.
857         (onGraphTypeChanged): Remove unneeded variables
858         (onTimeGraphOptionsChanged):
859         * Animometer/resources/runner/benchmark-runner.js:
860         (_runBenchmarkAndRecordResults): Rename samplers to suiteResults and
861         _suitesSamplers to _suitesResults.
862         * Animometer/tests/resources/main.js:
863         (results): Call processSamples().
864         (update): Change sampling timestamp comparison.
865         (_animateLoop): Move shouldStop call to before the update.
866         * Animometer/tests/resources/sampler.js:
867         (process): Rename to processSamples().
868
869 2016-02-07  Jon Lee  <jonlee@apple.com>
870
871         Teach Controller to measure intervals, and turn off the frame length estimator.
872
873         * Animometer/tests/resources/main.js: Default interval length is 100 ms.
874         (start): Set the first interval.
875         (_measureAndResetInterval): Reports the average frame length of the interval that just
876         completed, and sets up the next interval.
877         (update): If there is no length, then just use the estimator per frame, otherwise the
878         estimator measures per interval. Add a didFinishInterval for subclasses to process
879         prior to recording the sample. Update tune() to include whether an interval had
880         finished.
881         (StepController): Step controllers don't measure on an interval basis.
882
883 2016-02-07  Jon Lee  <jonlee@apple.com>
884
885         Minor refactoring. Rename Controller._estimator to Controller._frameLengthEstimator
886         and switch the parameters for start(), update(), and tune(), so that the timestamp
887         is first and stage is second.
888
889         * Animometer/tests/resources/main.js:
890
891 2016-02-07  Jon Lee  <jonlee@apple.com>
892
893         Move ResultsTable functionality not needed for release tests out.
894         Move reporting of score and mean to selection of the time-based graph.
895
896         * Animometer/developer.html: Rename graph-options to time-graph-options.
897         * Animometer/resources/debug-runner/animometer.js:
898         (DeveloperResultsTable): Moved from runner/animometer.js. Switch from mean
899         values to "average" objects which can hold stdev. Move graph button and
900         calculation of noisy measurements here. Sophisticated header processing
901         is not needed in release suite.
902         (populateTable): Use DeveloperResultsTable.
903         * Animometer/resources/debug-runner/graph.js: Pull time graph creation to
904         its own function, and add a new onGraphTypeChanged handler in preparation
905         of a complexity graph to be added later.
906         * Animometer/resources/runner/animometer.js:
907         (ResultsTable): Simplify to just handle test names and scores.
908
909 2016-02-07  Jon Lee  <jonlee@apple.com>
910
911         Tests: reuse objects already made.
912
913         Avoid thrash of object creation and removal by maintaining an index that
914         moves along the array as the adjust values change. If the tune value
915         requires more objects than the maximum size of the object array, then create
916         new objects. This means that the object array size never decreases.
917
918         * Animometer/tests/master/resources/canvas-stage.js: Maintain a separate
919         offsetIndex. For these tests, we want to avoid drawing the oldest objects,
920         so the scene will draw the object at offsetIndex to the end of the array.
921         (tune): Reverse the logic since "removal" of objects is much simpler and
922         involves simply changing the offsetIndex.
923         (animate): Update the for loop to draw from offsetIndex to the end.
924         (complexity): Update the definition.
925         * Animometer/tests/master/resources/canvas-tests.js: Maintain a separate
926         offsetIndex. For these tests, we want to avoid drawing the newest objects,
927         so the scene will draw the object at index 0 to the object at offsetIndex.
928         (SimpleCanvasStage.animate): Fly-by removal of local stage variable,
929         which is unneeded. Update the for loop to draw from offsetIndex to the end.
930         * Animometer/tests/simple/resources/simple-canvas-paths.js:
931         (SimpleCanvasStage.animate): Update the for loop to draw from 0 to
932         offsetIndex.
933         * Animometer/tests/simple/resources/simple-canvas.js:
934         (tune): Update logic. Here, offsetIndex represents the boundary of the last
935         index to render.
936         (animate): Update the for loop to draw from 0 to offsetIndex.
937         (complexity): Update the definition.
938
939 2016-02-07  Jon Lee  <jonlee@apple.com>
940
941         Tests: refactor and update styles.
942
943         * Animometer/tests/resources/main.js: Add helper methods that return
944         a color that hue rotates based on the date, and a counter value that
945         increases based on the date. Fix randomInt() to not bias against the min and
946         max values.
947
948         * Animometer/tests/master/resources/canvas-tests.js: Use new helper methods.
949         * Animometer/tests/master/resources/dom-particles.js: Ditto.
950         * Animometer/tests/master/resources/particles.js: Ditto.
951         * Animometer/tests/simple/resources/simple-canvas-paths.js: Refactor to
952         use a rotating color instead of a random color. The fast switching of color
953         is too vivid to watch.
954
955         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
956         (BouncingSvgParticlesStage.call.createGradient): Fix the gradient so
957         that the last stop is located at the end.
958
959 2016-02-07  Jon Lee  <jonlee@apple.com>
960
961         Refactor tune() to not return the complexity of the scene.
962
963         We have stage.complexity() now, so returning the complexity through tune
964         is unnecessary.
965
966         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
967         * Animometer/tests/master/resources/canvas-stage.js:
968         * Animometer/tests/master/resources/particles.js:
969         * Animometer/tests/misc/resources/canvas-electrons.js:
970         * Animometer/tests/misc/resources/canvas-stars.js:
971         * Animometer/tests/resources/main.js:
972         * Animometer/tests/simple/resources/simple-canvas.js:
973         * Animometer/tests/simple/resources/tiled-canvas-image.js:
974         * Animometer/tests/template/resources/template-canvas.js:
975         * Animometer/tests/template/resources/template-css.js:
976         * Animometer/tests/template/resources/template-svg.js:
977         * Animometer/tests/text/resources/layering-text.js:
978
979 2016-02-07  Jon Lee  <jonlee@apple.com>
980
981         Make the fixed controller a step controller instead. Halfway through the test
982         it will bump up the complexity 4-fold. Calculate the step timestamp using options
983         instead of a separate parameter to the Controller constructor.
984
985         * Animometer/developer.html: Change value to "step"
986         * Animometer/resources/debug-runner/animometer.js:
987         (window.suitesManager.updateEditsElementsState): Show number inputs when set to "step".
988         * Animometer/tests/resources/main.js:
989         (update): Provide a hook for subclasses to tune.
990         (StepController): Maintain a flag determining whether we've stepped, and the time
991         we should step.
992         (Benchmark): Use the new StepController.
993
994 2016-02-07  Jon Lee  <jonlee@apple.com>
995
996         Adjust the FPS graph scale.
997
998         Instead of making the FPS graph linearly scale, scale it based on the frame length,
999         but show the data in terms of FPS. Because it is inversely proportional, and most
1000         of the data never gets below 20, concentrate the axis from 20-60 FPS, since otherwise
1001         over half of the available graph space ends up blank.
1002
1003         This means we should convert all of the FPS data to frame length data.
1004
1005         * Animometer/resources/debug-runner/graph.js: Update the domain to be based on
1006         frame length in milliseconds instead of FPS. Update the cursor to consider all of the
1007         values being shown, and then pick the min and max values to represent the length of the
1008         cursor.
1009         * Animometer/resources/runner/animometer.js:
1010         * Animometer/resources/strings.js:
1011         * Animometer/tests/resources/main.js:
1012         (processSamples): Add the ability to only sample a range of the data instead of everything
1013         after an offset index. Update sampler to record the frame lengths instead of the frame
1014         rate.
1015
1016 2016-02-07  Jon Lee  <jonlee@apple.com>
1017
1018         Add option to use different methods for retrieving a timestamp.
1019
1020         * Animometer/developer.html: Add performance.now and Date.now options.
1021         * Animometer/resources/runner/animometer.js: Default to performance.now.
1022         (window.benchmarkController.startBenchmark):
1023         * Animometer/tests/resources/main.js: Tie the desired method to _getTimestamp.
1024         (run): Use _getTimestamp.
1025         (_animateLoop): Ditto.
1026
1027 2016-02-07  Jon Lee  <jonlee@apple.com>
1028
1029         Allow adding any number of markers to the graph. The markers can be labeled
1030         and contain timestamp and sample index data. Make it a part of the controller
1031         rather than keeping it in the sampler.
1032
1033         * Animometer/resources/debug-runner/animometer.css: Add styles for markers
1034         * Animometer/resources/debug-runner/graph.js: Create the markers and add
1035         text labels.
1036         * Animometer/resources/runner/animometer.js: Assume the samplingTimeOffset
1037         is just one of the marks provided.
1038         * Animometer/resources/strings.js: Add Strings.json.marks.
1039         * Animometer/tests/resources/main.js:
1040         (Controller): Keep marks here. They are keyed by the marker name, so no two
1041         markers should have the same name.
1042         (recordFirstSample): Refactor to use mark.
1043         (mark): Allows for arbitrary data if needed later. The timestamp maintained
1044         is relative to the absolute start timestamp.
1045         (containsMark): Checks whether a mark with a specific comment exists.
1046         (processSamples): Removes the _startTimestamp offset from the marks before
1047         setting it in results.
1048         * Animometer/tests/resources/sampler.js: Remove marks.
1049
1050 2016-02-07  Jon Lee  <jonlee@apple.com>
1051
1052         Get rid of options member variable in Benchmark.
1053
1054         Options are only needed when initializing the stage or benchmark, so there's no
1055         need to also keep a reference to it.
1056
1057         * Animometer/tests/resources/main.js: Get rid of options variable in Benchmark.
1058         Pass options to Controllers and Stages.
1059         (Controller.Utilities.createClass):
1060         (Benchmark.Utilities.createClass):
1061         (get options): Deleted.
1062
1063         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
1064         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
1065         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
1066         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
1067         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1068         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1069         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
1070         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1071         * Animometer/tests/master/resources/canvas-stage.js:
1072         * Animometer/tests/master/resources/canvas-tests.js:
1073         * Animometer/tests/master/resources/particles.js:
1074         * Animometer/tests/misc/resources/canvas-electrons.js:
1075         * Animometer/tests/misc/resources/canvas-stars.js:
1076         * Animometer/tests/misc/resources/compositing-transforms.js:
1077         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1078         * Animometer/tests/simple/resources/tiled-canvas-image.js:
1079         * Animometer/tests/template/resources/template-canvas.js:
1080         * Animometer/tests/template/resources/template-css.js:
1081         * Animometer/tests/template/resources/template-svg.js:
1082         * Animometer/tests/text/resources/layering-text.js:
1083
1084 2016-02-07  Jon Lee  <jonlee@apple.com>
1085
1086         Update how the benchmark is run
1087         https://bugs.webkit.org/show_bug.cgi?id=153960
1088
1089         Provisionally reviewed by Said Abou-Hallawa.
1090
1091         Introduce the notion of a Controller. It is responsible for recording, updating,
1092         and processing the statistics and complexity of the benchmark. This allows
1093         plugging in different Controllers.
1094
1095         This strips most of the functionality from Animator and BenchmarkState, so fold
1096         what's left into Benchmark. Now, Benchmarks only own a stage and a controller, but
1097         are responsible for driving the animation loop.
1098
1099         Rewrite Animator._shouldRequestAnotherFrame into two different Controllers. One
1100         maintains a fixed complexity, and the other adapts the complexity to meet a
1101         fixed FPS.
1102
1103         Fix the Kalman estimator to be modeled on a scalar variable with no model.
1104
1105         * Animometer/tests/resources/main.js: Remove BenchmarkState and Animator, and
1106         replace it with a Controller. Add a FixedController and refactor the previous controller
1107         to an AdaptiveController.
1108
1109         (Controller): Controllers own the estimator and the sampler. When a new frame is
1110         displayed, the animation loop calls update(). The estimator and sampler record
1111         stats, then tune. Samplers can track multiple series of data. The basic controller
1112         tracks timestamp, complexity, and estimated frame rate.
1113                 The Kalman estimation is based on the frame length rather than the frame
1114         rate. Because FPS is inverse proportional to frame length, in the case where the measured
1115         frame length is very small, the FPS ends up being a wildly large number (in the order of
1116         600-1000 "FPS"), and it pulls the estimator up drastically enough that it takes a while
1117         for it to settle back down. Using frame length reduces the impact of these spikes.
1118                 Converging the estimation takes enough time to avoid initializing it immediately
1119         when the benchmark starts. Instead, the benchmark runs for a brief period of time (100ms)
1120         before running it in earnest. Allow controllers an opportunity to set the complexity
1121         before starting recording.
1122                 When the benchmark is complete, the controller has an opportunity to process
1123         the samples. The default implementation calculates the raw FPS based on the time
1124         difference of the samples, and calculates the complexity score. This is moved from
1125         Benchmark.processSamples.
1126
1127         (Controller): Initialize timestamps. These are at first relative to the start of the
1128         benchmark, but are offset by the absolute start time during start(). By default maintain
1129         3 data series, but subclasses can override.
1130         (start): Calls recordFirstSample() for subclasses to override if needed.
1131         (recordFirstSample): For basic controller, start sampling at the beginning.
1132         (update): Update the frame length estimator and sample.
1133         (shouldStop): Checks that the time is before _endTimestamp.
1134         (results): Returns the processed samples.
1135         (processSamples): Iterate through the sample data and collate them. Include scores.
1136
1137         (FixedComplexityController): Controller that tunes the stage to the desired complexity
1138         prior to starting, and keeps it at that complexity.
1139
1140         (AdaptiveController): Have the estimator estimate the interval frame rate instead of the
1141         raw frame rate.
1142                 The previous version of this controller ignored the frame that came after the
1143         adjustment. The raw FPS show that whatever noise the scene change adds is negligible
1144         compared to the noise of the system overall. Stop ignoring that frame and include all
1145         frames in the measurements.
1146
1147         (Benchmark): Remove dependency on animator, and instantiate a runner based on what is
1148         selected. Most of the loop's functionality is in Controller, so remove here.
1149         (Benchmark.run): Remove start() since it is only called from run(), and fold it in here.
1150         (Benchmark._animateLoop): Fold in from Animator.animateLoop. Let the benchmark run for
1151         a brief period before calling Controller.start().
1152
1153         * Animometer/tests/resources/math.js: Fix the Kalman estimator. The filter estimates
1154         a scalar variable, and makes basic assumptions regarding the model. As a result
1155         none of the linear algebra classes are needed, so remove Matrix, Vector3, and Matrix3.
1156         (SimpleKalmanEstimator): Calculate the gain based on the provided process and
1157         measurement errors.
1158         (KalmanEstimator): Deleted.
1159         (IdentityEstimator): Deleted.
1160         (PIDController): Refactor to use the Utilities.createClass() helper.
1161
1162         The Kalman filter algorithm is explained here http://greg.czerniak.info/guides/kalman1/.
1163         The state, represented by a scalar, is the estimated frame length. There is no user
1164         transition of the state, and the state is the same as the measurement. With this model,
1165         the estimation error converges, so calculate the gain ahead of time.
1166
1167         * Animometer/developer.html: Remove fixed-after-warmup since it is not useful.
1168         Replace the option to toggle the estimator, and make it possible to customize the
1169         estimator's error parameters. Show raw FPS by default, and remove interval FPS,
1170         which will be shown instead of the filtered raw FPS.
1171         * Animometer/resources/debug-runner/animometer.css: Put the header behind the graph.
1172         Remove #intervalFPS rules; move the color to #filteredFPS.
1173         * Animometer/resources/debug-runner/graph.js:
1174         (updateGraphData): Update the hr style to force the layout to be calculated
1175         correctly. Change the tick format to be in terms of seconds, since the timestamps
1176         are in milliseconds. Remove interval data.
1177         * Animometer/resources/runner/animometer.js:
1178         (window.benchmarkController.startBenchmark): Set Kalman parameters.
1179         * Animometer/resources/runner/benchmark-runner.js:
1180         (_runBenchmarkAndRecordResults): When a benchmark completes, expect it to return
1181         the final data, rather than passing a sampler from the controller. This avoids
1182         needing to expose the sampler variable in the benchmark.
1183         * Animometer/tests/resources/sampler.js:
1184         (process): Move the setting of the target frame rate to AdaptiveController.
1185
1186 2016-02-06  Jon Lee  <jonlee@apple.com>
1187
1188         Code clean up: Move Rotater function closer to Stage static methods.
1189         The Rotater is used together with those methods; keep them close.
1190
1191         * Animometer/tests/resources/main.js:
1192
1193 2016-02-06  Jon Lee  <jonlee@apple.com>
1194
1195         Update the JS includes due to ResultsTable move.
1196
1197         * Animometer/developer.html:
1198         * Animometer/index.html:
1199
1200 2016-02-06  Jon Lee  <jonlee@apple.com>
1201
1202         Move createElement and createSVGElement to Utilities.
1203
1204         * Animometer/resources/extensions.js:
1205         (Utilities.createElement): Added.
1206         (Utilities.createSVGElement): Added.
1207         (DocumentExtension.createElement): Deleted.
1208         (DocumentExtension.createSvgElement): Deleted.
1209
1210         * Animometer/resources/debug-runner/animometer.js:
1211         * Animometer/resources/runner/animometer.js:
1212         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
1213         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
1214         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1215
1216 2016-02-06  Jon Lee  <jonlee@apple.com>
1217
1218         Add a convenience function for creating a class.
1219
1220         The pattern for creating a class is common enough to add as a Utilities
1221         helper function. It also makes it easy to collapse class definitions when
1222         editing.
1223
1224         * Animometer/resources/debug-runner/animometer.js: Move ProgressBar definition,
1225         since it is only used here.
1226         * Animometer/resources/runner/animometer.js: Move ResultsDashboard and
1227         ResultsTable definition, since it is only used here.
1228         * Animometer/resources/extensions.js: Move Utilities definition to the top. Convert
1229         Point, Insets, SimplePromise.
1230         (ProgressBar): Moved to animometer.js.
1231         (ResultsDashboard): Moved to animometer.js.
1232         (ResultsTable): Moved to animometer.js.
1233         * Animometer/resources/runner/benchmark-runner.js: Convert BenchmarkRunnerState,
1234         BenchmarkRunner.
1235         * Animometer/tests/resources/main.js: Convert Rotater, Stage, Animator, Benchmark.
1236         * Animometer/tests/resources/sampler.js: Convert Experiment, Sampler.
1237
1238         Convert test primitives.
1239         * Animometer/tests/master/resources/canvas-tests.js: Convert CanvasLineSegment,
1240         CanvasArc, CanvasLinePoint.
1241         * Animometer/tests/simple/resources/simple-canvas-paths.js: Convert CanvasLineSegment,
1242         CanvasLinePoint, CanvasQuadraticSegment, CanvasQuadraticPoint, CanvasBezierSegment,
1243         CanvasBezierPoint, CanvasArcToSegment, CanvasArcToSegmentFill, CanvasArcSegment,
1244         CanvasArcSegmentFill, CanvasRect, CanvasRectFill.
1245         * Animometer/tests/simple/resources/tiled-canvas-image.js: Convert CanvasImageTile.
1246
1247 2016-02-06  Jon Lee  <jonlee@apple.com>
1248
1249         Minor improvements to debug harness.
1250
1251         * Animometer/developer.html:
1252         * Animometer/resources/debug-runner/animometer.css:
1253         (#suites): Put the complexity text boxes closer to the test names.
1254         (#options):
1255         (#rawFPS circle): Make the interval FPS appear as a separate data series, with a line.
1256         (#intervalFPS path):
1257         (#intervalFPS circle):
1258         * Animometer/resources/debug-runner/animometer.js:
1259         (window.optionsManager.updateLocalStorageFromUI): Convert number inputs from text.
1260         (window.suitesManager._onChangeTestCheckbox): Refactor to take a checkbox.
1261         (window.suitesManager._createTestElement): Enhance such that typing into the complexity
1262         input will automatically select that test for running.
1263         (window.suitesManager.updateLocalStorageFromJSON): Make the harness work for private
1264         browsing.
1265         * Animometer/resources/debug-runner/graph.js: Separate the intervalFPS data, and show
1266         more accuracy in timestamps.
1267
1268 2016-02-06  Jon Lee  <jonlee@apple.com>
1269
1270         Refactor helper methods for getting random values for a stage.
1271
1272         Instead of requiring a Stage instance, just attach it to the Stage object.
1273
1274         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
1275         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1276         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1277         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1278         * Animometer/tests/master/resources/canvas-tests.js:
1279         * Animometer/tests/master/resources/particles.js:
1280         * Animometer/tests/misc/resources/canvas-electrons.js:
1281         * Animometer/tests/misc/resources/canvas-stars.js:
1282         * Animometer/tests/misc/resources/compositing-transforms.js:
1283         * Animometer/tests/resources/main.js:
1284         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1285
1286 2016-02-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
1287
1288         Add a new graphics test for CanvasRenderingContext2D functions: getImageData and putImageData
1289         https://bugs.webkit.org/show_bug.cgi?id=151716
1290
1291         Reviewed by Darin Adler.
1292
1293         The purpose of this test is to measure the performance of getImageData
1294         and putImageData functions. This test draws a background on the canvas
1295         and then gets some random tiles from this background and draw them in
1296         destinations different from their original sources.
1297
1298         * Animometer/resources/debug-runner/tests.js: Adding the new test to the canvas simple tests suite.
1299
1300         * Animometer/resources/extensions.js:
1301         (Array.prototype.shuffle): Shuffles the elements of an array.
1302
1303         (Point.zero): Returns a new Point object whose x and y are equal zero.
1304         (Point.prototype.str): Used for debugging the Point object.
1305
1306         * Animometer/tests/simple/resources/tiled-canvas-image.js: Added.
1307         (CanvasImageTile):
1308         (CanvasImageTile.prototype.getImageData):
1309         (CanvasImageTile.prototype.putImageData):
1310         (Stage.call.initialize):
1311         (Stage.call._createTiles):
1312         (Stage.call._nextTilePosition):
1313         (Stage.call.tune):
1314         (Stage.call._drawBackground):
1315         (Stage.call.animate):
1316         (Stage.call.complexity):
1317         (Stage.call):
1318         * Animometer/tests/simple/tiled-canvas-image.html: Added.
1319
1320 2016-01-07  Jon Lee  <jonlee@apple.com>
1321
1322         Fix new test.
1323
1324         * Animometer/resources/runner/tests.js: Wrong URL from an
1325         old patch.
1326         * Animometer/tests/master/particles.html:
1327         * Animometer/tests/master/resources/dom-particles.js:
1328         (Particle.call.reset): Figured out a simpler way to set up
1329         the particles.
1330         (this.move.reset): Deleted.
1331         (this.move._applyAttributes): Deleted.
1332         * Animometer/tests/master/resources/particles.js:
1333         (Particle): Call move() after reset().
1334
1335 2016-01-07  Jon Lee  <jonlee@apple.com>
1336
1337         Update benchmark test suite
1338         https://bugs.webkit.org/show_bug.cgi?id=152679
1339
1340         Reviewed by Simon Fraser.
1341
1342         Add a new test. The test has a rotating background
1343         gradient, and does a better job physically simulating
1344         particles.
1345
1346         * Animometer/resources/extensions.js: Teach Point to take constants as well as other Points.
1347         (Point.prototype.length): Added.
1348         (Point.prototype.normalize): Added.
1349         * Animometer/resources/runner/tests.js: Add the test to the master suite.
1350         * Animometer/tests/master/particles.html: Added.
1351         * Animometer/tests/master/resources/particles.js: Added. Parent class for different kinds of particles.
1352         (Particle):
1353         (Particle.prototype.reset): If the particle starts slowing down in terms of its animation,
1354         reset it.
1355         (Particle.prototype.animate): Bounce off the walls elastically, and include gravity.
1356         (Particle.prototype.move): Subclasses should override.
1357         (ParticlesStage): Stage includes a rotating gradient background.
1358         * Animometer/tests/master/resources/dom-particles.js: Added. Creates a <div> and adds it to
1359         the stage.
1360         * Animometer/tests/resources/star.svg: Added.
1361
1362 2016-01-03  Jon Lee  <jonlee@apple.com>
1363
1364         Update benchmark test suite
1365         https://bugs.webkit.org/show_bug.cgi?id=152679
1366
1367         Reviewed by Simon Fraser.
1368
1369         Move algorithm.js and sampler.js to tests/ and benchmark-runner.js to runner/.
1370
1371         Needed by both harnesses.
1372         * Animometer/resources/runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/resources/debug-runner/benchmark-runner.js.
1373         * Animometer/developer.html:
1374         * Animometer/index.html:
1375
1376         Needed only by the tests. Move to tests/. Statistics, in sampler.js, is used by ResultsDashboard, so move that
1377         into extensions.js.
1378         * Animometer/resources/extensions.js:
1379         * Animometer/tests/resources/algorithm.js: Renamed from PerformanceTests/Animometer/resources/algorithm.js.
1380         * Animometer/tests/resources/sampler.js: Renamed from PerformanceTests/Animometer/resources/sampler.js.
1381         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
1382         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
1383         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
1384         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
1385         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
1386         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
1387         * Animometer/tests/master/canvas-stage.html:
1388         * Animometer/tests/misc/canvas-electrons.html:
1389         * Animometer/tests/misc/canvas-stars.html:
1390         * Animometer/tests/misc/compositing-transforms.html:
1391         * Animometer/tests/simple/simple-canvas-paths.html:
1392         * Animometer/tests/template/template-canvas.html:
1393         * Animometer/tests/template/template-css.html:
1394         * Animometer/tests/template/template-svg.html:
1395         * Animometer/tests/text/layering-text.html:
1396         * Animometer/tests/text/text-boxes.html:
1397
1398 2016-01-07  Jon Lee  <jonlee@apple.com>
1399
1400         Update benchmark test suite
1401         https://bugs.webkit.org/show_bug.cgi?id=152679
1402
1403         Reviewed by Simon Fraser.
1404
1405         Fix tests for other browsers.
1406
1407         * Animometer/resources/extensions.js:
1408         (Point.elementClientSize): Some browsers return 0 for SVG clientWidth and clientHeight.
1409         Use getBoundingClientRect() instead.
1410         * Animometer/tests/misc/resources/canvas-electrons.js:
1411         (CanvasElectron.prototype._draw): Some browsers don't support ellipse.
1412
1413 2016-01-07  Jon Lee  <jonlee@apple.com>
1414
1415         Add a waitUntilReady() step
1416         https://bugs.webkit.org/show_bug.cgi?id=152862
1417
1418         Reviewed by Simon Fraser.
1419
1420         Add a waitUntilReady() callback that lets the benchmark complete
1421         its setup before running the benchmark.
1422
1423         * Animometer/tests/resources/main.js:
1424         (Benchmark.prototype.run): First call waitUntilReady, which returns
1425         a promise. When the promise resolves, run everything that was in this
1426         function.
1427         (Benchmark.prototype.waitUntilReady): Default implementation returns
1428         a resolved promise.
1429         (Benchmark.prototype.resolveWhenFinished): Deleted.
1430         * Animometer/tests/template/resources/template-canvas.js:
1431         (new.TemplateCanvasStage.waitUntilReady): Example on how to override.
1432
1433 2016-01-03  Jon Lee  <jonlee@apple.com>
1434
1435         Update data reporting and analysis
1436         https://bugs.webkit.org/show_bug.cgi?id=152670
1437
1438         Reviewed by Simon Fraser.
1439
1440         Show new graph data. Provide controls to show different series data. Provide an
1441         interactive cursor that shows the data at a given sample.
1442
1443         * Animometer/developer.html: Add a nav section in #results. Each part of the graph
1444         has a checkbox for visual toggling, as well as companion spans to contain the data.
1445                 The numbers will always be shown even if the SVG isn't.
1446         * Animometer/resources/debug-runner/animometer.css:
1447         (#suites): Adjust spacing when doing fixed complexity.
1448         (#test-graph nav): Place the nav in the upper right corner.
1449         (#test-graph-data > svg): Fix the FPS scale from 0-60. It makes the raw FPS goes past
1450         that scale. Allow it to show.
1451         (.target-fps): Add a dotted line for where the benchmark is supposed to settle for FPS.
1452         (#cursor line): The cursor contains a line and highlight circles for the data being shown.
1453         (#cursor circle):
1454         (#complexity path): This and rules afterward are named by series type.
1455         (#complexity circle):
1456         (#filteredFPS path):
1457         (#filteredFPS circle):
1458         (#rawFPS path):
1459         (#intervalFPS circle):
1460         (.left-samples): Deleted.
1461         (.right-samples): Deleted.
1462         * Animometer/resources/debug-runner/animometer.js:
1463         (initialize): Add a "changed" listener when the checkboxes change in the nav.
1464         (onBenchmarkOptionsChanged): Renamed.
1465         (showTestGraph): All graph data is passed in as graphData instead of as arguments.
1466         * Animometer/resources/debug-runner/graph.js: Extend BenchmarkController. When showing
1467         a new graph, call updateGraphData(). It creates all of the d3 graphs. onGraphOptionsChanged()
1468         toggles the data on and off.
1469         (updateGraphData): Add the axes. Add the average lines and markers for sample time and
1470         target FPS. Add the cursor group. Use helper function addData() to add the data. On top of
1471         everything add a transparent area which will catch all of the mouse events. When the mouse
1472         moves in the graph, find the closest data point, show the data in the nav area, and highlight
1473         the data points.
1474         (addData): Adds a line and circle for each data point. Also adds a highlight cursor with a
1475         size a little larger than the circle radius for the data points.
1476         (onGraphOptionsChanged): Called when data is visually toggled.
1477         (showOrHideNodes): Helper function to toggle the .hidden class.
1478         * Animometer/resources/extensions.js:
1479         (ResultsDashboard.prototype.get data): Get rid of the arguments for _processData.
1480         (ResultsTable.prototype._addGraphButton): Shove all of the graph data into a singular object.
1481
1482         Producing the JSON can take a while with all of the data. Make it on-demand with a
1483         button.
1484
1485         * Animometer/resources/debug-runner/animometer.js:
1486         (showResults): When showing the results, don't serialize the JSON data. Move that to...
1487         (showJSONResults): ...here. Remove the button.
1488
1489         * Animometer/developer.html: Add a button. The button will remove itself and populate
1490         the textarea with the JSON data.
1491         * Animometer/resources/debug-runner/animometer.css:
1492         (.hidden): Add a universal hidden class.
1493         (#results button.small-button): Promote the small-button styles to the whole results
1494         section for use in the JSON button.
1495         (#results button.small-button:active):
1496         (#results-data button.small-button): Deleted.
1497         (#results-data button.small-button:active): Deleted.
1498
1499         Refactor how Animator does its recording.
1500
1501         * Animometer/tests/resources/math.js: Create a new, simple estimator that just returns
1502         the same interval frame rate for adjustment.
1503         * Animometer/tests/resources/main.js:
1504         (Animator): Remove _dropFrameCount, and make variables more accurate described.
1505         (Animator.prototype.initialize): Use the identity estimator instead of using a bool.
1506         (Animator.prototype._intervalTimeDelta): Rename, only used internally.
1507         (Animator.prototype._shouldRequestAnotherFrame): Assume we drop one frame for adjustment
1508         of the scene. If we are within the number of frames to measure for the interval, just
1509         record the timestamp. Otherwise we are ready to evaluate and adjust the scene. Record
1510         the interval frame rate and the estimator's frame rate.
1511
1512         Avoid processing the data through the Experiment while the test is running. Reconfigure
1513         the sampler to just record the raw samples. After the test is done, run the samples through
1514         the Experiment to get the score.
1515
1516         * Animometer/resources/sampler.js:
1517         (Experiment): Fold _init() into the constructor since nobody else will call it. This is not
1518         needed until the test concludes, so remove startSampling(). Clients should just call sample().
1519         (Sampler): Pre-allocate arrays given the number of data points being recorded, and a capacity
1520         of how many samples will be used. The processor is a called when it's time to process the data
1521         since that is the client also telling the Sampler what to record.
1522                 Introduce the notion of marks as well, which allows the client to mark when an
1523         event occurs. When we mark sample start, we can attach the timestamp there, instead of storing
1524         it separately.
1525         (Sampler.prototype.startSampling): Deleted. Clients should just call record().
1526         (Sampler.prototype.record): The data to record is passed in as variable arguments.
1527         (Sampler.prototype.mark): When adding a mark, a client needs to provide a unique string, and
1528         can provide extra data object for later retrieval.
1529         (Sampler.prototype.process): Renamed from toJSON. Trim the sampling arrays to what was used.
1530         Call the processor to process the samples.
1531         * Animometer/resources/debug-runner/benchmark-runner.js:
1532         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Call process().
1533
1534         * Animometer/resources/strings.js: Add some new strings, remove the graph ones since they are
1535         not used.
1536         * Animometer/tests/resources/main.js:
1537         (Benchmark): Create a sampler with 4 series. The maximum number of points expected is the
1538         number of seconds multiplied by 60 fps. Benchmark, as a client of the Sampler, knows about all
1539         of the data being added to the Sampler. It is added through record(), and processed through
1540         processSamples().
1541         (Benchmark.prototype.update): Mark when we've passed warmup and are starting to sample. Include
1542         the timestamp in the custom data for the mark. This avoids the need to store is separately in
1543         the Sampler. Fold what was in record() here, since nothing else needs this functionality.
1544         record() now just relays the information to the sampler.
1545         (Benchmark.prototype.record): Called by Animator, which provides the data to the sampler.
1546         Animator's calls to this is part of a later patch. Requires each stage to return its complexity.
1547         (Benchmark.prototype.processSamples): If the sampling mark exists, add it to the results.
1548                 Go through all of the samples. All samples contain a timestamp and complexity. We
1549         calculate "raw FPS" which is the time differential from the previous sample. At regular intervals
1550         the Kalman-filtered FPS and the interval average FPS are also recorded. We also create two
1551         experiments, to get the scores for the complexity and smoothed FPS, and add those samples to
1552         the experiments. Grab those scores and add them into results also.
1553
1554         Add complexity() to the tests for Benchmark.record().
1555         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1556         * Animometer/tests/misc/resources/canvas-electrons.js:
1557         * Animometer/tests/misc/resources/canvas-stars.js:
1558         * Animometer/tests/text/resources/layering-text.js:
1559
1560 2015-12-27  Jon Lee  <jonlee@apple.com>
1561
1562         Simplify the test harness
1563         https://bugs.webkit.org/show_bug.cgi?id=152562
1564
1565         Reviewed by Simon Fraser.
1566
1567         Update the simple canvas tests. For the paths, start from the center instead of the
1568         top-left corner. Instead of using a coordinate limit, use a canonized factor, and
1569         use that along both the x and y axes, so that more capable tests use more of the
1570         canvas.
1571
1572         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1573         (CanvasLinePoint): Rewrite to use the coordinate maximum factor.
1574         (CanvasQuadraticPoint): Ditto.
1575         (CanvasBezierPoint): Ditto.
1576         * Animometer/tests/simple/resources/simple-canvas.js:
1577         (tune): Calculate a factor instead of a maximum coordinate.
1578
1579 2015-12-27  Jon Lee  <jonlee@apple.com>
1580
1581         Simplify the test harness
1582         https://bugs.webkit.org/show_bug.cgi?id=152562
1583
1584         Reviewed by Simon Fraser.
1585
1586         All of the benchmarks use the default Animator(). Don't require new tests
1587         to pass a new instance, and instead just make one in the Benchmark constructor.
1588
1589         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
1590         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
1591         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
1592         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1593         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
1594         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1595         * Animometer/tests/master/resources/canvas-tests.js:
1596         * Animometer/tests/misc/resources/canvas-electrons.js:
1597         * Animometer/tests/misc/resources/canvas-stars.js:
1598         * Animometer/tests/misc/resources/compositing-transforms.js:
1599         * Animometer/tests/resources/main.js:
1600         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1601         * Animometer/tests/template/resources/template-canvas.js:
1602         * Animometer/tests/template/resources/template-css.js:
1603         * Animometer/tests/template/resources/template-svg.js:
1604         * Animometer/tests/text/resources/layering-text.js:
1605         * Animometer/tests/text/resources/text-boxes.js:
1606
1607         Refactor the template.
1608
1609         * Animometer/tests/template/resources/template-canvas.js:
1610         * Animometer/tests/template/resources/template-css.js:
1611         * Animometer/tests/template/resources/template-svg.js:
1612         * Animometer/tests/template/template-canvas.html:
1613         * Animometer/tests/template/template-css.html:
1614         * Animometer/tests/template/template-svg.html:
1615
1616         Refactor the SVG suite.
1617
1618         * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Move scripts to the end.
1619         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto.
1620
1621         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Remove extraneous includes
1622         to stage.js.
1623         * Animometer/tests/text/text-boxes.html: Ditto.
1624
1625         BouncingCanvasParticlesBenchmark is not necessary. Use Benchmark directly when subclassing.
1626         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Remove
1627         BouncingCanvasParticlesBenchmark.
1628         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Use Benchmark.
1629         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Ditto.
1630
1631         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: Require the shape
1632         in the constructor instead of having subclasses set the private variable.
1633
1634         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: Refactor.
1635         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1636
1637         Refactor the HTML suite.
1638
1639         Move scripts to the end.
1640         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
1641         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
1642         * Animometer/tests/text/layering-text.html:
1643         * Animometer/tests/text/text-boxes.html:
1644
1645         Refactor to use the new variables.
1646         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
1647         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1648         * Animometer/tests/text/resources/layering-text.js:
1649         * Animometer/tests/text/resources/text-boxes.js:
1650
1651         Refactor the bouncing canvas tests.
1652
1653         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Move scripts to the end.
1654         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Move scripts to the end.
1655
1656         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Promote a few
1657         properties to "public" since they are used by subclasses.
1658         (BouncingParticlesStage): Fix the constructor, which was missing "this". Make particles
1659         "public" for subclasses.
1660         (BouncingParticlesStage.initialize): Fix the max velocity, which was accidentally changed.
1661         * Animometer/tests/misc/resources/compositing-transforms.js: Refactor.
1662
1663         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
1664         BouncingCanvasParticlesAnimator is no longer needed.
1665         (BouncingCanvasParticle): Change constructor to take a shape as a parameter instead of
1666         having subclasses set the variable.
1667
1668         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Refactor.
1669         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Refactor.
1670
1671         Move example/ files into misc/.
1672
1673         * Animometer/tests/misc/canvas-electrons.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-electrons.html.
1674         * Animometer/tests/misc/canvas-stars.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-stars.html.
1675         * Animometer/tests/misc/resources/canvas-electrons.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-electrons.js.
1676         * Animometer/tests/misc/resources/canvas-stars.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-stars.js.
1677
1678         * Animometer/resources/debug-runner/tests.js: Update test URLs.
1679
1680         Refactor miscellaneous suite.
1681
1682         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1683         Remove BouncingParticlesAnimator and BouncingParticleBenchmark, which are
1684         not needed.
1685         (tune): Remove console assert.
1686         * Animometer/tests/resources/main.js: Add Rotater back in from stage.js.
1687
1688         * Animometer/tests/examples/resources/canvas-electrons.js: Remove CanvasElectronsAnimator.
1689         * Animometer/tests/examples/resources/canvas-stars.js: Remove CanvasStarsAnimator.
1690         * Animometer/tests/misc/resources/compositing-transforms.js:
1691         * Animometer/tests/examples/canvas-electrons.html: Move scripts to the end.
1692         * Animometer/tests/examples/canvas-stars.html: Ditto.
1693         * Animometer/tests/misc/compositing-transforms.html: Ditto.
1694
1695         Refactor the simple suite.
1696
1697         * Animometer/tests/master/resources/canvas-stage.js:
1698         (tune): Remove coordinateMaximum since it is not needed in any
1699         of the master tests.
1700         * Animometer/tests/simple/resources/simple-canvas.js:
1701         SimpleCanvasAnimator and SimpleCanvasBenchmark are no longer
1702         needed.
1703         (tune): Manage the objects differently, but instead of duplicating
1704         all of SimpleCanvasStage here, just replace tune(). Include
1705         coordinateMaximum, and remove items from the end of the list
1706         instead of the beginning.
1707         (StageBenchmark.call.createAnimator): Deleted.
1708         (StageBenchmark.call): Deleted.
1709         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1710         * Animometer/tests/simple/simple-canvas-paths.html: Move
1711         scripts to the end.
1712
1713         Get rid of stage.js, StageAnimator, and StageBenchmark. Don't have the progress bar update during the test.
1714
1715         * Animometer/resources/debug-runner/animometer.js:
1716         (initialize): Move the setting of testsCount to the debug runner.
1717         (didRunTest): Nicer name.
1718         * Animometer/resources/debug-runner/benchmark-runner.js:
1719         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Don't pass in the progress bar to benchmarks.
1720         * Animometer/resources/extensions.js:
1721         (ProgressBar): Refactor. Make variables "private". Resetting the progress when instantiating.
1722         (ProgressBar.prototype.incrementRange): This is called every time a benchmark completes.
1723         * Animometer/resources/runner/animometer.js:
1724         (window.benchmarkRunnerClient.initialize): Remove unneeded setting of testsCount.
1725         * Animometer/resources/strings.js: These are no longer needed.
1726         * Animometer/tests/master/canvas-stage.html: Remove script inclusion. Other tests will follow.
1727         * Animometer/tests/master/resources/canvas-tests.js: Use Benchmark instead of StageBenchmark.
1728         * Animometer/tests/resources/main.js: Messages are no longer needed
1729         (Animator.prototype._shouldRequestAnotherFrame): Rename from animate(), since this method returns a boolean
1730         indicating whether another frame should be requested. Collapse the logic from StageAnimator into animateLoop.
1731         (BenchmarkState.prototype.currentStage): Deleted.
1732         (BenchmarkState.prototype.currentMessage): Deleted.
1733         (BenchmarkState.prototype.currentProgress): Deleted.
1734         (Animator.prototype.animate): Deleted.
1735         (Animator.prototype.animateLoop): The stage is animated only when we have another frame to draw.
1736         (Benchmark.prototype.record): No need to update the progress bar.
1737         * Animometer/tests/resources/stage.js: Removed. Rotater will appear in a later patch, in main.js.
1738
1739         * Animometer/resources/debug-runner/benchmark-runner.js:
1740         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Each test is run as a benchmark.
1741         Remove the call to runBenchmark by merging the options here, and calling benchmark.run()
1742         directly.
1743
1744         Make the class relationships more easily understandable. The benchmark owns the stage,
1745         animator, and options. Make the stage and animator no longer have their own references to
1746         the options. Make Stage a first-class citizen by promoting it to main.js. Later patches
1747         will try to get rid of stage.js altogether.
1748         * Animometer/tests/resources/main.js:
1749         (Stage): Moved from stage.js.
1750         (Animator): Don't pass in benchmark and options in its constructor. It will get initialized
1751         by benchmark-related parameters in initialize().
1752         (Animator.prototype.initialize): Add a back-reference to benchmark and cache an option.
1753         (Animator.prototype.get benchmark):
1754         (Animator.prototype.animate): Refactor to use the cached option, to remove its dependency on
1755         the options dictionary.
1756         (Benchmark): Require all benchmarks to have a stage and animator. The instance will initialize
1757         them.
1758         (Benchmark.prototype.get options):
1759         (Benchmark.prototype.get stage): BenchmarkStates.stages will need to be renamed to avoid confusion.
1760         (Benchmark.prototype.get animator):
1761         (Benchmark.prototype.start):
1762         (Benchmark.prototype.update): Ask the stage directly to tune or clear instead of adding another
1763         level of indirection.
1764         (window.runBenchmark): Deleted. Remove the need for a benchmarkClient. Also remove the standalone
1765         path, since tests can be individually selected, and remove the need for runBenchmark since that is
1766         handled in BenchmarkRunner._runBenchmarkAndRecordResults.
1767         * Animometer/tests/resources/stage.js:
1768         (Stage): Deleted. Moved to main.js.
1769         (StageBenchmark): What's left is updating the progress bar; to be removed.
1770         (StageAnimator): What's left can be folded in Animator.
1771
1772         Refactor master suite.
1773         * Animometer/tests/master/resources/canvas-stage.js: This now only has SimpleCanvasStage.
1774         (animate): Push the clearRect() into each stage.
1775         (complexity):
1776         (StageBenchmark.call.createAnimator): Deleted.
1777         (StageBenchmark.call): Deleted.
1778         * Animometer/tests/master/resources/canvas-tests.js: SimpleCanvasPathStrokeStage is no longer needed.
1779         (CanvasLineSegment.prototype.draw):
1780         (CanvasArc):
1781         (CanvasLinePoint): Remove the draw call because depending on its index it either needs to be moveTo
1782         or lineTo, and it is otherwise a very small draw operation that doesn't need the overhead of the
1783         function call. Do all of the drawing through the stage.
1784
1785         Refactor the subclass pattern. Introduce Utilities.createSubclass().
1786
1787         * Animometer/resources/debug-runner/benchmark-runner.js:
1788         * Animometer/resources/extensions.js:
1789         (window.Utilities.createSubclass): Takes the super class, a function representing
1790         the class's constructor, and additional methods to attach to the new class's
1791         prototype object.
1792         * Animometer/tests/text/text-boxes.html: Remove unneeded reference to utilities.js.
1793
1794         Refactor tests.
1795         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
1796         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
1797         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
1798         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
1799         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1800         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1801         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
1802         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
1803         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1804         * Animometer/tests/examples/resources/canvas-electrons.js:
1805         * Animometer/tests/examples/resources/canvas-stars.js:
1806         * Animometer/tests/master/resources/canvas-stage.js:
1807         * Animometer/tests/master/resources/canvas-tests.js:
1808         * Animometer/tests/misc/resources/compositing-transforms.js:
1809         * Animometer/tests/resources/stage.js:
1810         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1811         * Animometer/tests/simple/resources/simple-canvas.js:
1812         * Animometer/tests/template/resources/template-canvas.js:
1813         * Animometer/tests/template/resources/template-css.js:
1814         * Animometer/tests/template/resources/template-svg.js:
1815         * Animometer/tests/text/resources/layering-text.js: Reorder some of the methods
1816         and properties since they rely on each other.
1817         * Animometer/tests/text/resources/text-boxes.js:
1818
1819         * Animometer/resources/debug-runner/animometer.js: Arrange calls
1820         in the order they are evoked.
1821         * Animometer/resources/debug-runner/benchmark-runner.js:
1822         (BenchmarkRunnerState.prototype.next): Get rid of return value since
1823         no caller to next() uses it.
1824         (BenchmarkRunnerState.prototype.prepareCurrentTest): Refactor the
1825         promise to resolve simply when onload() is called instead of
1826         looking for #stage.
1827         (BenchmarkRunner.prototype._runTestAndRecordResults): Suite.run
1828         simply calls runBenchmark(). Call it directly rather than through
1829         the Suite.
1830         (BenchmarkRunner.prototype.step): Remove unused parameter in
1831         resolve callback.
1832         (BenchmarkRunner.prototype.runMultipleIterations): Use this instead
1833         of self since it is outside of the closure which needed the self
1834         variable.
1835         (resolveIfReady): Deleted.
1836         (BenchmarkRunner.prototype.waitForElement): Deleted.
1837         * Animometer/resources/runner/tests.js: prepare() and run() are
1838         no longer needed.
1839         (Suite.prototype.prepare): Deleted.
1840         (Suite.prototype.run): Deleted.
1841         * Animometer/tests/master/canvas-stage.html: Move all scripts to
1842         the end of the page.
1843
1844 2015-12-23  Simon Fraser  <simon.fraser@apple.com>
1845
1846         Add an Animometer developer test which animates text-rich boxes
1847         https://bugs.webkit.org/show_bug.cgi?id=152544
1848
1849         Reviewed by Zalan Bujtas.
1850
1851         Add a test that draws lots of international text. This is a particle test,
1852         moving the boxes around with absolution positioning.
1853
1854         * Animometer/resources/debug-runner/tests.js:
1855         * Animometer/tests/text/resources/text-boxes.js: Added.
1856         (BouncingTextBox):
1857         (BouncingTextBox.prototype._move):
1858         (BouncingTextBox.prototype.animate):
1859         (BouncingTextBoxStage):
1860         (BouncingTextBoxStage.prototype.createParticle):
1861         (BouncingTextBoxStage.prototype.particleWillBeRemoved):
1862         (BouncingTextBoxsBenchmark):
1863         (BouncingTextBoxsBenchmark.prototype.createStage):
1864         (window.benchmarkClient.create):
1865         * Animometer/tests/text/text-boxes.html: Added.
1866
1867 2015-12-23  Jon Lee  <jonlee@apple.com>
1868
1869         Split benchmark into two different pages
1870         https://bugs.webkit.org/show_bug.cgi?id=152458
1871
1872         Reviewed by Simon Fraser.
1873
1874         Add tests to 'animometer' suite.
1875
1876         * Animometer/resources/runner/tests.js:
1877         * Animometer/tests/master/canvas-stage.html: Added.
1878         * Animometer/tests/master/resources/canvas-stage.js: Added.
1879         * Animometer/tests/master/resources/canvas-tests.js: Added.
1880         * Animometer/tests/master/resources/stage.css: Added.
1881
1882 2015-12-23  Jon Lee  <jonlee@apple.com>
1883
1884         Split benchmark into two different pages
1885         https://bugs.webkit.org/show_bug.cgi?id=152458
1886
1887         Reviewed by Simon Fraser.
1888
1889         Address comments.
1890
1891         * Animometer/resources/debug-runner/benchmark-runner.js:
1892         (BenchmarkRunner.prototype._runTestAndRecordResults): When the testing is complete the frame owning the
1893         sampler goes away, and a later call to get the JSON data is no longer available. Process the data
1894         right here, instead, and just reference it when displaying the results in ResultsDashboard.prototype._processData.
1895         * Animometer/resources/extensions.js:
1896         (Array.prototype.fill.Array.prototype.fill): Add a null check. Remove braces around single-line clause.
1897         (Array.prototype.find.Array.prototype.find): Update the null check.
1898         (ResultsDashboard.prototype._processData): Use the already-processed data.
1899         * Animometer/resources/runner/animometer.css:
1900         (.frame-container > iframe): Remove calc().
1901
1902         Move Array functions to extensions.js since that is included by the harness.
1903         Add ES6 Array polyfills.
1904
1905         * Animometer/resources/algorithm.js:
1906         (Array.prototype.swap): Moved to extensions.js.
1907         * Animometer/resources/extensions.js:
1908         (Array.prototype.swap):
1909         (Array.prototype.fill): Added.
1910         (Array.prototype.find): Added.
1911
1912         Adjust styles for iPad.
1913
1914         * Animometer/resources/runner/animometer.css:
1915         (@media screen and (min-device-width: 768px)): Apply to iPad as well.
1916         (@media screen and (max-device-width: 1024px)): Update width for iPads.
1917
1918         Adjustment styles for iOS.
1919
1920         * Animometer/developer.html: Different divs contain the iframe, so use a class instead and
1921         update the style rules.
1922         * Animometer/index.html:
1923         * Animometer/resources/debug-runner/animometer.css: Remove extraneous rules.
1924         (@media screen and (min-device-width: 1800px)): Move this up.
1925         * Animometer/resources/runner/animometer.css: Add rules to accomodate iOS.
1926
1927         Get rid of prefixed flex properties for now.
1928
1929         * Animometer/resources/debug-runner/animometer.css:
1930         * Animometer/resources/runner/animometer.css:
1931
1932         Update the structure of the harness. Remove the JSON-per-test but keep
1933         the JSON of the whole test run. Use the full page in order to display
1934         the graph.
1935
1936         * Animometer/developer.html: Update several of the JS file includes to UTF-8. Remove header and footer. Test results screen includes score,
1937         average, and worst 5% statistics.
1938         * Animometer/index.html: Make structure similar to developer.html.
1939         * Animometer/resources/debug-runner/animometer.css: Remove most of the
1940         button rules since they are superfluous. Move the progress bar to the
1941         top, fixed. Update the results page rules.
1942         * Animometer/resources/debug-runner/animometer.js: Remove most of the
1943         additions to sectionsManager since they are no longer needed.
1944         (setSectionHeader): Updates header of the section.
1945         (window.suitesManager._updateStartButtonState): Update selector.
1946         (showResults): Add keypress event for selecting different data for
1947         copy/paste. Update how the results are populated. Include full test
1948         JSON in a textarea, rather than requiring a button press.
1949         (showTestGraph):
1950         * Animometer/resources/debug-runner/tests.js: Update structure of Headers. Define different kinds of headers. Headers can control their
1951         title, and the text used as the cell contents, including class name.
1952         * Animometer/resources/extensions.js:
1953         (ResultsTable): Update to include a flattened version of the headers,
1954         used while populating table contents. Remove unneeded helper functions
1955         for creating the table. Rename "show" to "add".
1956         * Animometer/resources/runner/animometer.css: Update rules to
1957         accommodate the new structure.
1958         * Animometer/resources/runner/animometer.js:
1959         (window.sectionsManager.setSectionScore): Helper function to set the
1960         score and mean for a section.
1961         (window.sectionsManager.populateTable): Helper function to set the table.
1962         (window.benchmarkController.showResults): Refactor.
1963         (window.benchmarkController.selectResults): Update selectors.
1964         * Animometer/resources/runner/tests.js: Set Headers. Debug harness
1965         extends it.
1966
1967         Update debug runner to have similar names to the basic runner. Include
1968         that page's CSS and remove extraneous CSS rules.
1969
1970         Get rid of the statistics table #record.
1971
1972         * Animometer/developer.html: Rename #home to #intro. Rename .spacer to hr.
1973         * Animometer/resources/debug-runner/animometer.css: Set to flexbox when selected.
1974         * Animometer/resources/debug-runner/animometer.js: Remove recordTable.
1975         (window.suitesManager._updateStartButtonState): Update selector to #intro.
1976         (setupRunningSectionStyle): Deleted.
1977
1978         * Animometer/resources/runner/animometer.css:
1979         (#test-container.selected): Change to flex-box only when visible.
1980
1981         Remove recordTable.
1982         * Animometer/resources/debug-runner/benchmark-runner.js:
1983         (BenchmarkRunner.prototype._runTestAndRecordResults):
1984         * Animometer/resources/runner/tests.js:
1985         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
1986         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
1987         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
1988         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
1989         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1990         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1991         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
1992         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1993         * Animometer/tests/examples/resources/canvas-electrons.js:
1994         * Animometer/tests/examples/resources/canvas-stars.js:
1995         * Animometer/tests/misc/resources/compositing-transforms.js:
1996         * Animometer/tests/resources/main.js:
1997         * Animometer/tests/resources/stage.js:
1998         (StageBenchmark): Remove _recordTable.
1999         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2000         * Animometer/tests/simple/resources/simple-canvas.js:
2001         * Animometer/tests/template/resources/template-canvas.js:
2002         * Animometer/tests/template/resources/template-css.js:
2003         * Animometer/tests/template/resources/template-svg.js:
2004         * Animometer/tests/text/resources/layering-text.js:
2005
2006         * Animometer/resources/debug-runner/animometer.js:
2007         (willStartFirstIteration): Fix selector, since results-table is used
2008         in multiple places, so it cannot be an id.
2009
2010         Make it possible to select the scores, or the whole table data,
2011         by cycling through different selections through key press of 's'.
2012
2013         * Animometer/resources/runner/animometer.js:
2014         (window.benchmarkController.showResults): Attach a keypress handler
2015         if it hasn't been added already.
2016         (window.benchmarkController.selectResults):
2017         * Animometer/resources/runner/tests.js: Cycle through different
2018         ranges.
2019
2020         Fix a few fly-by errors.
2021
2022         * Animometer/resources/debug-runner/benchmark-runner.js:
2023         (BenchmarkRunnerState.prototype.prepareCurrentTest): Update the frame relative path
2024         since the files are now in the top directory instead of inside runner/.
2025         (BenchmarkRunner.prototype._runTestAndRecordResults): Incorrect reference to function.
2026         (BenchmarkRunner.prototype.step): Member variable is never used.
2027
2028         A little stylistic cleanup.
2029
2030         * Animometer/resources/debug-runner/benchmark-runner.js:
2031         * Animometer/resources/extensions.js:
2032         (window.DocumentExtension.createElement):
2033         * Animometer/tests/resources/main.js:
2034         (Benchmark.prototype.record):
2035         * Animometer/tests/resources/stage.js:
2036         (StageBenchmark.prototype.showResults): Reverse progress and message.
2037         The message appears less frequently than the progress.
2038         * Animometer/tests/simple/resources/simple-canvas.js:
2039         (SimpleCanvasBenchmark): Remove unused options.
2040
2041         Add newer version of harness in a new page. Consolidate differences between the two
2042         pages.
2043
2044         * Animometer/developer.html: Include runner/animometer.js. Rename the JS function
2045         to run the benchmark to startBenchmark() instead of startTest(). Rename #running to
2046         #test-container.
2047         * Animometer/index.html: Added. Similarly calls startBenchmark() and has #test-container.
2048         * Animometer/resources/debug-runner/animometer.css: Make the canvas 2:1 (1200px x 800px)
2049         instead of 4:3.
2050
2051         Split out benchmarkRunnerClient and benchmarkController.
2052
2053         * Animometer/resources/debug-runner/animometer.js: Move needed functions out of
2054         benchmarkRunnerClient, and leave the rest here to extend that object. Get rid of _resultsTable
2055         and move populating the results table into benchmarkController. Rename _resultsDashboard
2056         to results and make it accessible for other objects to use.
2057         (willAddTestFrame): This is unnecessary. Remove.
2058
2059         (window.sectionsManager.showScore): Grab it from the results object instead of
2060         benchmarkRunnerClient.
2061         (window.sectionsManager.showSection): Deleted. Moved to runner/animometer.js.
2062
2063         (window.benchmarkController._runBenchmark): Deleted. Mostly moved into _startBenchmark.
2064         (window.benchmarkController.startBenchmark): Refactor to call _startBenchmark.
2065         (window.benchmarkController.showResults): Include most of benchmarkRunnerClient.didFinishLastIteration()
2066         here.
2067
2068         * Animometer/resources/debug-runner/benchmark-runner.js:
2069         (BenchmarkRunner.prototype._appendFrame): Remove unneeded call to willAddTestFrame.
2070         * Animometer/resources/extensions.js:
2071         (ResultsDashboard): Change the class to process the sampler data on-demand and hold onto that data
2072         for later referencing.
2073         (ResultsDashboard.prototype.toJSON): Deleted.
2074         (ResultsDashboard.prototype._processData): Rename toJSON to _processData since it's not really
2075         outputting JSON. Store the processed data into a member variable that can be referenced later.
2076         (ResultsDashboard.prototype.get data): Process the data if it hasn't already.
2077         (ResultsDashboard.prototype.get score): Process the data if it hasn't already, then return the
2078         aggregate score.
2079         (ResultsTable.prototype._showHeader): When outputting the results to a table, don't force the
2080         need for an empty children array. This was to allow for a header row in the table that spanned
2081         multiple columns. In the simpler harness, this is not needed.
2082         (ResultsTable.prototype._showEmptyCells):
2083         (ResultsTable.prototype._showTest): This hardcoded the columns. At least for the name and score,
2084         which is the bare minimum needed for the simpler harness, key off of the header name provided.
2085         * Animometer/resources/runner/animometer.css: Added. Use a similar 2:1 ratio. The score tables are
2086         split into the data and the headers, and are also displayed RTL so that a later patch allows a
2087         user to copy-paste the data easily.
2088         * Animometer/resources/runner/animometer.js: Added. Use a simpler version of benchmarkRunnerClient.
2089         The debug harness will extend these classes.
2090         (window.benchmarkController._startBenchmark): Used by both harnesses.
2091         (window.benchmarkController.startBenchmark): Set hard-coded options.
2092         (window.benchmarkController.showResults): Includes most of benchmarkRunnerClient.didFinishLastIteration()
2093         here.
2094
2095         Get rid of utilities.js. Move it all into extensions.js.
2096
2097         * Animometer/resources/extensions.js:
2098         * Animometer/tests/resources/utilities.js: Removed.
2099
2100         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Remove script link.
2101         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Ditto.
2102         * Animometer/tests/bouncing-particles/bouncing-css-images.html: Ditto.
2103         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: Ditto.
2104         * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Ditto.
2105         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto.
2106         * Animometer/tests/examples/canvas-electrons.html: Ditto.
2107         * Animometer/tests/examples/canvas-stars.html: Ditto.
2108         * Animometer/tests/misc/compositing-transforms.html: Ditto.
2109         * Animometer/tests/simple/simple-canvas-paths.html: Ditto.
2110         * Animometer/tests/template/template-canvas.html: Ditto.
2111         * Animometer/tests/template/template-css.html: Ditto.
2112         * Animometer/tests/template/template-svg.html: Ditto.
2113         * Animometer/tests/text/layering-text.html: Ditto.
2114
2115         Split tests.js into two. Add a new suite to runner/tests.js.
2116
2117         * Animometer/developer.html: Update the script order. Scripts from
2118         debug-runner/ will always build on those from runner/, and have the
2119         same name.
2120         * Animometer/resources/debug-runner/tests.js: Move "complex examples"
2121         suite into "miscellaneous tests".
2122         (Suite): Deleted.
2123         (Suite.prototype.prepare): Deleted.
2124         (Suite.prototype.run): Deleted.
2125         (suiteFromName): Deleted.
2126         * Animometer/resources/runner/tests.js: Added. Take definitions and
2127         functions needed by the test harness. Leave the test suites behind.
2128         (Suite): Moved from debug script.
2129         (Suite.prototype.prepare): Ditto.
2130         (Suite.prototype.run): Ditto.
2131         (suiteFromName): Ditto.
2132         (testFromName): Ditto.
2133
2134         Move benchmark resources out into resources/debug-runner, and update URLs.
2135
2136         * Animometer/developer.html: Renamed from PerformanceTests/Animometer/runner/animometer.html.
2137         * Animometer/resources/debug-runner/animometer.css: Renamed from PerformanceTests/Animometer/runner/resources/animometer.css.
2138         * Animometer/resources/debug-runner/animometer.js: Renamed from PerformanceTests/Animometer/runner/resources/animometer.js.
2139         * Animometer/resources/debug-runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/runner/resources/benchmark-runner.js.
2140         * Animometer/resources/debug-runner/d3.min.js: Renamed from PerformanceTests/Animometer/runner/resources/d3.min.js.
2141         * Animometer/resources/debug-runner/graph.js: Renamed from PerformanceTests/Animometer/runner/resources/graph.js.
2142         * Animometer/resources/debug-runner/tests.js: Renamed from PerformanceTests/Animometer/runner/resources/tests.js.
2143
2144 2015-12-11  Jon Lee  <jonlee@apple.com>
2145
2146         Improve Animometer on iOS
2147         https://bugs.webkit.org/show_bug.cgi?id=152180
2148
2149         Reviewed by Simon Fraser.
2150
2151         Improve experience on phones. Make the canvas take
2152         up the whole screen.
2153
2154         * Animometer/runner/animometer.html: Add meta viewport.
2155         Remove the container div.
2156         * Animometer/runner/resources/animometer.css: Have buttons lay
2157         out vertically. Update detail arrow glyph. Make the suites and
2158         options section lay out vertically. Remove the top spacers since
2159         we want the canvas to take over the whole screen. Minimal display
2160         is recommended for use.
2161
2162 2015-12-07  Jon Lee  <jonlee@apple.com>
2163
2164         Update suites for benchmark
2165         https://bugs.webkit.org/show_bug.cgi?id=151957
2166
2167         Reviewed by Simon Fraser.
2168
2169         * Animometer/runner/animometer.html: Use spacers instead of relying on
2170         justify-content center to center the content. That allows the opening screen
2171         to grow downward when expanding the list of choices, otherwise it expands
2172         from the center, and off the top edge of the screen.
2173         * Animometer/runner/resources/animometer.css:
2174         (.tree): Don't overflow scroll.
2175         (.tree > li > label.tree-label:before): Use better glyphs.
2176         (.tree > li > :checked ~ label.tree-label:before):
2177         (main): Using flex-start for justify-content so that if the section grows too
2178         big it gets pinned to the top edge of the document instead of growing past it.
2179         (.spacer): Make the spacers have a minimum 20px and grow evenly.
2180         (section#home): Add a min-height so that the border will expand if the suite
2181         tests shown make the section grow past the height.
2182         * Animometer/runner/resources/animometer.js: Update the selectors.
2183         (window.suitesManager._treeElement):
2184         (window.suitesManager._suitesElements):
2185         (window.suitesManager._editsElements):
2186
2187 2015-12-07  Jon Lee  <jonlee@apple.com>
2188
2189         Update options for benchmark
2190         https://bugs.webkit.org/show_bug.cgi?id=151956
2191
2192         Reviewed by Simon Fraser.
2193
2194         Move "Fix test complexity" and "Adaptive" checkboxes into a radio group.
2195
2196         Move "Show running results" into a radio group, and add options to remove the HUD.
2197
2198         * Animometer/runner/animometer.html: Get rid of the preamble. Wrap the options
2199         in a form for easier referencing in JS.
2200         * Animometer/runner/resources/animometer.css: Show the surrounding border if the
2201         body's display-minimal class name is set.
2202         * Animometer/runner/resources/animometer.js:
2203
2204         Update the way optionsManager gets and sets default values. Include support for
2205         radio groups.
2206         (window.optionsManager.valueForOption):
2207         (window.optionsManager.updateUIFromLocalStorage):
2208         (window.optionsManager.updateLocalStorageFromUI):
2209
2210         (window.benchmarkRunnerClient.willStartFirstIteration):
2211         (window.sectionsManager.setupRunningSectionStyle):
2212         (window.suitesManager._treeElement): Fly-by whitespace fix.
2213         (window.suitesManager._suitesElements): Ditto.
2214         (window.suitesManager.updateEditsElementsState): Update options check.
2215         (window.suitesManager.updateDisplay): Add a new update function for the HUD.
2216         Attach a class to the body depending on the user's choice.
2217         (window.benchmarkController.initialize): Add an event listener when the form
2218         radio buttons update.
2219         (window.benchmarkController.onFormChanged):
2220         (window.optionsManager._optionsElements): Deleted.
2221         (window.optionsManager._adaptiveTestElement): Deleted.
2222         (window.benchmarkController.onChangeAdaptiveTestCheckbox): Deleted.
2223         * Animometer/tests/resources/main.js:
2224         (Benchmark.prototype.update): Update options checks.
2225         * Animometer/tests/resources/stage.js: Update option check.
2226         (StageBenchmark.prototype.showResults):
2227
2228 2015-12-01  Simon Fraser  <simon.fraser@apple.com>
2229
2230         Add a basic compositing Animometer test
2231         https://bugs.webkit.org/show_bug.cgi?id=151724
2232
2233         Reviewed by Dean Jackson.
2234
2235         Add a "bouncing particles" test that moves composited layers around, optionally with a filter.
2236
2237         This is added under a new "Miscellaneous" category.
2238
2239         Remove the test templates category from the UI.
2240
2241         * Animometer/runner/resources/tests.js:
2242         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2243         (BouncingCssShape.prototype.animate):
2244         * Animometer/tests/misc/compositing-transforms.html: Added.
2245         * Animometer/tests/misc/resources/compositing-transforms.js: Added.
2246         (BouncingCompositedImage):
2247         (BouncingCompositedImage.prototype._move):
2248         (BouncingCompositedImage.prototype.animate):
2249         (CompositingTransformsStage):
2250         (CompositingTransformsStage.prototype.createParticle):
2251         (CompositingTransformsStage.prototype.particleWillBeRemoved):
2252         (CompositedTransformsBenchmark):
2253         (CompositedTransformsBenchmark.prototype.createStage):
2254         (window.benchmarkClient.create):
2255
2256 2015-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
2257
2258         Fix the graphics benchmark complexity bounds adjustment
2259         https://bugs.webkit.org/show_bug.cgi?id=151670
2260
2261         Reviewed by Simon Fraser.
2262
2263         Make sure the graphics benchmark complexity bounds adjustment is applied
2264         to the absolute lower bound.
2265
2266         * Animometer/tests/resources/math.js:
2267         (PIDController.prototype._saturate):
2268
2269 2015-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
2270
2271         Add an option to select the results form the graphics benchmark
2272         https://bugs.webkit.org/show_bug.cgi?id=151666
2273
2274         Reviewed by Ryosuke Niwa.
2275
2276         We need an easy way to select the graphics benchmark results table such
2277         that when it is copied to the clipboard, rich text format is set to the
2278         clipboard.
2279
2280         * Animometer/runner/animometer.html: Add a new button to select the results table or JSON.
2281
2282         * Animometer/runner/resources/animometer.js:
2283         (window.sectionsManager._sectionDataElement): Selects the container <data> element.
2284         (window.sectionsManager._sectionDataDivElement): Replace a literal string with a string table entry.
2285         (window.sectionsManager.showTestName): Replace a literal string with a string table entry.
2286         (window.sectionsManager.selectData): Selects the container <data> element in a selection.
2287         (window.sectionsManager.selectDataContents): Select the contents of container <data> element in a selection.
2288         (window.benchmarkController.selectResults): Selects the results table.
2289         (window.benchmarkController.showJSON): Function rename.
2290         (window.benchmarkController.selectJSON): Selects the contents of the results JSON.
2291         (window.benchmarkController.showJson): Deleted.
2292
2293 2015-11-20  Simon Fraser  <simon.fraser@apple.com>
2294
2295         Animometer: graphs should not do interpolation
2296         https://bugs.webkit.org/show_bug.cgi?id=151526
2297
2298         Reviewed by Simon Fraser.
2299
2300         Having the graphs do interpolation is misleading, because you can't see the actual data.
2301
2302         Also remove "shape-rendering: crispEdges;" so the lines get antialiased.
2303
2304         * Animometer/runner/resources/animometer.css:
2305         (section#test-graph > data > svg): Deleted.
2306         * Animometer/runner/resources/graph.js:
2307         (graph): Deleted.
2308
2309 2015-11-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
2310
2311         Calculate the graphics benchmark test gain adaptively
2312         https://bugs.webkit.org/show_bug.cgi?id=151208
2313
2314         Reviewed by Darin Adler.
2315
2316         We need to calculate the gain of the graphics benchmark tests adaptively
2317         and get rid of the gain and limits parameters we have to choose manually
2318         for every test. We are going to use the classic Ziegler–Nichols method for
2319         calculating the gain and integral and derivative times. We are going to
2320         try moving on a cubic curve during the manual stage from y0 to reach ysp.
2321         We also going to use a saturation actuator to ensure the system does not
2322         fluctuate.
2323
2324         * Animometer/resources/extensions.js:
2325         (ResultsTable.prototype._isNoisyMeasurement): Fix a parameter name.
2326         (ResultsTable.prototype._isNoisyTest): Since score is a member of testResults, we need to limit our search to frame rate and complexity.
2327         (ResultsTable.prototype._showTest): Pass the correct parameter to _isNoisyMeasurement().
2328
2329         * Animometer/resources/strings.js: Fix the indentation and name and value of a string.
2330
2331         * Animometer/runner/resources/tests.js: Remove all the manual gains and limits parameters which had to be passed to every test.
2332
2333         * Animometer/tests/resources/main.js:
2334         (BenchmarkState.prototype.currentStage): Fix an enum name.
2335         (Benchmark): Get rid of manual gain and limits.
2336         (Benchmark.prototype.update): Simplify the calculation by having all the times in ms.
2337
2338         * Animometer/tests/resources/math.js:
2339         (PIDController): Get rid of the manual gain and limits and the magic numbers for Ti and Td.
2340         (PIDController.prototype._yPosition): Tells whether the test current output is moving towards the set-point or away from it.
2341         (PIDController.prototype._distanceUltimate): Calculates the ultimate distance from y0 after time t using a cubic formula.
2342         (PIDController.prototype._distance): Calculates the distance of y relative to y0.
2343         (PIDController.prototype._gainIncrement): Decides how much the proportional gain should be increased during the manual gain stage.
2344         (PIDController.prototype._updateStage): Updates the stage of the controller based on its current stage and the system output.
2345         (PIDController.prototype._tuneP): Tunes the system before calculating the PID controller gains.
2346         (PIDController.prototype._tunePID): PID tuning function.
2347         (PIDController.prototype._tune):
2348         (PIDController.prototype._saturate):
2349         (PIDController.prototype.tune): Manages calculating the controller parameters. It then returns a PID tuning value.
2350         (PIDController.prototype._sat): Deleted. We may need to return it back but the limits have to be calculated adaptively not manually.
2351
2352 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
2353
2354         Reorganize the graphics benchmark string table
2355         https://bugs.webkit.org/show_bug.cgi?id=151334
2356
2357         Reviewed by Simon Fraser.
2358
2359         Make the graphics benchmark string table be an object of sub-objects. Each
2360         sub-object represents an associative array, the key is the string name and
2361         the value is the string data.
2362
2363         * Animometer/resources/extensions.js:
2364         (ResultsDashboard.prototype.toJSON):
2365         (ResultsTable.prototype._showGraph):
2366         (ResultsTable.prototype._showJSON):
2367         (ResultsTable.prototype._isNoisyMeasurement):
2368         (ResultsTable.prototype._isNoisyTest):
2369         (ResultsTable.prototype._showTest):
2370         (ResultsTable.prototype._showSuite):
2371         (ResultsTable.prototype._showIteration):
2372         * Animometer/resources/sampler.js:
2373         (Sampler.prototype.toJSON):
2374         * Animometer/resources/strings.js:
2375         * Animometer/runner/resources/animometer.js:
2376         (window.benchmarkRunnerClient.didFinishLastIteration):
2377         (window.suitesManager.updateLocalStorageFromJSON):
2378         (window.benchmarkController.showResults):
2379         (window.benchmarkController.showJson):
2380         (window.benchmarkController.showTestGraph):
2381         (window.benchmarkController.showTestJSON):
2382         * Animometer/runner/resources/tests.js:
2383         * Animometer/tests/resources/main.js:
2384
2385 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
2386
2387         Disable flattening the stage iframe of the graphics benchmark when running on iOS
2388         https://bugs.webkit.org/show_bug.cgi?id=151361
2389
2390         Reviewed by Simon Fraser.
2391
2392         Use fixed size for stage iframe of the graphics benchmark to disable
2393         flattening the iframe while animating the particles. Also ensure the
2394         bouncing particles do not go outside the iframe's boundaries.
2395
2396         * Animometer/runner/resources/animometer.css:
2397         (section#running > #running-test > iframe):
2398         (@media screen and (min-device-width: 1800px)):
2399         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2400         (BouncingParticle.prototype.animate):
2401
2402 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
2403
2404         Use the media queries to dynamically set the stage for the graphics benchmark
2405         https://bugs.webkit.org/show_bug.cgi?id=151327
2406
2407         Reviewed by Simon Fraser.
2408
2409         Clean setting the benchmark css rules by using the media queries. Accessing
2410         document.stylesheets.cssRules seems to be unreliable. Fix the test harness
2411         load event listener invocation. And also remove the options for normalizing
2412         the stage resolution for retina display.
2413
2414         * Animometer/resources/extensions.js:
2415         (window.DocumentExtension.insertCssRuleAfter): Deleted.
2416         * Animometer/runner/animometer.html:
2417         * Animometer/runner/resources/animometer.css:
2418         (@media screen and (min-device-width: 1800px)):
2419         * Animometer/runner/resources/animometer.js:
2420         (window.sectionsManager.setupRunningSectionStyle):
2421         (window.benchmarkController.initialize):
2422         (window.sectionsManager.setupSectionStyle): Deleted.
2423         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2424         (BouncingParticlesStage):
2425         * Animometer/tests/text/layering-text.html:
2426         * Animometer/tests/text/resources/layering-text.js:
2427         (LayeringTextStage):
2428         (LayeringTextStage.prototype._setFontSize): Deleted.
2429
2430 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2431
2432         Remove the option for animating using setInterval from the graphics benchmark
2433         https://bugs.webkit.org/show_bug.cgi?id=151283
2434
2435         Reviewed by Darin Adler.
2436
2437         Get rid of the option to run animation using setInterval().
2438
2439         * Animometer/tests/resources/main.js:
2440         (Animator.prototype.animate):
2441         (Benchmark):
2442         (Benchmark.prototype.start):
2443         (Animator.prototype.start): Deleted.
2444
2445 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2446
2447         Highlight the alarming test results in the graphics benchmark results page
2448         https://bugs.webkit.org/show_bug.cgi?id=151286
2449
2450         Reviewed by Simon Fraser.
2451
2452         When showing the results of a test in the graphics benchmark the following
2453         criteria is going to be applied:
2454
2455         1. If the standard deviation of the test complexity or the frame rate is
2456            equal to or more than 10%, the standard deviation and the test name
2457            will be displayed in red.
2458         2. If the average frame rate is not in the range = [(desired_frame_rate - 2)
2459            .. (desired_frame_rate + 2)], the average frame rate and the test name will
2460            be displayed in red.
2461
2462         * Animometer/resources/extensions.js:
2463         (ResultsTable.prototype._showHeaderRow):
2464         (ResultsTable.prototype._showHeader):
2465         (ResultsTable.prototype._showEmptyCell):
2466         (ResultsTable.prototype._showText):
2467         (ResultsTable.prototype._showFixedNumber):
2468         (ResultsTable.prototype.):
2469         (ResultsTable.prototype._showGraph):
2470         (ResultsTable.prototype._showJSON):
2471         (ResultsTable.prototype._isAlarmingMeasurement):
2472         (ResultsTable.prototype._isAlarmingTestResults):
2473         (ResultsTable.prototype._showEmptyCells):
2474         (ResultsTable.prototype._showEmptyRow):
2475         (ResultsTable.prototype._showTest):
2476         (ResultsTable.prototype._showSuite):
2477         (ResultsTable.prototype._showIteration):
2478         (ResultsTable.prototype.showRecord):
2479         (ResultsTable.prototype.showIterations):
2480         (ResultsTable.prototype._showEmpty): Deleted.
2481         * Animometer/runner/resources/animometer.js:
2482         (window.benchmarkRunnerClient.didFinishLastIteration):
2483         * Animometer/tests/resources/stage.js:
2484         (StageBenchmark.prototype.showResults):
2485
2486 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2487
2488         Clean referencing the options object in the graphics benchmark
2489         https://bugs.webkit.org/show_bug.cgi?id=151284
2490
2491         Reviewed by Simon Fraser.
2492
2493         Get rid of the Benchmark.options member and rely only on the private member
2494         Benchmark._options. The animator need to have its own options member instead
2495         of accessing it from its reference to Benchmark object.
2496
2497         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
2498         (BouncingCanvasParticlesAnimator):
2499         (BouncingCanvasParticlesBenchmark.prototype.createAnimator):
2500         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2501         (BouncingParticle.prototype.animate):
2502         (BouncingParticlesAnimator):
2503         (BouncingParticlesBenchmark.prototype.createAnimator):
2504         * Animometer/tests/examples/resources/canvas-electrons.js:
2505         (CanvasElectronsStage.prototype.animate):
2506         (CanvasElectronsAnimator):
2507         (CanvasElectronsBenchmark.prototype.createAnimator):
2508         (window.benchmarkClient.create):
2509         * Animometer/tests/examples/resources/canvas-stars.js:
2510         (CanvasStarsStage.prototype.animate):
2511         (CanvasStarsAnimator):
2512         (CanvasStarsBenchmark.prototype.createAnimator):
2513         (window.benchmarkClient.create):
2514         * Animometer/tests/resources/main.js:
2515         (BenchmarkState.prototype.currentProgress):
2516         (Animator):
2517         (Animator.prototype.animate):
2518         (Benchmark):
2519         (Benchmark.prototype.update):
2520         * Animometer/tests/resources/stage.js:
2521         (Stage.prototype.clear):
2522         (StageAnimator):
2523         (StageBenchmark.prototype.createAnimator):
2524         (StageBenchmark.prototype.tune):
2525         (StageBenchmark.prototype.showResults):
2526         * Animometer/tests/simple/resources/simple-canvas.js:
2527         (SimpleCanvasStage.prototype.animate):
2528         (SimpleCanvasAnimator):
2529         (SimpleCanvasAnimator.prototype.animate):
2530         (SimpleCanvasBenchmark.prototype.createAnimator):
2531         * Animometer/tests/template/resources/template-canvas.js:
2532         (TemplateCanvasStage.prototype.animate):
2533         (TemplateCanvasBenchmark.prototype.createAnimator):
2534         (window.benchmarkClient.create):
2535
2536 2015-11-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
2537
2538         Eliminate a request for layout every time an item is added to the stage of the graphics benchmark
2539         https://bugs.webkit.org/show_bug.cgi?id=151289
2540
2541         Reviewed by Simon Fraser.
2542
2543         Cache the stage size when it is created instead of requesting every time
2544         an object is added via clientWidth and clientHeight.
2545
2546         * Animometer/resources/extensions.js:
2547         (Insets.elementPadding):
2548         * Animometer/tests/resources/stage.js:
2549         (Stage):
2550         (Stage.prototype.get size):
2551
2552 2015-11-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
2553
2554         Initialize the graphics benchmark's Kalman filter with estimated 60 FPS
2555         https://bugs.webkit.org/show_bug.cgi?id=150965
2556
2557         Reviewed by Darin Adler.
2558
2559         This should give the benchmark more accurate reading at warmup time. And
2560         hence we can safely reduce the test running time to be 10 seconds.
2561
2562         * Animometer/runner/animometer.html:
2563         Add "defer" back when loading resources/animometer.js since this script
2564         depends on many other scripts and we need to wait till the page is parsed.
2565         Also change the default test interval to be 10 seconds.
2566
2567         * Animometer/runner/resources/graph.js:
2568         (graph): Make the test results curves smoother.
2569
2570         * Animometer/tests/resources/main.js:
2571         (Animator): Initialize the Kalman filter with 60 FPS which should be true
2572         if the test page is empty.
2573
2574         (Animator.prototype.animate):
2575         * Animometer/tests/resources/math.js:
2576         (KalmanEstimator): Fix the initial value of _vecX_est.
2577             _vecX_est[0] = current FPS (= 60FPS when the test page is empty)
2578             _vecX_est[1] = first time derivative of FPS (=0; FPS has been constant).
2579             _vecX_est[2] = second time derivative of FPS (=0; since _vecX_est[1]=0).
2580         (KalmanEstimator.prototype.estimate): Add some comments.
2581
2582 2015-11-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
2583
2584         Remove "defer" from the scripts' references in the graphics benchmark home page
2585         https://bugs.webkit.org/show_bug.cgi?id=150915
2586
2587         Reviewed by Simon Fraser.
2588
2589         It causes the benchmark to be very flakey.
2590
2591         * Animometer/runner/animometer.html:
2592
2593 2015-11-01  Said Abou-Hallawa  <sabouhallawa@apple,com>
2594
2595         Add an option to make the graphics benchmark runs a specific test with fixed complexity
2596         https://bugs.webkit.org/show_bug.cgi?id=150529
2597
2598         Reviewed by Darin Adler.
2599
2600         Beside each test in the suites tree, we are going to show the complexity
2601         arithmetic mean of the of the last run in an edit control. Based on a
2602         new option these edit controls will all be visible or hidden. If they are
2603         visible their values can be changed. The benchmark runner if it run in
2604         the non-adaptive mode will set the complexity of the test to the passed
2605         value and will not change it ever. The animator will animate the test and
2606         frame rate will also be measured.
2607
2608         * Animometer/runner/animometer.html: Add a new option for the non-adaptive mode.
2609
2610         * Animometer/runner/resources/animometer.css:
2611         (section#home input[type="number"]): Define the width of all the edit control in the <home> section.
2612         (section#home > suites input[type="number"]): The edit controls in the <suites> box will be right aligned and hidden by default.
2613         (section#home > suites input[type="number"].selected): When the class "selected" is added, the edit controls will be visible.
2614         (section#home > options > label > input[type="number"]): Deleted.
2615
2616         * Animometer/runner/resources/animometer.js:
2617         (window.benchmarkRunnerClient.didFinishLastIteration): Update the local storage with the results of each test.
2618         (window.optionsManager._adaptiveTestElement): Returns the checkbox for setting the adaptive test option.
2619         (window.suitesManager._editElement):  Returns the edit element associated with each test element in the suites tree.
2620         (window.suitesManager._editsElements): Returns a list of all the elements in the <suites> box.
2621         (window.suitesManager._localStorageNameForTest): Change this function to take strings.
2622         (window.suitesManager._createTestElement): Adds an edit control beside each test.
2623         (window.suitesManager.updateEditsElementsState): Adds/Removes the 'selected' class to/from all the tests edit elements.
2624         (window.suitesManager.updateUIFromLocalStorage): Reads the edit control value from the local storage.
2625         (window.suitesManager.updateLocalStorageFromUI): Saves the edit control value to the local storage.
2626         (window.suitesManager.updateLocalStorageFromJSON): Saves the last run results to the local storage.
2627         (window.benchmarkController.initialize): Shows/Hides the test edit controls based on the adaptive test option.
2628         (window.benchmarkController.onChangeAdaptiveTestCheckbox): An onchange event handler for the adaptive test checkbox.
2629
2630         * Animometer/tests/resources/main.js:
2631         (Benchmark.prototype.update): Fix the complexity of the test if the running mode is non-adaptive test and desired complexity is not zero.
2632         (window.runBenchmark): Add the test complexity as a new benchmark option.
2633
2634 2015-11-01  Said Abou-Hallawa  <sabouhallawa@apple,com>
2635
2636         Make the size of the benchmark canvas adaptive to the screen size and screen resolution
2637         https://bugs.webkit.org/show_bug.cgi?id=150530
2638
2639         Reviewed by Darin Adler.
2640
2641         We want to set the size of the benchmark stage dynamically such that it
2642         depends on the screen resolution and the device scale factor. This patch
2643         does more than that because the home page css was not done properly. To
2644         use the flex box layout, the animometer.css has to be rewritten almost from
2645         scratch. The suites tree has to be rewritten also because it was not collapsing
2646         and with the flex box layout it was going outside of the window area. The
2647         options handling and the local storage handling had to be rewritten to
2648         allow more flexibility with this patch and the future patches. The code
2649         in animometer.js was reorganized into objects to allow distributing the code
2650         nicely among separate entities.
2651
2652         * Animometer/resources/extensions.js:
2653         (Point.elementClientSize): Returns the client size of an HTMLElement as a Point object.
2654         (Insets.prototype.get width): Follow the function opening brace style guidelines.
2655         (Insets.prototype.get height):
2656         (Insets.prototype.get size): Returns the size of an Insets as a Point object.
2657
2658         (window.DocumentExtension): Provides document helper functions. It should be assailable from the runner and the tests.
2659         (window.DocumentExtension.createElement): Creates an HTMLElement given its name, attributes and parentElement.
2660         (window.DocumentExtension.createSvgElement): Creates an SVGElement given its name, attributes and parentElement (moved from utilities.js).
2661         (window.DocumentExtension.insertCssRuleAfter): Inserts a CSS rule after an exiting rule given its text.
2662
2663         (ResultsTable.prototype._showHeader): Use DocumentExtension functions.
2664         (ResultsTable.prototype._showGraph): Use DocumentExtension functions and create a real button for "Graph..." option.
2665         (ResultsTable.prototype._showJSON): Use DocumentExtension functions and create a real button for "JSON..." option.
2666         (Options): Deleted.
2667
2668         * Animometer/runner/animometer.html: Restructure the page to use the flex box layout.
2669
2670         * Animometer/runner/resources/animometer.css:
2671         (html,body):
2672         (button):
2673
2674         (button.large-button):The large button appears in the animometer.html.
2675         (button.large-button:active):
2676         (button.large-button:disabled):
2677
2678         (button.small-button): The small button appears in the results table.
2679         (button.small-button:active):
2680
2681         (.tree): The tree class is used to list the suites and their tests.
2682         (.tree .expand-button): This button expands a tree element.
2683         (.tree .expand-button ~ ul): Hide the children (<ul>...</ul>) of a parent node by default.
2684         (.tree .expand-button:checked ~ ul): Show the children of a parent node only when checked.
2685         (.tree ul): Hide the list bullets.
2686         (.tree li): Indent every node in the tree relative to its parent.
2687         (.tree ul li): Indent all the non top level nodes only (the tests nodes in our case).
2688         (.tree > li:last-child): Do not indent the bottom of the last child node.
2689         (.tree-label): Style for all the labels in the tree.
2690         (label.tree-label): Style for the labels in the top level only (the suites nodes in our case).
2691         (label.tree-label:before): Style the unchecked case of the expand-button.
2692         (:checked ~ label.tree-label:before): Style the checked case of the expand-button.
2693
2694         (table.results-table): The results table appears while running the test and at the end.
2695         (.results-table td):
2696         (.results-table th):
2697
2698         (div.results-json): The JSON div appears per test or for the whole run.
2699
2700         (main): This is the flex box container.
2701
2702         (section): A section is displayed exclusively inside the <main>. It is hidden by default.
2703         (section.selected): When it is selected, its layout is flex layout.
2704         (section > footer): The header or the footer of a section should not take more than 15% of the container.
2705
2706         (section#home): The home section has <suites> and <options> parts to be laid out in the middle.
2707         (section#home > options):
2708         (section#home > suites): The <suites> should not take more than 40% of the width.
2709         (section#home > options > label): The benchmark title.
2710         (section#home > header > h2): The benchmark title.
2711         (section#home > options > label > input[type="number"]): Sets the width of the option edit control.
2712
2713         (section#running): The running section contain the runner <iframe> which takes the whole area of the <main>.
2714         (section#running > #running-test): This is the <iframe> container.
2715         (section#running > #running-test > iframe): The <iframe> is created by the runner for each test.
2716         (section#running > #progress): This is the progress bar.
2717         (section#running > #progress > #progress-completed): This is another element which grows while the runner is progressing.
2718         (section#running > #record): This the container of the record results table which is shown while running a test.
2719
2720         (section#results):
2721         (section#json):
2722         (section#test-json):
2723         (section#test-graph): All these sections have the same layout. A <data> element is laid out between <header> and <footer>.
2724
2725         (section#results > data):
2726         (section#json > data):
2727         (section#test-json > data):
2728         (section#test-graph > data): The <data> element should take 70% of the <section>.
2729
2730         (section#test-graph > data > svg):
2731         (.axis line):
2732         (.left-samples): These styles are for the d3 graph.
2733
2734         (section#test-json > data): This is the style of the JSON <data> element.
2735
2736         (iframe): Deleted.
2737         (label, p): Deleted.
2738         (section > p): Deleted.
2739         (section#home > p): Deleted.
2740         (section#home > p:first-child): Deleted.
2741         (#testContainer): Deleted.
2742         (section#running #progress-completed): Deleted.
2743         (section#results > table): Deleted.
2744         (section#results > table td, th): Deleted.
2745         (section#results > table tr.alt, td): Deleted.
2746         (section#results > table th): Deleted.
2747         (section#json > textarea): Deleted.
2748         (.options): Deleted.
2749         (.options p): Deleted.
2750         (#suites ul): Deleted.
2751         (#suites ul ul): Deleted.
2752         (#suites ul ul input, #suites ul ul label): Deleted.
2753         (#suites.showTests ul ul): Deleted.
2754         (.column): Deleted.
2755         (input[type="number"]): Deleted.
2756         (.buttons): Deleted.
2757         (.small-button): Deleted.
2758         (#graphContainer): Deleted.
2759         (.right-samples): Deleted.
2760         (.sample-time): Deleted.
2761         (.left-mean): Deleted.
2762         (.right-mean): Deleted.
2763
2764         * Animometer/runner/resources/animometer.js:
2765         (window.benchmarkRunnerClient.initialize): Initialize the client object with the options and the suites.
2766         (window.benchmarkRunnerClient.willStartFirstIteration): Use new css selectors for results and the record table.
2767         (window.benchmarkRunnerClient.didFinishLastIteration): Move the code which sets the JSON text to sectionsManager.showJSON().
2768
2769         (window.sectionsManager): Responsible of managing the <section>s elements inside animometer.html.
2770         (window.sectionsManager._sectionHeaderH1Element): Return the <h1> inside the <header> of a given section.
2771         (window.sectionsManager._sectionDataDivElement): Return the <div> inside the <data> of a given section.
2772         (window.sectionsManager.showScore): Show the score of the last benchmark run.
2773         (window.sectionsManager.showTestName): Show the test name for detailed results <section>.
2774         (window.sectionsManager.showJSON): Shows the JSON text of the last benchmark or for a specific test.
2775         (window.sectionsManager.showSection): Shows a specific <section> in the <main> container.
2776         (window.sectionsManager.setupSectionStyle): Sets css attributes for all the <section>s.
2777         (window.sectionsManager.setupRunningSectionStyle): Sets the css attributes for the running <section> only.
2778
2779         (window.optionsManager): Responsible of managing the user options and streaming them to/form the localStorage.
2780         (window.optionsManager._optionsElements): Returns the children <input> elements of the <options>.
2781         (window.optionsManager.updateUIFromLocalStorage): Restore the values of the <options> UI elements from the local storage.
2782         (window.optionsManager.updateLocalStorageFromUI): Saves the values of the <options> UI elements to the local storage.
2783
2784         (window.suitesManager): Responsible of managing the user suites and streaming them to/form the localStorage.
2785         (window.suitesManager._treeElement): Returns the suites tree container element.
2786         (window.suitesManager._suitesElements): Returns a list of the suites elements.
2787         (window.suitesManager._checkboxElement): Returns the checkbox element of a given suite.
2788         (window.suitesManager._localStorageNameForTest): Generates a string for the tuple <suite, test> to be saved in the localStorage.
2789         (window.suitesManager._updateSuiteCheckboxState): Updates the state of a suite checkbox from the state of its tests' checkboxes.
2790         (window.suitesManager._updateStartButtonState): Updates the state of the start button from the state of the suites' checkboxes.
2791         (window.suitesManager._onChangeSuiteCheckbox): Called when a suite checkbox is clicked.
2792         (window.suitesManager._onChangeTestCheckbox): Called when a test checkbox is clicked.
2793         (window.suitesManager._createSuiteElement): Creates suite node in the suites tree.
2794         (window.suitesManager._createTestElement): Creates test node in the suites tree.
2795         (window.suitesManager.createElements): Creates the suites tree dynamically from the array Suites.
2796         (window.suitesManager.updateUIFromLocalStorage): Restore the values of the <suites> UI elements from the local storage.
2797         (window.suitesManager.updateLocalStorageFromUI): aves the values of the <suites> UI elements to the local storage.
2798
2799         (window.benchmarkController): This is the UI controller of the animometer.html page.
2800         (window.benchmarkController.initialize): Called when the animometer.html page is loaded.
2801         (window.benchmarkController._runBenchmark): Starts a benchmark run.
2802         (window.benchmarkController.startTest): Called when the "Start Test" button is clicked.
2803         (window.benchmarkController.showResults): Called at the end of the test to show the final results.
2804         (window.benchmarkController.showJson): Called from the results page to show the JSON of the last benchmark run.
2805         (window.benchmarkController.showTestGraph): Called from the results the table to show a graph for the samples of a specific test.
2806         (window.benchmarkController.showTestJSON): Called from the results the table to show a JSON for the samples of a specific test.
2807
2808         (showSection): Deleted.
2809         (startTest): Deleted.
2810         (showResults): Deleted.
2811         (showJson): Deleted.
2812         (showTestGraph): Deleted.
2813         (showTestJSON): Deleted.
2814         (initialize.toggleTestsCheckbox.onchange): Deleted.
2815         (initialize): Deleted.
2816         (updateSuiteSelection): Deleted.
2817         (updateTestSelection): Deleted.
2818         (updateSuiteCheckbox): Deleted.
2819         (localStorageNameForTest): Deleted.
2820         (populateSettings.): Deleted.
2821         (populateSettings): Deleted.
2822
2823         * Animometer/runner/resources/benchmark-runner.js:
2824         (BenchmarkRunner): Pass the frameContainer element to the BenchmarkRunner.
2825         (BenchmarkRunner.prototype._appendFrame): Remove unused parameter unwanted styling code.
2826         (BenchmarkRunner.prototype.runMultipleIterations):  Use the this._client.iterationCount instead of passing it as a parameter also.
2827
2828         * Animometer/runner/resources/graph.js:
2829         (graph): Calculate the size of the chart from the container element.
2830
2831         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
2832         (BouncingSvgImage):
2833         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
2834         (BouncingSvgParticlesStage.prototype._createDefs):
2835         (BouncingSvgParticlesStage.prototype._createClipStar):
2836         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2837         (BouncingSvgShape.prototype._createShape):
2838         (BouncingSvgShapesStage.prototype.createGradient):
2839         Call DocumentExtension.createSvgElement() instead of calling Utilities.createSvgElement().
2840
2841         * Animometer/tests/resources/main.js:
2842         (Animator.prototype.animate):
2843         (Benchmark):
2844         (Benchmark.prototype.update):
2845         * Animometer/tests/resources/stage.js:
2846         (StageBenchmark.prototype.showResults):
2847         Rename the options to match the <input> ids in animometer.html.
2848
2849         * Animometer/tests/resources/utilities.js:
2850         (window.Utilities.createSvgElement): Deleted.
2851
2852         * Animometer/tests/text/layering-text.html:
2853         * Animometer/tests/text/resources/layering-text.js:
2854         (LayeringTextStage):
2855         (LayeringTextStage.prototype._setFontSize): Sets the size of the text dynamically such that they all fit in one stage.
2856
2857 2015-10-29  Simon Fraser  <simon.fraser@apple.com>
2858
2859         Animometer computes frame rate incorrectly
2860         https://bugs.webkit.org/show_bug.cgi?id=150698
2861
2862         Reviewed by Tim Horton.
2863
2864         The existing code incremented this._frameCount after checking against this._dropFrameCount.
2865         This has the effect of setting this._measureTimeOffset one frame too late, so
2866         we were measuring only two frames, not three, and thus computing an incorrect fps.
2867
2868         * Animometer/tests/resources/main.js:
2869         (Animator.prototype.animate):
2870
2871 2015-10-27  Jon Lee  <jonlee@apple.com>
2872
2873         Add an option to make the graphics benchmark runs a specific test
2874         https://bugs.webkit.org/show_bug.cgi?id=150528
2875         rdar://problem/23246614
2876
2877         Reviewed by Zalan Bujtas.
2878
2879         Add a checkbox that lets the user list all of the available tests, and select
2880         the ones to run repeatedly. The test checkboxes will update the state of the suite
2881         checkbox. The selected tests are stored in localStorage to make it easy to do
2882         repeated runs.
2883
2884         * Animometer/runner/animometer.html: Add a checkbox to show individual tests.
2885         Update other markup.
2886         * Animometer/runner/resources/animometer.css: Make the settings area a little wider
2887         to accommodate the longer names of the tests
2888         * Animometer/runner/resources/animometer.js:
2889         (startBenchmark): Change the way that the suites are fed into the benchmark
2890         runner. Go through each of the suites and their tests, and create a new Suite
2891         with just the enabled tests. While enumerating store the enabled tests into
2892         localStorage.
2893         (initialize): Initialization routine (taking over populateSettings). When the
2894         checkbox for showing tests is toggled, add or remove a class on #suites to show
2895         the individual tests.
2896         (updateSuiteSelection): Called whenever the user toggles the checkbox for a suite.
2897         Either select all or none of the tests.
2898         (updateTestSelection): Called whenever the user toggles the checkbox for a test.
2899         (updateSuiteCheckbox): Update the state of the test's suite's checkbox to
2900         indeterminate if there is at least one enabled test, unchecked if none are selected,
2901         and checked if all are selected.
2902         (localStorageNameForTest): Helper function to get the name of the test to use as
2903         a key to localStorage.
2904         (populateSettings): Add the tests for each suite into an inner list.
2905
2906 2015-10-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
2907
2908         Add an option to output the results of the graphics benchmark in JSON format
2909         https://bugs.webkit.org/show_bug.cgi?id=150484
2910         <rdar://problem/23243721>
2911
2912         Reviewed by Darin Adler.
2913
2914         * Animometer/resources/extensions.js:
2915         (ResultsDashboard): A new class to hold the iterations results.
2916         (ResultsDashboard.prototype.push): Appends an iteration results;
2917         (ResultsDashboard.prototype.toJSON): Converts the iterations results to JSON format.
2918
2919         (RecordTable.prototype.clear): Clears the results table.
2920         (RecordTable.prototype._showTitles): Shows the header titles and appends the sub-titles to a queue.
2921         (RecordTable.prototype._showHeader): Shows the table header titles.
2922         (RecordTable.prototype._showEmpty): Shows an empty table cell.
2923         (RecordTable.prototype._showValue): Shows a number value in the results table.
2924         (RecordTable.prototype._showSamples): Shows a button for the sampled data graph.
2925         (RecordTable.prototype._showTest): Shows the results of a single test.
2926         (RecordTable.prototype._showSuite): Shows the results of a single suite.
2927         (RecordTable.prototype.showRecord): Shows a single iteration for a single test.
2928         (RecordTable.prototype.showIterations): Shows the results of all the suites of the iterations.
2929
2930         (ResultsTable): RecordTable was renamed to ResultsTable.
2931         (ResultsTable.prototype.clear): Clears the table element.
2932         (ResultsTable.prototype._showHeaderRow): Shows a row in the results table header.
2933         (ResultsTable.prototype._showHeader): Shows the results table header.
2934         (ResultsTable.prototype._showEmpty): Shows an empty table cell.
2935         (ResultsTable.prototype._showText): Shows a string in a new table cell.
2936         (ResultsTable.prototype._showFixedNumber): Shows a number in a new table cell.
2937         (ResultsTable.prototype._showGraph): Shows a button for the sampled data graph.
2938         (ResultsTable.prototype._showJSON): Shows a button for the sampled data JSON.
2939         (ResultsTable.prototype._showTest): Shows the results of a single test.
2940         (ResultsTable.prototype._showSuite): Shows the results of a single suite.
2941         (ResultsTable.prototype._showIteration): Shows the results of a single iteration.
2942         (ResultsTable.prototype.showRecord): Shows a single iteration for a single test.
2943         (ResultsTable.prototype.showIterations): Shows all the results.
2944         (RecordTable): Deleted.
2945         (RecordTable.prototype.clear): Deleted.
2946         (RecordTable.prototype._showTitles): Deleted.
2947         (RecordTable.prototype._showHeader): Deleted.
2948         (RecordTable.prototype._showEmpty): Deleted.
2949         (RecordTable.prototype._showValue): Deleted.
2950         (RecordTable.prototype._showSamples): Deleted.
2951         (RecordTable.prototype._showTest): Deleted.
2952         (RecordTable.prototype._showSuite): Deleted.
2953         (RecordTable.prototype.showRecord): Deleted.
2954         (RecordTable.prototype.showIterations): Deleted.
2955
2956         * Animometer/resources/sampler.js:
2957         (Sampler.prototype.startSampling): Use forEach.
2958         (Sampler.prototype.sample): Use forEach.
2959         (Sampler.prototype.toJSON): Converts the sampler data to JSON format.
2960
2961         * Animometer/resources/strings.js: Added.
2962         This new file will be used to associate the strings used by the benchmark
2963         with IDs. A string can be changed in one place without having to change
2964         all the instances of this string in multiple files. There two groups of
2965         strings in this file. The first one is used by the UI elements and the second
2966         group is used when constructing the results JSON.
2967
2968         * Animometer/runner/animometer.html:
2969         * Animometer/runner/resources/animometer.css:
2970
2971         * Animometer/runner/resources/animometer.js:
2972         (window.benchmarkRunnerClient.willAddTestFrame):
2973         (window.benchmarkRunnerClient.willStartFirstIteration):
2974         (window.benchmarkRunnerClient.didRunSuites):
2975         (window.benchmarkRunnerClient.didFinishLastIteration):
2976         Make benchmarkRunnerClient uses ResultsDashboard instead of _iterationsSamplers
2977         Get the JSON from ResultsDashboard.toJSON() and pass it to ResultsTable.showIterations().
2978         Also set the textContent of the "#json" textarea with the results JSON.
2979
2980         (showResults): Delete unneeded code.
2981         (showJson): Shows the "json" section.
2982         (showTestGraph): Rename showGraph() to be showTestGraph().
2983         (showTestJSON): Shows the JSON of a single testResults.
2984         (showGraph): Deleted.
2985
2986         * Animometer/runner/resources/tests.js:
2987         Use the string table instead of putting literal strings.
2988
2989         * Animometer/tests/resources/stage.js:
2990         (StageBenchmark.prototype.showResults):
2991         Fix the parameters which are passed to RecordTable.showRecord().
2992
2993         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
2994         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
2995         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
2996         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
2997         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
2998         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
2999         * Animometer/tests/examples/canvas-electrons.html:
3000         * Animometer/tests/examples/canvas-stars.html:
3001         * Animometer/tests/simple/simple-canvas-paths.html:
3002         * Animometer/tests/template/template-canvas.html:
3003         * Animometer/tests/template/template-css.html:
3004         * Animometer/tests/template/template-svg.html:
3005         * Animometer/tests/text/layering-text.html:
3006         Include the new strings.js file in all the test files.
3007
3008 2015-10-12  Jon Lee  <jonlee@apple.com>
3009
3010         Add canvas line dash test
3011         https://bugs.webkit.org/show_bug.cgi?id=150078
3012         <rdar://problem/23082347>
3013
3014         Reviewed by Dean Jackson.
3015
3016         * Animometer/runner/resources/tests.js: Add line dash test.
3017         * Animometer/tests/simple/resources/simple-canvas-paths.js:
3018         (CanvasLineDashStage): Create a new stage with a default dash pattern and stroke style.
3019         Maintain a step which will animate the dash.
3020         (CanvasLineDashStage.prototype.animate): Render the line path with the dash. Increment
3021         the dash offset to animate.
3022         (CanvasPathBenchmark.prototype.createStage): Add the test.
3023
3024 2015-10-12  Jon Lee  <jonlee@apple.com>
3025
3026         Add canvas line path tests
3027         https://bugs.webkit.org/show_bug.cgi?id=150076
3028         <rdar://problem/23082285>
3029
3030         Reviewed by Dean Jackson.
3031
3032         * Animometer/runner/resources/tests.js: Add new line path tests, with different
3033         line joins.
3034         * Animometer/tests/simple/resources/simple-canvas-paths.js:
3035         (CanvasLinePathStage): The stage is the same as the SimpleCanvasPathStrokeStage
3036         but sets the lineJoin on the context.
3037         (CanvasPathBenchmark.prototype.createStage): Add the tests.
3038
3039 2015-10-12  Jon Lee  <jonlee@apple.com>
3040
3041         Add missing paint objects for arc and arcTo fills
3042         https://bugs.webkit.org/show_bug.cgi?id=150075
3043         <rdar://problem/23082233>
3044
3045         Reviewed by Dean Jackson.
3046
3047         * Animometer/tests/simple/resources/simple-canvas-paths.js: Add missing paint objects
3048         for arcTo and arc segment fills.
3049         (CanvasArcToSegmentFill):
3050         (CanvasArcToSegmentFill.prototype.draw):
3051         (CanvasArcSegmentFill):
3052         (CanvasArcSegmentFill.prototype.draw):
3053
3054 2015-10-12  Jon Lee  <jonlee@apple.com>
3055
3056         Add canvas line segment tests
3057         https://bugs.webkit.org/show_bug.cgi?id=150073
3058         <rdar://problem/23082138>
3059
3060         Reviewed by Dean Jackson.
3061
3062         * Animometer/runner/resources/tests.js: Add new line segment tests, with different
3063         line caps.
3064         * Animometer/tests/simple/resources/simple-canvas-paths.js:
3065         (CanvasLineSegment): Add new line segment paint object.
3066         (CanvasLineSegmentStage): Create a new stage that sets the lineCap.
3067
3068 2015-10-12  Jon Lee  <jonlee@apple.com>
3069
3070         Add canvas path fill tests
3071         https://bugs.webkit.org/show_bug.cgi?id=150071
3072         <rdar://problem/23082001>
3073
3074         Reviewed by Dean Jackson.
3075
3076         * Animometer/runner/resources/tests.js: Add new pathTypes for path fills.
3077         * Animometer/tests/simple/resources/simple-canvas-paths.js:
3078         (CanvasLinePoint): Add basic point for a line, and call lineTo.
3079         (SimpleCanvasPathFillStage): Add a new stage similar to SimpleCanvasPathStrokeStage.
3080         (CanvasPathBenchmark.prototype.createStage): Add the tests.
3081
3082 2015-10-12  Jon Lee  <jonlee@apple.com>
3083
3084         Add canvas path tests
3085         https://bugs.webkit.org/show_bug.cgi?id=150067
3086         rdar://problem/23081463
3087
3088         Reviewed by Dean Jackson.
3089
3090         * Animometer/runner/resources/tests.js: Add a quadratic and bezier path test.
3091
3092         * Animometer/tests/simple/resources/simple-canvas.js:
3093         (SimpleCanvasStage.prototype.tune): This kind of test joins all of the segments
3094         into one long path, and tries to render that one path. Random points make it
3095         difficult to tell what is going on, so add a parameter to the constructor to
3096         confine the area where the random coordinates can land. The more complicated the
3097         case is, the larger an area the path will cover. Add an artificial minimum so
3098         that the first 200 points aren't confined to a space that is too small.
3099
3100         * Animometer/tests/simple/resources/simple-canvas-paths.js:
3101         (SimpleCanvasPathStrokeStage): Add a new kind of stage that inherits from
3102         SimpleCanvasStage. Each time the frame animates a random line width and stroke
3103         color are chosen. The path setup is done outside of each paint object.
3104         (CanvasQuadraticPoint): This point just calls quadraticCurveTo.
3105         (CanvasPathBenchmark.prototype.createStage): Add the tests.
3106
3107 2015-10-12  Jon Lee  <jonlee@apple.com>
3108
3109         Add basic canvas tests
3110         https://bugs.webkit.org/show_bug.cgi?id=150066
3111         rdar://problem/23081143
3112
3113         Reviewed by Dean Jackson.
3114
3115         This adds a new test suite that will cover all of the path-based canvas calls.
3116         The patch will be divided up to cover tests with similar techniques.
3117
3118         The simplest version uses a SimpleCanvasStage.
3119
3120         * Animometer/runner/resources/tests.js: Add tests for quadratic, bezier, arcTo,
3121         arc, and rect segments. Also include arcTo, arc, and rect fills.
3122         * Animometer/tests/resources/stage.js:
3123         (Stage.prototype.randomBool): Added for counterclockwise property for arc segments.
3124         (Stage.prototype.randomInt): Fix how values are rounded, used by randomBool. It should
3125         round instead of flooring everything.
3126         * Animometer/tests/simple/resources/simple-canvas.js: Added. Defines common classes
3127         used by all simple canvas tests. The page reads best bottom to top.
3128         (SimpleCanvasStage): Basic stage. Pass a canvasObject which will be used to create new
3129         objects as needed in tune().
3130         (SimpleCanvasStage.prototype.tune): Modeled on other tests. Adds and removed objects
3131         as specified by the provided |count|.
3132         (SimpleCanvasStage.prototype.animate): Iterate over all the objects and ask them to draw.
3133         There is no "animating" of the objects; they will just paint statically on the canvas.
3134         (SimpleCanvasAnimator): Basic animator clears the canvas prior to painting.
3135         (SimpleCanvasBenchmark): Hard-code the feedback loop parameters instead of including
3136         them in the query parameters to the test URLs.
3137         (SimpleCanvasBenchmark.prototype.createAnimator):
3138         * Animometer/tests/simple/simple-canvas-paths.html: Added.
3139
3140         * Animometer/tests/simple/resources/simple-canvas-paths.js: Added. There is no "animating"
3141         of these objects--they just paint statically on the canvas.
3142         (CanvasQuadraticSegment): Paint a quadratic segment stroke.
3143         (CanvasBezierSegment): Paint a bezier segment stroke.
3144         (CanvasArcToSegment): Paint an arcTo stroke.
3145         (CanvasArcSegment): Paint an arc stroke.
3146         (CanvasRect): Paint a rect.
3147         (CanvasRectFill): Paint a filled rect.
3148
3149         (CanvasPathBenchmark):
3150         (CanvasPathBenchmark.prototype.createStage): Look for the pathType and create the
3151         stage using the right paint object.
3152         (window.benchmarkClient.create):
3153
3154 2015-10-12  Jon Lee  <jonlee@apple.com>
3155
3156         Refactor tune() to pass in an integer-based count
3157         https://bugs.webkit.org/show_bug.cgi?id=150060
3158         <rdar://problem/23079425>
3159
3160         Reviewed by Dean Jackson.
3161
3162         All of the tune functions do an initial step of flooring the
3163         # of painting objects to add or remove. Factor that out since
3164         the complexity of all of these tests is always expressed in terms
3165         of countable items.
3166
3167         * Animometer/tests/resources/main.js:
3168         (Benchmark.prototype.update): Update the tuneValue.
3169
3170         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
3171         (BouncingParticlesStage.prototype.tune): Remove the count adjustment.
3172         * Animometer/tests/examples/resources/canvas-electrons.js:
3173         (CanvasElectronsStage.prototype.tune): Ditto.
3174         * Animometer/tests/examples/resources/canvas-stars.js:
3175         (CanvasStarsStage.prototype.tune): Ditto.
3176         * Animometer/tests/text/resources/layering-text.js:
3177         (LayeringTextStage.prototype.tune): Ditto.
3178
3179 2015-10-12  Jon Lee  <jonlee@apple.com>
3180
3181         Store test-interval in localStorage
3182         https://bugs.webkit.org/show_bug.cgi?id=150055
3183         <rdar://problem/23078879>
3184
3185         Reviewed by Dean Jackson.
3186
3187         * Animometer/runner/resources/animometer.js:
3188         (populateSettings): Keep track of the specified test interval in localStorage
3189         to make it easy to repeat a test suite.
3190
3191 2015-10-12  Jon Lee  <jonlee@apple.com>
3192
3193         Remove "../tests/" from the URLs of all tests
3194         https://bugs.webkit.org/show_bug.cgi?id=150054
3195         <rdar://problem/23078784>
3196
3197         Reviewed by Dean Jackson.
3198
3199         Presumably all tests will be running from the tests/ directory,
3200         so we don't have to specify it in all of the test URLs.
3201
3202         * Animometer/runner/resources/benchmark-runner.js:
3203         (BenchmarkRunnerState.prototype.prepareCurrentTest): Prepend
3204         "../tests/" to all tests.
3205         * Animometer/runner/resources/tests.js: Remove "../tests/" from
3206         all URLs.
3207
3208 2015-10-12  Jon Lee  <jonlee@apple.com>
3209
3210         Refactor test suites to a separate class.
3211         https://bugs.webkit.org/show_bug.cgi?id=150053
3212         <rdar://problem/23078645>
3213
3214         Reviewed by Dean Jackson.
3215
3216         Create a Suite class to refactor out prepare() and run().
3217         Generate the checkboxes representing the suites using Suites
3218         instead of maintaining a separate list. Also, save the
3219         selections out to localStorage.
3220
3221         * Animometer/runner/animometer.html: Remove the explicitly listed
3222         suites. These will be generated from Suites instead.
3223         * Animometer/runner/resources/animometer.js:
3224         (populateSettings): Iterate through Suites, and create the
3225         label and checkbox. Attach the Suite object to the checkbox so
3226         when the benchmark is started, we get direct access. Initialize
3227         the checkmark based on its value in localStorage. Set this to
3228         run when DOMContentLoaded is dispatched.
3229         (startBenchmark): Grab all of the checkboxes, inspect their
3230         values, add it to enabledSuites if selected. Remember whether
3231         the suite was enabled in localStorage, so that it's easy to do
3232         repeated runs.
3233         * Animometer/runner/resources/tests.js:
3234         (Suite): Create a new Suite class. Refactor out prepare() and