gecko-dev/third_party/speedometer/InteractiveRunner.html
Ehsan Akhgari c730abe449 Bug 1405371 - Part 1: Update the Speedometer benchmark to WebKit r222778; r=ted
--HG--
rename : third_party/speedometer/resources/todomvc/architecture-examples/angular/dist/main.c82799edffc751aa6590.bundle.js => third_party/speedometer/resources/todomvc/architecture-examples/angular/dist/main.f1c5d33a6950c335064d.bundle.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/assets/todomvc.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/assets/todomvc.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/assets/vendor.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/assets/vendor.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/crossdomain.xml => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/crossdomain.xml
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/robots.txt => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/robots.txt
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/.bowerrc => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/.bowerrc
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/.editorconfig => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/.editorconfig
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/.ember-cli => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/.ember-cli
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/.gitignore => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/.gitignore
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/.jshintrc => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/.jshintrc
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/.travis.yml => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/.travis.yml
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/.watchmanconfig => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/.watchmanconfig
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/app.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/app.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/components/todo-item.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/components/todo-item.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/components/todo-list.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/components/todo-list.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/controllers/active.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/controllers/active.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/controllers/application.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/controllers/application.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/controllers/completed.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/controllers/completed.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/helpers/gt.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/helpers/gt.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/helpers/pluralize.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/helpers/pluralize.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/resolver.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/resolver.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/routes/application.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/routes/application.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/services/memory.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/services/memory.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/services/repo.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/services/repo.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/templates/active.hbs => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/templates/active.hbs
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/templates/application.hbs => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/templates/application.hbs
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/templates/completed.hbs => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/templates/completed.hbs
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/templates/components/todo-item.hbs => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/templates/components/todo-item.hbs
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/templates/components/todo-list.hbs => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/templates/components/todo-list.hbs
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/templates/index.hbs => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/app/templates/index.hbs
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/ember-cli-build.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/ember-cli-build.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/dist/crossdomain.xml => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/public/crossdomain.xml
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/dist/robots.txt => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/public/robots.txt
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/testem.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/testem.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/tests/helpers/destroy-app.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/tests/helpers/destroy-app.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/tests/helpers/resolver.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/tests/helpers/resolver.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/tests/test-helper.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/tests/test-helper.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/vendor/base.css => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/vendor/base.css
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/vendor/index.css => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/vendor/index.css
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/testem.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/testem.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/tests/index.html => third_party/speedometer/resources/todomvc/architecture-examples/emberjs-debug/tests/index.html
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/.bowerrc => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/.bowerrc
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/.editorconfig => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/.editorconfig
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/.ember-cli => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/.ember-cli
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/.jshintrc => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/.jshintrc
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/app.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/app.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/components/todo-item.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/components/todo-item.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/controllers/active.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/controllers/active.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/controllers/application.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/controllers/application.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/controllers/completed.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/controllers/completed.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/helpers/gt.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/helpers/gt.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/helpers/pluralize.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/helpers/pluralize.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/resolver.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/resolver.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/router.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/router.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/routes/application.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/routes/application.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/services/memory.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/services/memory.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/services/repo.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/services/repo.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/templates/active.hbs => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/templates/active.hbs
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/templates/completed.hbs => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/templates/completed.hbs
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/templates/components/todo-item.hbs => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/templates/components/todo-item.hbs
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/app/templates/index.hbs => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/app/templates/index.hbs
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/bower.json => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/bower.json
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/config/environment.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/config/environment.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/dist/assets/vendor-820919567eb7bd4d9fac358a90a5aac4.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/dist/assets/vendor-820919567eb7bd4d9fac358a90a5aac4.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/public/crossdomain.xml => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/dist/crossdomain.xml
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/public/robots.txt => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/dist/robots.txt
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/ember-cli-build.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/ember-cli-build.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/package-lock.json => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/package-lock.json
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/package.json => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/package.json
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/crossdomain.xml => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/public/crossdomain.xml
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/robots.txt => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/public/robots.txt
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/tests/helpers/destroy-app.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/destroy-app.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/tests/helpers/module-for-acceptance.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/module-for-acceptance.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/tests/helpers/resolver.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/resolver.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/tests/helpers/start-app.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/start-app.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/tests/test-helper.js => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/tests/test-helper.js
rename : third_party/speedometer/resources/todomvc/architecture-examples/emberjs/source/vendor/base.css => third_party/speedometer/resources/todomvc/architecture-examples/emberjs/vendor/base.css
2017-10-06 15:52:36 -04:00

