2016-10-23 16:37:15 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
import {verifyNoBrowserErrors} from '@angular/testing/src/e2e_util';
|
|
|
|
import {runClickBenchmark} from '@angular/testing/src/perf_util';
|
2015-05-30 00:40:15 -04:00
|
|
|
|
|
|
|
describe('ng2 selector benchmark', function() {
|
|
|
|
|
|
|
|
var URL = 'benchmarks/src/compiler/selector_benchmark.html';
|
|
|
|
|
2015-05-30 11:17:27 -04:00
|
|
|
afterEach(verifyNoBrowserErrors);
|
2015-05-30 00:40:15 -04:00
|
|
|
|
|
|
|
it('should log parse stats', function(done) {
|
2015-05-30 11:17:27 -04:00
|
|
|
runClickBenchmark({
|
|
|
|
url: URL,
|
|
|
|
buttons: ['#parse'],
|
|
|
|
id: 'ng2.selector.parse',
|
2015-08-27 11:44:59 -04:00
|
|
|
params: [{name: 'selectors', value: 10000, scale: 'linear'}],
|
|
|
|
waitForAngular2: false
|
2015-05-30 11:17:27 -04:00
|
|
|
}).then(done, done.fail);
|
2015-05-30 00:40:15 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should log addSelectable stats', function(done) {
|
2015-05-30 11:17:27 -04:00
|
|
|
runClickBenchmark({
|
|
|
|
url: URL,
|
|
|
|
buttons: ['#addSelectable'],
|
|
|
|
id: 'ng2.selector.addSelectable',
|
2015-08-27 11:44:59 -04:00
|
|
|
params: [{name: 'selectors', value: 10000, scale: 'linear'}],
|
|
|
|
waitForAngular2: false
|
2015-05-30 11:17:27 -04:00
|
|
|
}).then(done, done.fail);
|
2015-05-30 00:40:15 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should log match stats', function(done) {
|
2015-05-30 11:17:27 -04:00
|
|
|
runClickBenchmark({
|
|
|
|
url: URL,
|
|
|
|
buttons: ['#match'],
|
|
|
|
id: 'ng2.selector.match',
|
2015-08-27 11:44:59 -04:00
|
|
|
params: [{name: 'selectors', value: 10000, scale: 'linear'}],
|
|
|
|
waitForAngular2: false
|
2015-05-30 11:17:27 -04:00
|
|
|
}).then(done, done.fail);
|
2015-05-30 00:40:15 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|