diff --git a/modules/benchmarks/e2e_test/old/compiler_perf.ts b/modules/benchmarks/e2e_test/old/compiler_perf.ts index e19852d422..1ab1bfd0d9 100644 --- a/modules/benchmarks/e2e_test/old/compiler_perf.ts +++ b/modules/benchmarks/e2e_test/old/compiler_perf.ts @@ -15,7 +15,7 @@ describe('ng2 compiler benchmark', function() { afterEach(verifyNoBrowserErrors); - it('should log withBindings stats', function(done) { + it('should log withBindings stats', async() => { browser.sleep(1000); runBenchmark({ url: URL, @@ -25,10 +25,10 @@ describe('ng2 compiler benchmark', function() { browser.executeScript('document.querySelector("#compileWithBindings").click()'); browser.sleep(500); } - }).then(done, done.fail); + }); }); - it('should log noBindings stats', function(done) { + it('should log noBindings stats', async() => { browser.sleep(1000); runBenchmark({ url: URL, @@ -38,7 +38,7 @@ describe('ng2 compiler benchmark', function() { browser.executeScript('document.querySelector("#compileNoBindings").click()'); browser.sleep(500); } - }).then(done, done.fail); + }); }); }); diff --git a/modules/benchmarks/e2e_test/old/costs_perf.ts b/modules/benchmarks/e2e_test/old/costs_perf.ts index 3e86ac7777..fdbab55936 100644 --- a/modules/benchmarks/e2e_test/old/costs_perf.ts +++ b/modules/benchmarks/e2e_test/old/costs_perf.ts @@ -18,30 +18,30 @@ describe('ng2 cost benchmark', function() { afterEach(verifyNoBrowserErrors); - it('should log stats for baseline (plain components)', function(done) { + it('should log stats for baseline (plain components)', async() => { runClickBenchmark({ url: URL, buttons: ['#reset', '#createPlainComponents'], id: 'ng2.costs.baseline', params: [{name: 'size', value: benchmarkSize, scale: 'linear'}] - }).then(done, done.fail); + }); }); - it('should log stats for components with decorators', function(done) { + it('should log stats for components with decorators', async() => { runClickBenchmark({ url: URL, buttons: ['#reset', '#createComponentsWithDirectives'], id: 'ng2.costs.decorators', params: [{name: 'size', value: benchmarkSize, scale: 'linear'}] - }).then(done, done.fail); + }); }); - it('should log stats for dynamic components', function(done) { + it('should log stats for dynamic components', async() => { runClickBenchmark({ url: URL, buttons: ['#reset', '#createDynamicComponents'], id: 'ng2.costs.dynamic', params: [{name: 'size', value: benchmarkSize, scale: 'linear'}] - }).then(done, done.fail); + }); }); }); diff --git a/modules/benchmarks/e2e_test/old/di_perf.ts b/modules/benchmarks/e2e_test/old/di_perf.ts index 7716e8c8e6..5cb36f06d2 100644 --- a/modules/benchmarks/e2e_test/old/di_perf.ts +++ b/modules/benchmarks/e2e_test/old/di_perf.ts @@ -15,7 +15,7 @@ describe('ng2 di benchmark', function() { afterEach(verifyNoBrowserErrors); - it('should log the stats for getByToken', function(done) { + it('should log the stats for getByToken', async() => { runClickBenchmark({ url: URL, buttons: ['#getByToken'], @@ -23,10 +23,10 @@ describe('ng2 di benchmark', function() { params: [{name: 'iterations', value: 20000, scale: 'linear'}], microMetrics: {'injectAvg': 'avg time for injection (in ms)'}, waitForAngular2: false - }).then(done, done.fail); + }); }); - it('should log the stats for getByKey', function(done) { + it('should log the stats for getByKey', async() => { runClickBenchmark({ url: URL, buttons: ['#getByKey'], @@ -34,10 +34,10 @@ describe('ng2 di benchmark', function() { params: [{name: 'iterations', value: 20000, scale: 'linear'}], microMetrics: {'injectAvg': 'avg time for injection (in ms)'}, waitForAngular2: false - }).then(done, done.fail); + }); }); - it('should log the stats for getChild', function(done) { + it('should log the stats for getChild', async() => { runClickBenchmark({ url: URL, buttons: ['#getChild'], @@ -45,10 +45,10 @@ describe('ng2 di benchmark', function() { params: [{name: 'iterations', value: 20000, scale: 'linear'}], microMetrics: {'injectAvg': 'avg time for getChild (in ms)'}, waitForAngular2: false - }).then(done, done.fail); + }); }); - it('should log the stats for instantiate', function(done) { + it('should log the stats for instantiate', async() => { runClickBenchmark({ url: URL, buttons: ['#instantiate'], @@ -56,14 +56,14 @@ describe('ng2 di benchmark', function() { params: [{name: 'iterations', value: 10000, scale: 'linear'}], microMetrics: {'injectAvg': 'avg time for instantiate (in ms)'}, waitForAngular2: false - }).then(done, done.fail); + }); }); /** * This benchmark measures the cost of creating a new injector with a mix * of binding types: Type, unresolved, unflattened. */ - it('should log the stats for createVariety', function(done) { + it('should log the stats for createVariety', async() => { runClickBenchmark({ url: URL, buttons: ['#createVariety'], @@ -71,13 +71,13 @@ describe('ng2 di benchmark', function() { params: [{name: 'iterations', value: 10000, scale: 'linear'}], microMetrics: {'injectAvg': 'avg time for createVariety (in ms)'}, waitForAngular2: false - }).then(done, done.fail); + }); }); /** * Same as 'createVariety' benchmark but operates on fully resolved bindings. */ - it('should log the stats for createVarietyResolved', function(done) { + it('should log the stats for createVarietyResolved', async() => { runClickBenchmark({ url: URL, buttons: ['#createVarietyResolved'], @@ -85,7 +85,7 @@ describe('ng2 di benchmark', function() { params: [{name: 'iterations', value: 10000, scale: 'linear'}], microMetrics: {'injectAvg': 'avg time for createVarietyResolved (in ms)'}, waitForAngular2: false - }).then(done, done.fail); + }); }); }); diff --git a/modules/benchmarks/e2e_test/old/largetable_perf.ts b/modules/benchmarks/e2e_test/old/largetable_perf.ts index 046c01e385..dcc30557cc 100644 --- a/modules/benchmarks/e2e_test/old/largetable_perf.ts +++ b/modules/benchmarks/e2e_test/old/largetable_perf.ts @@ -23,7 +23,7 @@ describe('ng2 largetable benchmark', function() { // 'interpolationFilter' ['interpolation', 'interpolationAttr', 'interpolationFn'].forEach(function(benchmarkType) { - it('should log the ng stats with: ' + benchmarkType, function(done) { + it('should log the ng stats with: ' + benchmarkType, async() => { runClickBenchmark({ url: URL, buttons: ['#ng2DestroyDom', '#ng2CreateDom'], @@ -32,11 +32,11 @@ describe('ng2 largetable benchmark', function() { {name: 'rows', value: 20, scale: 'sqrt'}, {name: 'columns', value: 20, scale: 'sqrt'}, {name: 'benchmarkType', value: benchmarkType} ] - }).then(done, done.fail); + }); }); }); - it('should log the baseline stats', function(done) { + it('should log the baseline stats', async() => { runClickBenchmark({ url: URL, buttons: ['#baselineDestroyDom', '#baselineCreateDom'], @@ -45,7 +45,7 @@ describe('ng2 largetable benchmark', function() { {name: 'rows', value: 100, scale: 'sqrt'}, {name: 'columns', value: 20, scale: 'sqrt'}, {name: 'benchmarkType', value: 'baseline'} ] - }).then(done, done.fail); + }); }); }); diff --git a/modules/benchmarks/e2e_test/old/naive_infinite_scroll_perf.ts b/modules/benchmarks/e2e_test/old/naive_infinite_scroll_perf.ts index 9fa9cc7aaf..df59e87fbf 100644 --- a/modules/benchmarks/e2e_test/old/naive_infinite_scroll_perf.ts +++ b/modules/benchmarks/e2e_test/old/naive_infinite_scroll_perf.ts @@ -16,7 +16,7 @@ describe('ng2 naive infinite scroll benchmark', function() { afterEach(verifyNoBrowserErrors); [1, 2, 4].forEach(function(appSize) { - it('should run scroll benchmark and collect stats for appSize = ' + appSize, function(done) { + it('should run scroll benchmark and collect stats for appSize = ' + appSize, async() => { runBenchmark({ url: URL, id: 'ng2.naive_infinite_scroll', @@ -31,7 +31,7 @@ describe('ng2 naive infinite scroll benchmark', function() { {name: 'appSize', value: appSize}, {name: 'iterationCount', value: 20, scale: 'linear'}, {name: 'scrollIncrement', value: 40} ] - }).then(done, done.fail); + }); }); }); diff --git a/modules/benchmarks/e2e_test/old/naive_infinite_scroll_spec.ts b/modules/benchmarks/e2e_test/old/naive_infinite_scroll_spec.ts index 6d74ab6cf3..68c7bf6fb4 100644 --- a/modules/benchmarks/e2e_test/old/naive_infinite_scroll_spec.ts +++ b/modules/benchmarks/e2e_test/old/naive_infinite_scroll_spec.ts @@ -15,7 +15,7 @@ describe('ng2 naive infinite scroll benchmark', function() { afterEach(verifyNoBrowserErrors); - it('should not throw errors', function() { + it('should not throw errors', async() => { browser.get(URL); const expectedRowCount = 18; const expectedCellsPerRow = 27; diff --git a/modules/benchmarks/e2e_test/old/page_load_perf.ts b/modules/benchmarks/e2e_test/old/page_load_perf.ts index 29fc80013f..ee52cd8bf9 100644 --- a/modules/benchmarks/e2e_test/old/page_load_perf.ts +++ b/modules/benchmarks/e2e_test/old/page_load_perf.ts @@ -16,7 +16,7 @@ describe('ng2 largetable benchmark', function() { afterEach(verifyNoBrowserErrors); - it('should log the load time', function(done) { + it('should log the load time', async() => { runner .sample({ id: 'loadTime', diff --git a/modules/benchmarks/e2e_test/old/selector_perf.ts b/modules/benchmarks/e2e_test/old/selector_perf.ts index f1fdbe346d..102a5ef234 100644 --- a/modules/benchmarks/e2e_test/old/selector_perf.ts +++ b/modules/benchmarks/e2e_test/old/selector_perf.ts @@ -15,34 +15,34 @@ describe('ng2 selector benchmark', function() { afterEach(verifyNoBrowserErrors); - it('should log parse stats', function(done) { + it('should log parse stats', async() => { runClickBenchmark({ url: URL, buttons: ['#parse'], id: 'ng2.selector.parse', params: [{name: 'selectors', value: 10000, scale: 'linear'}], waitForAngular2: false - }).then(done, done.fail); + }); }); - it('should log addSelectable stats', function(done) { + it('should log addSelectable stats', async() => { runClickBenchmark({ url: URL, buttons: ['#addSelectable'], id: 'ng2.selector.addSelectable', params: [{name: 'selectors', value: 10000, scale: 'linear'}], waitForAngular2: false - }).then(done, done.fail); + }); }); - it('should log match stats', function(done) { + it('should log match stats', async() => { runClickBenchmark({ url: URL, buttons: ['#match'], id: 'ng2.selector.match', params: [{name: 'selectors', value: 10000, scale: 'linear'}], waitForAngular2: false - }).then(done, done.fail); + }); }); }); diff --git a/modules/benchmarks/e2e_test/old/static_tree_perf.ts b/modules/benchmarks/e2e_test/old/static_tree_perf.ts index 3bf0dc782f..bf71a39b68 100644 --- a/modules/benchmarks/e2e_test/old/static_tree_perf.ts +++ b/modules/benchmarks/e2e_test/old/static_tree_perf.ts @@ -15,34 +15,34 @@ describe('ng2 static tree benchmark', function() { afterEach(verifyNoBrowserErrors); - it('should log the ng stats', function(done) { + it('should log the ng stats', async() => { runClickBenchmark({ url: URL, buttons: ['#ng2DestroyDom', '#ng2CreateDom'], id: 'ng2.static.tree.create.plain', params: [] - }).then(done, done.fail); + }); }); - it('should log the ng stats (update)', function(done) { + it('should log the ng stats (update)', async() => { runClickBenchmark( {url: URL, buttons: ['#ng2CreateDom'], id: 'ng2.static.tree.update', params: []}) - .then(done, done.fail); + ; }); - it('should log the baseline stats', function(done) { + it('should log the baseline stats', async() => { runClickBenchmark({ url: URL, buttons: ['#baselineDestroyDom', '#baselineCreateDom'], id: 'baseline.static.tree.create', params: [] - }).then(done, done.fail); + }); }); - it('should log the baseline stats (update)', function(done) { + it('should log the baseline stats (update)', async() => { runClickBenchmark( {url: URL, buttons: ['#baselineCreateDom'], id: 'baseline.static.tree.update', params: []}) - .then(done, done.fail); + ; }); }); diff --git a/modules/benchmarks/src/class_bindings/class_bindings.perf-spec.ts b/modules/benchmarks/src/class_bindings/class_bindings.perf-spec.ts index f4c5991b01..4d78e6177f 100644 --- a/modules/benchmarks/src/class_bindings/class_bindings.perf-spec.ts +++ b/modules/benchmarks/src/class_bindings/class_bindings.perf-spec.ts @@ -11,7 +11,7 @@ import {runBenchmark} from '../../../e2e_util/perf_util'; describe('class bindings perf', () => { - it('should work for update', done => { + it('should work for update', async() => { browser.rootEl = '#root'; runBenchmark({ id: 'create', @@ -20,10 +20,10 @@ describe('class bindings perf', () => { params: [], prepare: () => $('#destroy').click(), work: () => $('#create').click() - }).then(done, done.fail); + }); }); - it('should work for update', done => { + it('should work for update', async() => { browser.rootEl = '#root'; runBenchmark({ id: 'update', @@ -32,7 +32,7 @@ describe('class bindings perf', () => { params: [], prepare: () => $('#create').click(), work: () => $('#update').click() - }).then(done, done.fail); + }); }); }); diff --git a/modules/benchmarks/src/expanding_rows/expanding_rows.perf-spec.ts b/modules/benchmarks/src/expanding_rows/expanding_rows.perf-spec.ts index d8aec894e3..af0866b081 100644 --- a/modules/benchmarks/src/expanding_rows/expanding_rows.perf-spec.ts +++ b/modules/benchmarks/src/expanding_rows/expanding_rows.perf-spec.ts @@ -11,7 +11,7 @@ import {runBenchmark} from '../../../e2e_util/perf_util'; describe('benchmarks', () => { - it('should work for create', done => { + it('should work for create', async() => { browser.rootEl = '#root'; runBenchmark({ id: 'create', @@ -20,7 +20,7 @@ describe('benchmarks', () => { params: [], prepare: () => $('#reset').click(), work: () => $('#init').click() - }).then(done, done.fail); + }); }); }); diff --git a/modules/benchmarks/src/js-web-frameworks/js-web-frameworks.perf-spec.ts b/modules/benchmarks/src/js-web-frameworks/js-web-frameworks.perf-spec.ts index dfa3ab797f..cac361f166 100644 --- a/modules/benchmarks/src/js-web-frameworks/js-web-frameworks.perf-spec.ts +++ b/modules/benchmarks/src/js-web-frameworks/js-web-frameworks.perf-spec.ts @@ -53,13 +53,13 @@ describe('js-web-frameworks benchmark perf', () => { [Create1KWorker, Delete1KWorker, UpdateWorker, SwapWorker].forEach((worker) => { describe(worker.id, () => { - it(`should run benchmark for ${testPackageName}`, done => { + it(`should run benchmark for ${testPackageName}`, async() => { runTableBenchmark({ id: `js-web-frameworks.${testPackageName}.${worker.id}`, url: '/', ignoreBrowserSynchronization: true, worker: worker - }).then(done, done.fail); + }); }); }); }); diff --git a/modules/benchmarks/src/largeform/largeform.perf-spec.ts b/modules/benchmarks/src/largeform/largeform.perf-spec.ts index b297d0455f..fe06cd8ef3 100644 --- a/modules/benchmarks/src/largeform/largeform.perf-spec.ts +++ b/modules/benchmarks/src/largeform/largeform.perf-spec.ts @@ -31,9 +31,8 @@ describe('largeform benchmark spec', () => { [CreateAndDestroyWorker].forEach((worker) => { describe(worker.id, () => { - it('should run for ng2', done => { - runLargeFormBenchmark({url: '/', id: `largeform.ng2.${worker.id}`, worker: worker}) - .then(done, done.fail); + it('should run for ng2', async() => { + await runLargeFormBenchmark({url: '/', id: `largeform.ng2.${worker.id}`, worker: worker}); }); }); }); diff --git a/modules/benchmarks/src/largetable/largetable.e2e-spec.ts b/modules/benchmarks/src/largetable/largetable.e2e-spec.ts index 2e3f1a0e76..0068b33b2a 100644 --- a/modules/benchmarks/src/largetable/largetable.e2e-spec.ts +++ b/modules/benchmarks/src/largetable/largetable.e2e-spec.ts @@ -13,17 +13,17 @@ import {openBrowser, verifyNoBrowserErrors} from '../../../e2e_util/e2e_util'; describe('largetable benchmark', () => { afterEach(verifyNoBrowserErrors); - it(`should render the table`, () => { + it(`should render the table`, async() => { openBrowser({ url: '', ignoreBrowserSynchronization: true, params: [{name: 'cols', value: 5}, {name: 'rows', value: 5}], }); - $('#createDom').click(); + await $('#createDom').click(); expect($('#root').getText()).toContain('0/0'); - $('#createDom').click(); + await $('#createDom').click(); expect($('#root').getText()).toContain('A/A'); - $('#destroyDom').click(); + await $('#destroyDom').click(); expect($('#root').getText() as any).toEqual(''); }); }); diff --git a/modules/benchmarks/src/largetable/largetable.perf-spec.ts b/modules/benchmarks/src/largetable/largetable.perf-spec.ts index de90152786..9c521c2562 100644 --- a/modules/benchmarks/src/largetable/largetable.perf-spec.ts +++ b/modules/benchmarks/src/largetable/largetable.perf-spec.ts @@ -48,13 +48,13 @@ describe('largetable benchmark perf', () => { [CreateOnlyWorker, CreateAndDestroyWorker, UpdateWorker].forEach((worker) => { describe(worker.id, () => { - it(`should run benchmark for ${testPackageName}`, done => { + it(`should run benchmark for ${testPackageName}`, async() => { runTableBenchmark({ id: `largeTable.${testPackageName}.${worker.id}`, url: '/', ignoreBrowserSynchronization: true, worker: worker - }).then(done, done.fail); + }); }); }); }); diff --git a/modules/benchmarks/src/styling/styling_perf.spec.ts b/modules/benchmarks/src/styling/styling_perf.spec.ts index 5592e17da5..edf69fd43d 100644 --- a/modules/benchmarks/src/styling/styling_perf.spec.ts +++ b/modules/benchmarks/src/styling/styling_perf.spec.ts @@ -51,34 +51,34 @@ describe('styling benchmark spec', () => { // Create benchmarks for each possible test scenario. SCENARIOS.forEach(({optionIndex, id}) => { describe(id, () => { - it('should run create benchmark', done => { - runStylingBenchmark(`styling.${id}.create`, { + it('should run create benchmark', async() => { + await runStylingBenchmark(`styling.${id}.create`, { work: () => create(), prepare: () => { selectScenario(optionIndex); destroy(); }, - }).then(done, done.fail); + }); }); - it('should run update benchmark', done => { - runStylingBenchmark(`styling.${id}.update`, { + it('should run update benchmark', async() => { + await runStylingBenchmark(`styling.${id}.update`, { work: () => update(), prepare: () => { selectScenario(optionIndex); create(); }, - }).then(done, done.fail); + }); }); - it('should run detect changes benchmark', done => { - runStylingBenchmark(`styling.${id}.noop_cd`, { + it('should run detect changes benchmark', async() => { + await runStylingBenchmark(`styling.${id}.noop_cd`, { work: () => detectChanges(), prepare: () => { selectScenario(optionIndex); create(); }, - }).then(done, done.fail); + }); }); }); }); diff --git a/modules/benchmarks/src/tree/tree.e2e-spec.ts b/modules/benchmarks/src/tree/tree.e2e-spec.ts index 0f9c2963cf..2dc8534e92 100644 --- a/modules/benchmarks/src/tree/tree.e2e-spec.ts +++ b/modules/benchmarks/src/tree/tree.e2e-spec.ts @@ -11,7 +11,7 @@ import {$} from 'protractor'; import {openTreeBenchmark} from './test_utils'; describe('tree benchmark', () => { - it('should work for createDestroy', () => { + it('should work for createDestroy', async() => { openTreeBenchmark(); $('#createDom').click(); expect($('#root').getText()).toContain('1'); @@ -19,7 +19,7 @@ describe('tree benchmark', () => { expect($('#root').getText() as any).toEqual(''); }); - it('should work for update', () => { + it('should work for update', async() => { openTreeBenchmark(); $('#createDom').click(); $('#createDom').click(); diff --git a/modules/benchmarks/src/tree/tree.perf-spec.ts b/modules/benchmarks/src/tree/tree.perf-spec.ts index 74d02e019f..4eaa3ebcdd 100644 --- a/modules/benchmarks/src/tree/tree.perf-spec.ts +++ b/modules/benchmarks/src/tree/tree.perf-spec.ts @@ -10,37 +10,37 @@ import {$} from 'protractor'; import {runTreeBenchmark} from './test_utils'; describe('tree benchmark perf', () => { - it('should work for createOnly', done => { + it('should work for createOnly', async() => { runTreeBenchmark({ // This cannot be called "createOnly" because the actual destroy benchmark // has the "createOnly" id already. See: https://github.com/angular/angular/pull/21503 id: 'createOnlyForReal', prepare: () => $('#destroyDom').click(), work: () => $('#createDom').click() - }).then(done, done.fail); + }); }); - it('should work for destroy', done => { + it('should work for destroy', async() => { runTreeBenchmark({ // This is actually a benchmark for destroying the dom, but it has been accidentally // named "createOnly". See https://github.com/angular/angular/pull/21503. id: 'createOnly', prepare: () => $('#createDom').click(), work: () => $('#destroyDom').click() - }).then(done, done.fail); + }); }); - it('should work for createDestroy', done => { + it('should work for createDestroy', async() => { runTreeBenchmark({ id: 'createDestroy', work: () => { $('#destroyDom').click(); $('#createDom').click(); } - }).then(done, done.fail); + }); }); - it('should work for update', done => { - runTreeBenchmark({id: 'update', work: () => $('#createDom').click()}).then(done, done.fail); + it('should work for update', async() => { + runTreeBenchmark({id: 'update', work: () => $('#createDom').click()}); }); }); diff --git a/modules/benchmarks/src/tree/tree_detect_changes.e2e-spec.ts b/modules/benchmarks/src/tree/tree_detect_changes.e2e-spec.ts index b85d8a71c5..cc3e7c0c8e 100644 --- a/modules/benchmarks/src/tree/tree_detect_changes.e2e-spec.ts +++ b/modules/benchmarks/src/tree/tree_detect_changes.e2e-spec.ts @@ -11,7 +11,7 @@ import {$} from 'protractor'; import {openTreeBenchmark} from './test_utils'; describe('tree benchmark detect changes', () => { - it('should work for detectChanges', () => { + it('should work for detectChanges', async() => { openTreeBenchmark(); $('#detectChanges').click(); expect($('#numberOfChecks').getText()).toContain('10');