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