Changeset 216946 in webkit


Ignore:
Timestamp:
May 16, 2017 2:16:51 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Update to Speedometer 2.0 w/updated frameworks + new workloads
https://bugs.webkit.org/show_bug.cgi?id=170513

Patch by Addy Osmani <addyosmani@gmail.com> on 2017-05-16
Reviewed by Ryosuke Niwa.

Refresh test runner and fix apps to work with it.

  • Speedometer/InteractiveRunner.html:

(parseQueryString): Adds support for startAutomatically query parameter.

  • Speedometer/resources/tests.js:

(triggerEnter): Refactor event triggering behavior for tests.

  • Speedometer/resources/todomvc/architecture-examples/angular/dist/index.html:

(CSS): Drop reference to extraneous stylesheet in Angular TodoMVC.

  • Speedometer/resources/todomvc/architecture-examples/emberjs/assets/todomvc.js:
  • Speedometer/resources/todomvc/architecture-examples/emberjs/index.html:

(base): Enable Ember TodoMVC to be run from any directory/level.

  • Speedometer/resources/todomvc/architecture-examples/emberjs/source/app/services/memory.js:

(localStorageMemory): Correct import path and switch to window.localStorageMemory to fix Ember failures.

  • Speedometer/resources/todomvc/architecture-examples/emberjs/source/app/services/repo.js:
  • Speedometer/resources/todomvc/architecture-examples/emberjs/tests/index.html:
  • Speedometer/resources/todomvc/architecture-examples/jquery/index.html:
  • Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/LICENSE: Added.

(LICENSE): Add missing metadata and LICENSE files as part of director.js package for jQuery TodoMVC

  • Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/bower.json: Added.
  • Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/dist/director.js: Add missing

director.js dependency for jQuery TodoMVC implementation.

  • Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/dist/director.min.js: Added.
  • Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/dist/ender.js: Added.
  • Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/package.json: Added.
  • Speedometer/resources/todomvc/functional-prog-examples/elm/index.html: Fix path to built Elm TodoMVC scripts.
