From 55047eaa1045b72c30e12a52099696558b1862f6 Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Tue, 14 Jan 2020 14:43:14 +0100 Subject: [PATCH] refactor: rename styling benchmark scenario (#34775) PR Close #34775 --- modules/benchmarks/src/styling/ng2/index.html | 6 +++--- modules/benchmarks/src/styling/ng2/init.ts | 10 +++++----- modules/benchmarks/src/styling/styling_perf.spec.ts | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/benchmarks/src/styling/ng2/index.html b/modules/benchmarks/src/styling/ng2/index.html index 810286db3f..ad8723321f 100644 --- a/modules/benchmarks/src/styling/ng2/index.html +++ b/modules/benchmarks/src/styling/ng2/index.html @@ -23,9 +23,9 @@ - + - +

@@ -37,4 +37,4 @@ - + \ No newline at end of file diff --git a/modules/benchmarks/src/styling/ng2/init.ts b/modules/benchmarks/src/styling/ng2/init.ts index bec87b75bf..62a046fb13 100644 --- a/modules/benchmarks/src/styling/ng2/init.ts +++ b/modules/benchmarks/src/styling/ng2/init.ts @@ -36,7 +36,7 @@ export function init(moduleRef: NgModuleRef) { appRef.tick(); } - function detectChanges() { + function update() { component.exp = component.exp === 'bar' ? 'baz' : 'bar'; appRef.tick(); } @@ -54,12 +54,12 @@ export function init(moduleRef: NgModuleRef) { } bindAction('#create', () => create(select.selectedIndex)); - bindAction('#detectChanges', detectChanges); + bindAction('#update', update); bindAction('#destroy', destroy); - bindAction('#profile', profile(() => { + bindAction('#profile_update', profile(() => { for (let i = 0; i < 10; i++) { - detectChanges(); + update(); } - }, () => {}, 'detect changes')); + }, () => {}, 'update and detect changes')); bindAction('#modify', modifyExternally); } diff --git a/modules/benchmarks/src/styling/styling_perf.spec.ts b/modules/benchmarks/src/styling/styling_perf.spec.ts index 948e1de3b0..34bab527fc 100644 --- a/modules/benchmarks/src/styling/styling_perf.spec.ts +++ b/modules/benchmarks/src/styling/styling_perf.spec.ts @@ -22,13 +22,13 @@ const SCENARIOS = [ describe('styling benchmark spec', () => { afterEach(verifyNoBrowserErrors); - it('should render and interact to change detection', () => { + it('should render and interact to update and detect changes', () => { openBrowser({url: '/', ignoreBrowserSynchronization: true}); create(); const items = element.all(by.css('styling-bindings button')); expect(items.count()).toBe(2000); expect(items.first().getAttribute('title')).toBe('bar'); - detectChanges(); + update(); expect(items.first().getAttribute('title')).toBe('baz'); }); @@ -36,8 +36,8 @@ describe('styling benchmark spec', () => { SCENARIOS.forEach(({optionIndex, id}) => { describe(id, () => { it('should run detect_changes benchmark', done => { - runStylingBenchmark(`styling.${id}.detect_changes`, { - work: () => detectChanges(), + runStylingBenchmark(`styling.${id}.update`, { + work: () => update(), prepare: () => { // Switch to the current scenario by clicking the corresponding option. element.all(by.tagName('option')).get(optionIndex).click(); @@ -54,8 +54,8 @@ function create() { $('#create').click(); } -function detectChanges() { - $('#detectChanges').click(); +function update() { + $('#update').click(); } /**