2014-12-22 20:50:10 -05:00
|
|
|
"use strict";
|
2015-01-06 18:19:22 -05:00
|
|
|
var benchpress = require('../../../tools/benchpress/index.js');
|
2014-12-22 20:50:10 -05:00
|
|
|
|
|
|
|
describe('ng1.x compiler benchmark', function () {
|
|
|
|
|
|
|
|
var URL = 'benchmarks_external/web/compiler/compiler_benchmark.html';
|
|
|
|
|
2014-12-29 18:36:29 -05:00
|
|
|
afterEach(benchpress.verifyNoBrowserErrors);
|
2014-12-22 20:50:10 -05:00
|
|
|
|
|
|
|
it('should log withBinding stats', function() {
|
2014-12-29 19:15:41 -05:00
|
|
|
browser.get(URL);
|
2015-01-07 14:31:18 -05:00
|
|
|
runClickBenchmark({
|
2014-12-22 20:50:10 -05:00
|
|
|
buttons: ['#compileWithBindings'],
|
2014-12-29 18:36:29 -05:00
|
|
|
logId: 'ng1.compile.withBindings'
|
2014-12-22 20:50:10 -05:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should log noBindings stats', function() {
|
2014-12-29 18:36:29 -05:00
|
|
|
browser.get(URL);
|
2015-01-07 14:31:18 -05:00
|
|
|
runClickBenchmark({
|
2014-12-22 20:50:10 -05:00
|
|
|
buttons: ['#compileNoBindings'],
|
2014-12-29 18:36:29 -05:00
|
|
|
logId: 'ng1.compile.noBindings'
|
2014-12-22 20:50:10 -05:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
2014-12-29 18:36:29 -05:00
|
|
|
|
2015-01-07 14:31:18 -05:00
|
|
|
function runClickBenchmark(config) {
|
2014-12-29 18:36:29 -05:00
|
|
|
var buttons = config.buttons.map(function(selector) {
|
|
|
|
return $(selector);
|
|
|
|
});
|
2015-01-07 17:35:42 -05:00
|
|
|
var params = Object.create(browser.params.benchmark);
|
|
|
|
params.logId = browser.params.lang+'.'+config.logId;
|
|
|
|
benchpress.runBenchmark(params, function() {
|
2014-12-29 18:36:29 -05:00
|
|
|
buttons.forEach(function(button) {
|
|
|
|
button.click();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|