Location:
trunk/PerformanceTests
Files:
8 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/PerformanceTests/ChangeLog

    r216754 r216946  
     12017-05-16  Addy Osmani  <addyosmani@gmail.com>
     2
     3        Update to Speedometer 2.0 w/updated frameworks + new workloads
     4        https://bugs.webkit.org/show_bug.cgi?id=170513
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Refresh test runner and fix apps to work with it.
     9
     10        * Speedometer/InteractiveRunner.html:
     11        (parseQueryString): Adds support for startAutomatically query parameter.
     12        * Speedometer/resources/tests.js:
     13        (triggerEnter): Refactor event triggering behavior for tests.
     14        * Speedometer/resources/todomvc/architecture-examples/angular/dist/index.html:
     15        (CSS): Drop reference to extraneous stylesheet in Angular TodoMVC.
     16        * Speedometer/resources/todomvc/architecture-examples/emberjs/assets/todomvc.js:
     17        * Speedometer/resources/todomvc/architecture-examples/emberjs/index.html:
     18        (base): Enable Ember TodoMVC to be run from any directory/level.
     19        * Speedometer/resources/todomvc/architecture-examples/emberjs/source/app/services/memory.js:
     20        (localStorageMemory): Correct import path and switch to window.localStorageMemory to fix Ember failures.
     21        * Speedometer/resources/todomvc/architecture-examples/emberjs/source/app/services/repo.js:
     22        * Speedometer/resources/todomvc/architecture-examples/emberjs/tests/index.html:
     23        * Speedometer/resources/todomvc/architecture-examples/jquery/index.html:
     24        * Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/LICENSE: Added.
     25        (LICENSE): Add missing metadata and LICENSE files as part of director.js package for jQuery TodoMVC
     26        * Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/bower.json: Added.
     27        * Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/dist/director.js: Add missing
     28        director.js dependency for jQuery TodoMVC implementation.
     29        * Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/dist/director.min.js: Added.
     30        * Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/dist/ender.js: Added.
     31        * Speedometer/resources/todomvc/architecture-examples/jquery/node_modules/director/package.json: Added.
     32        * Speedometer/resources/todomvc/functional-prog-examples/elm/index.html: Fix path to built Elm TodoMVC scripts.
     33
    1342017-05-12  Addy Osmani  <addyosmani@gmail.com>
    235
  • trunk/PerformanceTests/Speedometer/InteractiveRunner.html

    r168521 r216946  
    22<html>
    33<head>
    4 <title>DoYouEvenBench</title>
     4<title>Speedometer 2.0 Interactive Runner</title>
    55<script src="resources/benchmark-runner.js" defer></script>
    66<script src="resources/tests.js" defer></script>
     
    6767    var button = document.createElement('button');
    6868    button.textContent = 'Run';
     69    button.id = 'runSuites';
    6970    button.onclick = onrun;
    7071    control.appendChild(button);
     
    7374}
    7475
     76var parseQueryString = (function (pairList) {
     77    var pairs = {};
     78    for (var i = 0; i < pairList.length; ++i) {
     79        var keyValue = pairList[i].split('=', 2);
     80        if (keyValue.length == 1)
     81            pairs[keyValue[0]] = '';
     82        else
     83            pairs[keyValue[0]] = decodeURIComponent(keyValue[1].replace(/\+/g, ' '));
     84    }
     85    return pairs;
     86})(window.location.search.substr(1).split('&'));
     87
     88function disableAllSuitesExcept(suiteName) {
     89    Suites.forEach(function(element) {
     90        if (element.name !== suiteName)
     91            element.disabled = true;
     92    });
     93}
     94
    7595function startTest() {
     96    var queryParam = parseQueryString['suite'];
     97    if (queryParam !== undefined)
     98        disableAllSuitesExcept(queryParam);
     99
    76100    var runner = new BenchmarkRunner(Suites, {
    77101        willRunTest: function (suite, test) {
     
    113137        function () { runner.step(currentState).then(function (state) { currentState = state; }); },
    114138        function () { runner.runAllSteps(currentState); currentState = null; }));
     139
     140    if (parseQueryString['startAutomatically'] !== undefined)
     141        document.getElementById('runSuites').click();
    115142}
    116143
  • trunk/PerformanceTests/Speedometer/resources/tests.js

    r168521 r216946  
    11var numberOfItemsToAdd = 100;
    22var Suites = [];
     3var ENTER_KEY_CODE = 13;
     4
     5var triggerEnter = function (element, type) {
     6    var event = document.createEvent('Events');
     7    event.initEvent(type, true, true);
     8    event.keyCode = ENTER_KEY_CODE;
     9    event.which = ENTER_KEY_CODE;
     10    event.key = 'ENTER';
     11    element.dispatchEvent(event);
     12}
    313
    414Suites.push({
     
    616    url: 'todomvc/vanilla-examples/vanillajs/index.html',
    717    prepare: function (runner, contentWindow, contentDocument) {
     18        return runner.waitForElement('.new-todo').then(function (element) {
     19            element.focus();
     20            return element;
     21        });
     22    },
     23    tests: [
     24        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
     25            for (var i = 0; i < numberOfItemsToAdd; i++) {
     26                newTodo.value = 'Something to do ' + i;
     27                newTodo.dispatchEvent(new Event('change'));
     28                triggerEnter(newTodo, 'keypress');
     29            }
     30        }),
     31        new BenchmarkTestStep('CompletingAllItems', function (newTodo, contentWindow, contentDocument) {
     32            var checkboxes = contentDocument.querySelectorAll('.toggle');
     33            for (var i = 0; i < checkboxes.length; i++)
     34                checkboxes[i].click();
     35        }),
     36        new BenchmarkTestStep('DeletingAllItems', function (newTodo, contentWindow, contentDocument) {
     37            var deleteButtons = contentDocument.querySelectorAll('.destroy');
     38            for (var i = 0; i < deleteButtons.length; i++)
     39                deleteButtons[i].click();
     40        }),
     41    ]
     42});
     43
     44Suites.push({
     45    name: 'Vanilla-ES2015-TodoMVC',
     46    url: 'todomvc/vanilla-examples/es2015/index.html',
     47    prepare: function (runner, contentWindow, contentDocument) {
     48        return runner.waitForElement('.new-todo').then(function (element) {
     49            element.focus();
     50            return element;
     51        });
     52    },
     53    tests: [
     54        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
     55            for (var i = 0; i < numberOfItemsToAdd; i++) {
     56                newTodo.value = 'Something to do ' + i;
     57                newTodo.dispatchEvent(new Event('change'));
     58                triggerEnter(newTodo, 'keypress');
     59            }
     60        }),
     61        new BenchmarkTestStep('CompletingAllItems', function (params, contentWindow, contentDocument) {
     62            var checkboxes = contentDocument.querySelectorAll('.toggle');
     63            for (var i = 0; i < checkboxes.length; i++)
     64                checkboxes[i].click();
     65        }),
     66        new BenchmarkTestStep('DeletingItems', function (params, contentWindow, contentDocument) {
     67            var deleteButtons = contentDocument.querySelectorAll('.destroy');
     68            for (var i = 0; i < deleteButtons.length; i++)
     69                deleteButtons[i].click();
     70        }),
     71    ]
     72});
     73
     74Suites.push({
     75    name: 'Vanilla-ES2015-Babel-Webpack-TodoMVC',
     76    url: 'todomvc/vanilla-examples/es2015-babel-webpack/dist/index.html',
     77    prepare: function (runner, contentWindow, contentDocument) {
     78        return runner.waitForElement('.new-todo').then(function (element) {
     79            element.focus();
     80            return element;
     81        });
     82    },
     83    tests: [
     84        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
     85            for (var i = 0; i < numberOfItemsToAdd; i++) {
     86                newTodo.value = 'Something to do ' + i;
     87                newTodo.dispatchEvent(new Event('change'));
     88                triggerEnter(newTodo, 'keypress');
     89            }
     90        }),
     91        new BenchmarkTestStep('CompletingAllItems', function (params, contentWindow, contentDocument) {
     92            var checkboxes = contentDocument.querySelectorAll('.toggle');
     93            for (var i = 0; i < checkboxes.length; i++)
     94                checkboxes[i].click();
     95        }),
     96        new BenchmarkTestStep('DeletingItems', function (params, contentWindow, contentDocument) {
     97            var deleteButtons = contentDocument.querySelectorAll('.destroy');
     98            for (var i = 0; i < deleteButtons.length; i++)
     99                deleteButtons[i].click();
     100        }),
     101    ]
     102});
     103
     104Suites.push({
     105    name: 'React-TodoMVC',
     106    url: 'todomvc/architecture-examples/react/index.html',
     107    prepare: function (runner, contentWindow, contentDocument) {
     108        contentWindow.app.Utils.store = function () {}
     109        return runner.waitForElement('.new-todo').then(function (element) {
     110            element.focus();
     111            return element;
     112        });
     113    },
     114    tests: [
     115        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
     116            for (var i = 0; i < numberOfItemsToAdd; i++) {
     117                newTodo.value = 'Something to do ' + i;
     118                newTodo.dispatchEvent(new Event('input', {
     119                  bubbles: true,
     120                  cancelable: true
     121                }));
     122                triggerEnter(newTodo, 'keydown');
     123            }
     124        }),
     125        new BenchmarkTestStep('CompletingAllItems', function (newTodo, contentWindow, contentDocument) {
     126            var checkboxes = contentDocument.querySelectorAll('.toggle');
     127            for (var i = 0; i < checkboxes.length; i++)
     128                checkboxes[i].click();
     129        }),
     130        new BenchmarkTestStep('DeletingAllItems', function (newTodo, contentWindow, contentDocument) {
     131            var deleteButtons = contentDocument.querySelectorAll('.destroy');
     132            for (var i = 0; i < deleteButtons.length; i++)
     133                deleteButtons[i].click();
     134        }),
     135    ]
     136});
     137
     138Suites.push({
     139    name: 'React-Redux-TodoMVC',
     140    url: 'todomvc/architecture-examples/react-redux/dist/index.html',
     141    prepare: function (runner, contentWindow, contentDocument) {
     142        return runner.waitForElement('.new-todo').then(function (element) {
     143            element.focus();
     144            return element;
     145        });
     146    },
     147    tests: [
     148        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
     149            for (var i = 0; i < numberOfItemsToAdd; i++) {
     150                newTodo.value = 'Something to do ' + i;
     151                triggerEnter(newTodo, 'keydown');
     152            }
     153        }),
     154        new BenchmarkTestStep('CompletingAllItems', function (params, contentWindow, contentDocument) {
     155            var checkboxes = contentDocument.querySelectorAll('.toggle');
     156            for (var i = 0; i < checkboxes.length; i++)
     157                checkboxes[i].click();
     158        }),
     159        new BenchmarkTestStep('DeletingItems', function (params, contentWindow, contentDocument) {
     160            var deleteButtons = contentDocument.querySelectorAll('.destroy');
     161            for (var i = 0; i < deleteButtons.length; i++)
     162                deleteButtons[i].click();
     163        }),
     164    ]
     165});
     166
     167Suites.push({
     168    name: 'EmberJS-TodoMVC',
     169    url: 'todomvc/architecture-examples/emberjs',
     170    prepare: function (runner, contentWindow, contentDocument) {
    8171        return runner.waitForElement('#new-todo').then(function (element) {
    9172            element.focus();
     
    13176    tests: [
    14177        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
    15             var todoController = contentWindow.todo.controller;
    16             for (var i = 0; i < numberOfItemsToAdd; i++) {
    17                 newTodo.value = 'Something to do ' + i;
    18                 todoController.addItem({keyCode: todoController.ENTER_KEY, target: newTodo});
    19             }
    20         }),
    21         new BenchmarkTestStep('CompletingAllItems', function (newTodo, contentWindow, contentDocument) {
    22             var checkboxes = contentDocument.querySelectorAll('.toggle');
    23             for (var i = 0; i < checkboxes.length; i++)
    24                 checkboxes[i].click();
    25         }),
    26         new BenchmarkTestStep('DeletingAllItems', function (newTodo, contentWindow, contentDocument) {
    27             var deleteButtons = contentDocument.querySelectorAll('.destroy');
    28             for (var i = 0; i < deleteButtons.length; i++)
    29                 deleteButtons[i].click();
    30         }),
    31     ]
    32 });
    33 
    34 Suites.push({
    35     name: 'EmberJS-TodoMVC',
    36     url: 'todomvc/architecture-examples/emberjs/index.html',
    37     prepare: function (runner, contentWindow, contentDocument) {
    38         return runner.waitForElement('#new-todo').then(function (element) {
    39             element.focus();
    40             return {
    41                 views: contentWindow.Ember.View.views,
    42                 emberRun: contentWindow.Ember.run,
    43             }
    44         });
    45     },
    46     tests: [
    47         new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (params) {
    48             for (var i = 0; i < numberOfItemsToAdd; i++) {
    49                 params.emberRun(function () { params.views["new-todo"].set('value', 'Something to do' + i); });
    50                 params.emberRun(function () { params.views["new-todo"].insertNewline(document.createEvent('Event')); });
    51             }
    52         }),
    53         new BenchmarkTestStep('CompletingAllItems', function (params, contentWindow, contentDocument) {
    54             var checkboxes = contentDocument.querySelectorAll('.ember-checkbox');
    55             for (var i = 0; i < checkboxes.length; i++) {
    56                 var view = params.views[checkboxes[i].id];
    57                 params.emberRun(function () { view.set('checked', true); });
    58             }
    59         }),
    60         new BenchmarkTestStep('DeletingItems', function (params, contentWindow, contentDocument) {
    61             var deleteButtons = contentDocument.querySelectorAll('.destroy');
    62             for (var i = 0; i < deleteButtons.length; i++)
    63                 params.emberRun(function () { deleteButtons[i].click(); });
     178            for (var i = 0; i < numberOfItemsToAdd; i++) {
     179                newTodo.value = 'Something to do ' + i;
     180                triggerEnter(newTodo, 'keydown');
     181            }
     182        }),
     183        new BenchmarkTestStep('CompletingAllItems', function (params, contentWindow, contentDocument) {
     184            var checkboxes = contentDocument.querySelectorAll('.toggle');
     185            for (var i = 0; i < checkboxes.length; i++)
     186                checkboxes[i].click();
     187        }),
     188        new BenchmarkTestStep('DeletingItems', function (params, contentWindow, contentDocument) {
     189            var deleteButtons = contentDocument.querySelectorAll('.destroy');
     190            for (var i = 0; i < deleteButtons.length; i++)
     191                deleteButtons[i].click();
    64192        }),
    65193    ]
     
    71199    prepare: function (runner, contentWindow, contentDocument) {
    72200    contentWindow.Backbone.sync = function () {}
    73         return runner.waitForElement('#new-todo').then(function (element) {
    74             element.focus();
    75             return element;
    76         });
    77     },
    78     tests: [
    79         new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
    80             var appView = contentWindow.appView;
    81             var fakeEvent = {which: contentWindow.ENTER_KEY};
    82             for (var i = 0; i < numberOfItemsToAdd; i++) {
    83                 newTodo.value = 'Something to do ' + i;
    84                 appView.createOnEnter(fakeEvent);
     201        return runner.waitForElement('.new-todo').then(function (element) {
     202            element.focus();
     203            return element;
     204        });
     205    },
     206    tests: [
     207        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
     208            for (var i = 0; i < numberOfItemsToAdd; i++) {
     209                newTodo.value = 'Something to do ' + i;
     210                triggerEnter(newTodo, 'keypress');
    85211            }
    86212        }),
     
    94220            for (var i = 0; i < deleteButtons.length; i++)
    95221                deleteButtons[i].click();
    96         }),
    97     ]
    98 });
    99 
    100 Suites.push({
    101     name: 'jQuery-TodoMVC',
    102     url: 'todomvc/architecture-examples/jquery/index.html',
    103     prepare: function (runner, contentWindow, contentDocument) {
    104         return runner.waitForElement('#new-todo').then(function (element) {
    105             element.focus();
    106             return element;
    107         });
    108     },
    109     tests: [
    110         new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
    111             var app = contentWindow.app;
    112             var fakeEvent = {which: app.ENTER_KEY};
    113             for (var i = 0; i < numberOfItemsToAdd; i++) {
    114                 newTodo.value = 'Something to do ' + i;
    115                 app.create.call(newTodo, fakeEvent);
    116             }
    117         }),
    118         new BenchmarkTestStep('CompletingAllItems', function (newTodo, contentWindow, contentDocument) {
    119             var app = contentWindow.app;
    120             var checkboxes = contentDocument.querySelectorAll('.toggle');
    121             var $ = contentWindow.$;
    122 
    123             itemIndexToId = new Array(checkboxes.length);
    124             for (var i = 0; i < checkboxes.length; i++)
    125                 itemIndexToId[i] = $(checkboxes[i]).closest('li').data('id');
    126 
    127             app.getTodo = function (element, callback) {
    128                 var self = this;
    129                 var id = itemIndexToId[this.currentItemIndex];
    130                 $.each(this.todos, function (j, val) {
    131                     if (val.id === id) {
    132                         callback.apply(self, arguments);
    133                         return false;
    134                     }
    135                 });
    136             }
    137 
    138             for (var i = 0; i < checkboxes.length; i++) {
    139                 app.currentItemIndex = i;
    140                 app.toggle.call(checkboxes[i]);
    141             }
    142         }),
    143         new BenchmarkTestStep('DeletingAllItems', function (newTodo, contentWindow, contentDocument) {
    144             contentDocument.querySelector('#clear-completed').click();
    145             var app = contentWindow.app;
    146             var deleteButtons = contentDocument.querySelectorAll('.destroy');
    147 
    148             for (var i = 0; i < deleteButtons.length; i++) {
    149                 app.currentItemIndex = i;
    150                 app.destroy.call(deleteButtons[i]);
    151             }
    152222        }),
    153223    ]
     
    165235    tests: [
    166236        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
    167             var todomvc = contentWindow.todomvc;
    168237            var submitEvent = document.createEvent('Event');
    169238            submitEvent.initEvent('submit', true, true);
     
    190259
    191260Suites.push({
    192     name: 'React-TodoMVC',
    193     url: 'todomvc/labs/architecture-examples/react/index.html',
    194     prepare: function (runner, contentWindow, contentDocument) {
    195         contentWindow.Utils.store = function () {}
     261    name: 'Angular2-TypeScript-TodoMVC',
     262    url: 'todomvc/architecture-examples/angular/dist/index.html',
     263    prepare: function (runner, contentWindow, contentDocument) {
     264        return runner.waitForElement('.new-todo').then(function (element) {
     265            element.focus();
     266            return element;
     267        });
     268    },
     269    tests: [
     270        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
     271            for (var i = 0; i < numberOfItemsToAdd; i++) {
     272                newTodo.value = 'Something to do ' + i;
     273                newTodo.dispatchEvent(new Event('input', {
     274                  bubbles: true,
     275                  cancelable: true
     276                }));
     277                triggerEnter(newTodo, 'keyup');
     278            }
     279        }),
     280        new BenchmarkTestStep('CompletingAllItems', function (params, contentWindow, contentDocument) {
     281            var checkboxes = contentDocument.querySelectorAll('.toggle');
     282            for (var i = 0; i < checkboxes.length; i++)
     283                checkboxes[i].click();
     284        }),
     285        new BenchmarkTestStep('DeletingItems', function (params, contentWindow, contentDocument) {
     286            var deleteButtons = contentDocument.querySelectorAll('.destroy');
     287            for (var i = 0; i < deleteButtons.length; i++)
     288                deleteButtons[i].click();
     289        }),
     290    ]
     291});
     292
     293Suites.push({
     294    name: 'VueJS-TodoMVC',
     295    url: 'todomvc/architecture-examples/vuejs-cli/dist/index.html',
     296    prepare: function (runner, contentWindow, contentDocument) {
     297        return runner.waitForElement('.new-todo').then(function (element) {
     298            element.focus();
     299            return element;
     300        });
     301    },
     302    tests: [
     303        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
     304            for (var i = 0; i < numberOfItemsToAdd; i++) {
     305                newTodo.value = 'Something to do ' + i;
     306                newTodo.dispatchEvent(new Event('input', {
     307                  bubbles: true,
     308                  cancelable: true
     309                }));
     310                triggerEnter(newTodo, 'keyup');
     311            }
     312        }),
     313        new BenchmarkTestStep('CompletingAllItems', function (newTodo, contentWindow, contentDocument) {
     314            var checkboxes = contentDocument.querySelectorAll('.toggle');
     315            for (var i = 0; i < checkboxes.length; i++)
     316                checkboxes[i].click();
     317        }),
     318        new BenchmarkTestStep('DeletingAllItems', function (newTodo, contentWindow, contentDocument) {
     319            var deleteButtons = contentDocument.querySelectorAll('.destroy');
     320            for (var i = 0; i < deleteButtons.length; i++)
     321                deleteButtons[i].click();
     322        }),
     323    ]
     324});
     325
     326Suites.push({
     327    name: 'jQuery-TodoMVC',
     328    url: 'todomvc/architecture-examples/jquery/index.html',
     329    prepare: function (runner, contentWindow, contentDocument) {
    196330        return runner.waitForElement('#new-todo').then(function (element) {
    197331            element.focus();
     
    201335    tests: [
    202336        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
    203             var todomvc = contentWindow.todomvc;
    204             for (var i = 0; i < numberOfItemsToAdd; i++) {
    205                 newTodo.value = 'Something to do ' + i;
    206 
    207                 var keydownEvent = document.createEvent('Event');
    208                 keydownEvent.initEvent('keydown', true, true);
    209                 keydownEvent.which = 13; // VK_ENTER
    210                 newTodo.dispatchEvent(keydownEvent);
     337            for (var i = 0; i < numberOfItemsToAdd; i++) {
     338                newTodo.value = 'Something to do ' + i;
     339                triggerEnter(newTodo, 'keyup');
    211340            }
    212341        }),
     
    222351        }),
    223352    ]
    224 });
    225 
    226 Suites.push({
    227     name: 'FlightJS-TodoMVC',
    228     url: 'todomvc/dependency-examples/flight/index.html',
    229     prepare: function (runner, contentWindow, contentDocument) {
    230         return runner.waitForElement('#appIsReady').then(function () {
    231             var newTodo = contentDocument.querySelector('#new-todo');
    232             newTodo.focus();
    233             return newTodo;
    234         });;
    235     },
    236     tests: [
    237         new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
    238             var todomvc = contentWindow.todomvc;
    239             for (var i = 0; i < numberOfItemsToAdd; i++) {
    240                 newTodo.value = 'Something to do ' + i;
    241 
    242                 var keydownEvent = document.createEvent('Event');
    243                 keydownEvent.initEvent('keydown', true, true);
    244                 keydownEvent.which = 13; // VK_ENTER
    245                 newTodo.dispatchEvent(keydownEvent);
    246             }
    247         }),
    248         new BenchmarkTestStep('CompletingAllItems', function (newTodo, contentWindow, contentDocument) {
    249             var checkboxes = contentDocument.querySelectorAll('.toggle');
    250             for (var i = 0; i < checkboxes.length; i++)
    251                 checkboxes[i].click();
    252         }),
    253         new BenchmarkTestStep('DeletingAllItems', function (newTodo, contentWindow, contentDocument) {
     353})
     354
     355Suites.push({
     356    name: 'Preact-TodoMVC',
     357    url: 'todomvc/architecture-examples/preact/dist/index.html',
     358    prepare: function (runner, contentWindow, contentDocument) {
     359        return runner.waitForElement('.new-todo').then(function (element) {
     360            element.focus();
     361            return element;
     362        });
     363    },
     364    tests: [
     365        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
     366            for (var i = 0; i < numberOfItemsToAdd; i++) {
     367                newTodo.value = 'Something to do ' + i;
     368                triggerEnter(newTodo, 'keydown');
     369            }
     370        }),
     371        new BenchmarkTestStep('CompletingAllItems', function (params, contentWindow, contentDocument) {
     372            var checkboxes = contentDocument.querySelectorAll('.toggle');
     373            for (var i = 0; i < checkboxes.length; i++)
     374                checkboxes[i].click();
     375        }),
     376        new BenchmarkTestStep('DeletingItems', function (params, contentWindow, contentDocument) {
     377            var deleteButtons = contentDocument.querySelectorAll('.destroy');
     378            for (var i = 0; i < deleteButtons.length; i++)
     379                deleteButtons[i].click();
     380        }),
     381    ]
     382});
     383
     384Suites.push({
     385    name: 'Inferno-TodoMVC',
     386    url: 'todomvc/architecture-examples/inferno/index.html',
     387    prepare: function (runner, contentWindow, contentDocument) {
     388        return runner.waitForElement('.new-todo').then(function (element) {
     389            element.focus();
     390            return element;
     391        });
     392    },
     393    tests: [
     394        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
     395            for (var i = 0; i < numberOfItemsToAdd; i++) {
     396                newTodo.value = 'Something to do ' + i;
     397                newTodo.dispatchEvent(new Event('change', {
     398                  bubbles: true,
     399                  cancelable: true
     400                }));
     401                triggerEnter(newTodo, 'keydown');
     402            }
     403        }),
     404        new BenchmarkTestStep('CompletingAllItems', function (params, contentWindow, contentDocument) {
     405            var checkboxes = contentDocument.querySelectorAll('.toggle');
     406            for (var i = 0; i < checkboxes.length; i++)
     407                checkboxes[i].click();
     408        }),
     409        new BenchmarkTestStep('DeletingItems', function (params, contentWindow, contentDocument) {
     410            var deleteButtons = contentDocument.querySelectorAll('.destroy');
     411            for (var i = 0; i < deleteButtons.length; i++)
     412                deleteButtons[i].click();
     413        }),
     414    ]
     415});
     416
     417Suites.push({
     418    name: 'Elm-TodoMVC',
     419    url: 'todomvc/functional-prog-examples/elm/index.html',
     420    prepare: function (runner, contentWindow, contentDocument) {
     421        return runner.waitForElement('.new-todo').then(function (element) {
     422            element.focus();
     423            return element;
     424        });
     425    },
     426    tests: [
     427        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
     428            for (var i = 0; i < numberOfItemsToAdd; i++) {
     429                newTodo.value = 'Something to do ' + i;
     430                newTodo.dispatchEvent(new Event('input', {
     431                  bubbles: true,
     432                  cancelable: true
     433                }));
     434                triggerEnter(newTodo, 'keydown');
     435            }
     436        }),
     437        new BenchmarkTestStep('CompletingAllItems', function (params, contentWindow, contentDocument) {
     438            var checkboxes = contentDocument.querySelectorAll('.toggle');
     439            for (var i = 0; i < checkboxes.length; i++)
     440                checkboxes[i].click();
     441        }),
     442        new BenchmarkTestStep('DeletingItems', function (params, contentWindow, contentDocument) {
     443            var deleteButtons = contentDocument.querySelectorAll('.destroy');
     444            for (var i = 0; i < deleteButtons.length; i++)
     445                deleteButtons[i].click();
     446        }),
     447    ]
     448});
     449
     450Suites.push({
     451    name: 'Flight-TodoMVC',
     452    url: 'todomvc/dependency-examples/flight/flight/index.html',
     453    prepare: function (runner, contentWindow, contentDocument) {
     454        return runner.waitForElement('#new-todo').then(function (element) {
     455            element.focus();
     456            return element;
     457        });
     458    },
     459    tests: [
     460        new BenchmarkTestStep('Adding' + numberOfItemsToAdd + 'Items', function (newTodo, contentWindow, contentDocument) {
     461            for (var i = 0; i < numberOfItemsToAdd; i++) {
     462                newTodo.value = 'Something to do ' + i;
     463                triggerEnter(newTodo, 'keydown');
     464            }
     465        }),
     466        new BenchmarkTestStep('CompletingAllItems', function (params, contentWindow, contentDocument) {
     467            var checkboxes = contentDocument.querySelectorAll('.toggle');
     468            for (var i = 0; i < checkboxes.length; i++)
     469                checkboxes[i].click();
     470        }),
     471        new BenchmarkTestStep('DeletingItems', function (params, contentWindow, contentDocument) {
    254472            var deleteButtons = contentDocument.querySelectorAll('.destroy');
    255473            for (var i = 0; i < deleteButtons.length; i++)
  • trunk/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/angular/dist/index.html

    r216721 r216946  
    1010  <link rel="stylesheet" href="assets/css/todomvc-common.css">
    1111  <link rel="stylesheet" href="assets/css/todomvc-app.css">
    12 <link href="styles.d41d8cd98f00b204e980.bundle.css" rel="stylesheet"/></head>
     12</head>
    1313<body>
    1414  <app-root>Loading...</app-root>
  • trunk/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/assets/todomvc.js

    r216735 r216946  
    364364    };
    365365
    366     if (typeof exports === 'object') {
    367       module.exports = localStorageMemory;
    368     } else {
    369       root.localStorageMemory = localStorageMemory;
    370     }
    371   })(this);
     366    root.localStorageMemory = localStorageMemory;
     367  })(window);
    372368});
    373369define('todomvc/services/repo', ['exports', 'ember', 'todomvc/services/memory'], function (exports, _ember, _todomvcServicesMemory) {
     
    376372        data: null,
    377373        findAll: function findAll() {
    378             return this.get('data') || this.set('data', JSON.parse(_todomvcServicesMemory.getItem('todos') || '[]'));
     374            return this.get('data') || this.set('data', JSON.parse(window.localStorageMemory.getItem('todos') || '[]'));
    379375        },
    380376
     
    392388
    393389        persist: function persist() {
    394             _todomvcServicesMemory.setItem('todos', JSON.stringify(this.get('data')));
     390            window.localStorageMemory.setItem('todos', JSON.stringify(this.get('data')));
    395391        }
    396392    });
     
    12581254
    12591255if (!runningTests) {
    1260   require("todomvc/app")["default"].create({"name":"todomvc","version":"0.0.0+5dbc5fb9"});
     1256  require("todomvc/app")["default"].create({"name":"todomvc","version":"0.0.0+"});
    12611257}
    12621258
  • trunk/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/index.html

    r216735 r216946  
    77    <meta name="description" content="">
    88    <meta name="viewport" content="width=device-width, initial-scale=1">
    9     <base href="/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs" />
    10    
    11 <meta name="todomvc/config/environment" content="%7B%22modulePrefix%22%3A%22todomvc%22%2C%22environment%22%3A%22development%22%2C%22baseURL%22%3Anull%2C%22locationType%22%3A%22auto%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%7D%2C%22APP%22%3A%7B%22name%22%3A%22todomvc%22%2C%22version%22%3A%220.0.0+5dbc5fb9%22%7D%2C%22exportApplicationGlobal%22%3Atrue%7D" />
     9   
     10<meta name="todomvc/config/environment" content="%7B%22modulePrefix%22%3A%22todomvc%22%2C%22environment%22%3A%22development%22%2C%22locationType%22%3A%22none%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%7D%2C%22APP%22%3A%7B%22name%22%3A%22todomvc%22%2C%22version%22%3A%220.0.0%202c3f8158%22%7D%2C%22exportApplicationGlobal%22%3Atrue%7D" />
    1211
    13     <link rel="stylesheet" href="/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/assets/vendor.css">
    14     <link rel="stylesheet" href="/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/assets/todomvc.css">
     12    <link rel="stylesheet" href="assets/vendor.css">
    1513
    1614   
     
    1917   
    2018
    21     <script src="/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/assets/vendor.js"></script>
    22     <script src="/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/assets/todomvc.js"></script>
     19    <script src="assets/vendor.js"></script>
     20    <script src="assets/todomvc.js"></script>
    2321
    2422   
  • trunk/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/source/app/index.html

    r216735 r216946  
    77    <meta name="description" content="">
    88    <meta name="viewport" content="width=device-width, initial-scale=1">
    9     <base href="/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs" />
    109    {{content-for "head"}}
    1110
    12     <link rel="stylesheet" href="/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/assets/vendor.css">
    13     <link rel="stylesheet" href="/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/assets/todomvc.css">
     11    <link rel="stylesheet" href="assets/vendor.css">
     12    <link rel="stylesheet" href="assets/todomvc.css">
    1413
    1514    {{content-for "head-footer"}}
     
    1817    {{content-for "body"}}
    1918
    20     <script src="/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/assets/vendor.js"></script>
    21     <script src="/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/assets/todomvc.js"></script>
     19    <script src="assets/vendor.js"></script>
     20    <script src="assets/todomvc.js"></script>
    2221
    2322    {{content-for "body-footer"}}
  • trunk/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/source/app/services/memory.js

    r216735 r216946  
    7575  };
    7676
    77   if (typeof exports === 'object') {
    78     module.exports = localStorageMemory;
    79   } else {
    8077    root.localStorageMemory = localStorageMemory;
    81   }
    82 })(this);
     78})(window);
  • trunk/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/source/app/services/repo.js

    r216735 r216946  
    11import Ember from 'ember';
    2 import * as localStorageMemory from './memory';
     2import localStorageMemory from './memory';
    33
    44export default Ember.Service.extend({
     
    77    findAll() {
    88        return this.get('data') ||
    9             this.set('data', JSON.parse(localStorageMemory.getItem('todos') || '[]'));
     9            this.set('data', JSON.parse(window.localStorageMemory.getItem('todos') || '[]'));
    1010    },
    1111
     
    2323
    2424    persist() {
    25         localStorageMemory.setItem('todos', JSON.stringify(this.get('data')));
     25        window.localStorageMemory.setItem('todos', JSON.stringify(this.get('data')));
    2626    }
    2727});
  • trunk/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/index.html

    r216735 r216946  
    99
    1010    <base href="/" />
    11 <meta name="todomvc/config/environment" content="%7B%22modulePrefix%22%3A%22todomvc%22%2C%22environment%22%3A%22test%22%2C%22baseURL%22%3A%22/%22%2C%22locationType%22%3A%22none%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%7D%2C%22APP%22%3A%7B%22LOG_ACTIVE_GENERATION%22%3Afalse%2C%22LOG_VIEW_LOOKUPS%22%3Afalse%2C%22rootElement%22%3A%22%23ember-testing%22%2C%22name%22%3A%22todomvc%22%2C%22version%22%3A%220.0.0+5dbc5fb9%22%7D%2C%22exportApplicationGlobal%22%3Atrue%7D" />
     11<meta name="todomvc/config/environment" content="%7B%22modulePrefix%22%3A%22todomvc%22%2C%22environment%22%3A%22test%22%2C%22baseURL%22%3A%22/%22%2C%22locationType%22%3A%22none%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%7D%2C%22APP%22%3A%7B%22LOG_ACTIVE_GENERATION%22%3Afalse%2C%22LOG_VIEW_LOOKUPS%22%3Afalse%2C%22rootElement%22%3A%22%23ember-testing%22%2C%22name%22%3A%22todomvc%22%2C%22version%22%3A%220.0.0+%22%7D%2C%22exportApplicationGlobal%22%3Atrue%7D" />
    1212   
    1313
  • trunk/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/jquery/index.html

    r216713 r216946  
    5656        <script src="node_modules/jquery/dist/jquery.js"></script>
    5757        <script src="node_modules/handlebars/dist/handlebars.js"></script>
    58         <script src="node_modules/director/build/director.js"></script>
     58        <script src="node_modules/director/dist/director.js"></script>
    5959        <script src="js/app.js"></script>
    6060    </body>
  • trunk/PerformanceTests/Speedometer/resources/todomvc/functional-prog-examples/elm/index.html

    r216717 r216946  
    1717
    1818<body>
    19 <script src="build/elm.js"></script>
     19<script src="dist/elm.js"></script>
    2020<script>
    2121    (function () {
Note: See TracChangeset for help on using the changeset viewer.