174 lines
5.9 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Speedometer 2.0 Interactive Runner</title>
<script src="resources/benchmark-runner.js" defer></script>
<script src="resources/tests.js" defer></script>
<style>
iframe { border: 1px solid black; }
ol { list-style: none; margin: 0; padding: 0; }
ol ol { margin-left: 2em; list-position: outside; }
.running { text-decoration: underline; }
.ran { color: grey; }
nav { position: absolute; right: 10px; height: 600px; }
nav > ol { height: 100%; overflow-y: scroll; }
</style>
</head>
<body>
<script>
function formatTestName(suiteName, testName) {
return suiteName + (testName ? '/' + testName : '');
}
function createUIForSuites(suites, onstep, onrun) {
var control = document.createElement('nav');
var ol = document.createElement('ol');
var checkboxes = [];
for (var suiteIndex = 0; suiteIndex < suites.length; suiteIndex++) {
var suite = suites[suiteIndex];
var li = document.createElement('li');
var checkbox = document.createElement('input');
checkbox.id = suite.name;
checkbox.type = 'checkbox';
checkbox.checked = !suite.disabled;
checkbox.onchange = (function (suite, checkbox) { return function () { suite.disabled = !checkbox.checked; } })(suite, checkbox);
checkbox.onchange();
checkboxes.push(checkbox);
li.appendChild(checkbox);
var label = document.createElement('label');
label.appendChild(document.createTextNode(formatTestName(suite.name)));
li.appendChild(label);
label.htmlFor = checkbox.id;
var testList = document.createElement('ol');
for (var testIndex = 0; testIndex < suite.tests.length; testIndex++) {
var testItem = document.createElement('li');
var test = suite.tests[testIndex];
var anchor = document.createElement('a');
anchor.id = suite.name + '-' + test.name;
test.anchor = anchor;
anchor.appendChild(document.createTextNode(formatTestName(suite.name, test.name)));
testItem.appendChild(anchor);
testList.appendChild(testItem);
}
li.appendChild(testList);
ol.appendChild(li);
}
control.appendChild(ol);
var button = document.createElement('button');
button.textContent = 'Step';
button.onclick = onstep;
control.appendChild(button);
var button = document.createElement('button');
button.textContent = 'Run';
button.id = 'runSuites';
button.onclick = onrun;
control.appendChild(button);
var button = document.createElement('button');
button.textContent = 'Select all';
button.onclick = function () {
for (var suiteIndex = 0; suiteIndex < suites.length; suiteIndex++) {
suites[suiteIndex].disabled = false;
checkboxes[suiteIndex].checked = true;
}
};
control.appendChild(button);
var button = document.createElement('button');
button.textContent = 'Unselect all';
button.onclick = function () {
for (var suiteIndex = 0; suiteIndex < suites.length; suiteIndex++) {
suites[suiteIndex].disabled = true;
checkboxes[suiteIndex].checked = false;
}
};
control.appendChild(button);
return control;
}
var parseQueryString = (function (pairList) {
var pairs = {};
for (var i = 0; i < pairList.length; ++i) {
var keyValue = pairList[i].split('=', 2);
if (keyValue.length == 1)
pairs[keyValue[0]] = '';
else
pairs[keyValue[0]] = decodeURIComponent(keyValue[1].replace(/\+/g, ' '));
}
return pairs;
})(window.location.search.substr(1).split('&'));
function disableAllSuitesExcept(suiteName) {
Suites.forEach(function(element) {
if (element.name !== suiteName)
element.disabled = true;
});
}
function startTest() {
var queryParam = parseQueryString['suite'];
if (queryParam !== undefined)
disableAllSuitesExcept(queryParam);
var runner = new BenchmarkRunner(Suites, {
willRunTest: function (suite, test) {
test.anchor.classList.add('running');
},
didRunTest: function (suite, test) {
var classList = test.anchor.classList;
classList.remove('running');
classList.add('ran');
},
didRunSuites: function (measuredValues) {
var results = '';
for (var suiteName in measuredValues.tests) {
var suiteResults = measuredValues.tests[suiteName];
for (var testName in suiteResults.tests) {
var testResults = suiteResults.tests[testName];
for (var subtestName in testResults.tests) {
results += suiteName + ' : ' + testName + ' : ' + subtestName
+ ': ' + testResults.tests[subtestName] + ' ms\n';
}
}
results += suiteName + ' : ' + suiteResults.total + ' ms\n';
}
results += 'Arithmetic Mean : ' + measuredValues.mean + ' ms\n';
results += 'Geometric Mean : ' + measuredValues.geomean + ' ms\n';
results += 'Total : ' + measuredValues.total + ' ms\n';
results += 'Score : ' + measuredValues.score + ' rpm\n';
if (!results)
return;
var pre = document.createElement('pre');
document.body.appendChild(pre);
pre.textContent = results;
}
});
var currentState = null;
// Don't call step while step is already executing.
document.body.appendChild(createUIForSuites(Suites,
function () { runner.step(currentState).then(function (state) { currentState = state; }); },
function () { runner.runAllSteps(currentState); currentState = null; }));
if (parseQueryString['startAutomatically'] !== undefined)
document.getElementById('runSuites').click();
}
window.addEventListener('load', startTest);
</script>
</body>
</html>