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