Skip to content

Commit 6a99a8d

Browse files
authored
build: clean up some internal deprecated API usages (#21342)
* Replaces usages of the deprecated `browser.rootEl` with `browser.angularAppRoot`. * Fixes a couple of places that were using `async` instead of `waitForAsync`.
1 parent 8cd497b commit 6a99a8d

File tree

22 files changed

+21
-74
lines changed

22 files changed

+21
-74
lines changed

src/cdk-experimental/menu/menu.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
ComponentFixture,
33
TestBed,
4-
async,
54
fakeAsync,
65
tick,
76
flush,
@@ -260,7 +259,7 @@ describe('Menu', () => {
260259

261260
let nativeMenus: HTMLElement[];
262261

263-
beforeEach(async(() => {
262+
beforeEach(waitForAsync(() => {
264263
TestBed.configureTestingModule({
265264
imports: [CdkMenuModule],
266265
declarations: [WithComplexNestedMenus],
@@ -456,7 +455,7 @@ describe('Menu', () => {
456455

457456
let nativeMenus: HTMLElement[];
458457

459-
beforeEach(async(() => {
458+
beforeEach(waitForAsync(() => {
460459
TestBed.configureTestingModule({
461460
imports: [CdkMenuModule],
462461
declarations: [WithComplexNestedMenusOnBottom],

test/benchmarks/cdk/testing/component-harness/protractor-benchmark-utilities.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ async function benchmarkWithBenchpress(id: string, callback: () => Promise<unkno
3131
id,
3232
url: '',
3333
ignoreBrowserSynchronization: true,
34-
params: [],
3534
work: async () => await callback(),
3635
});
3736
}

test/benchmarks/material/button/button.perf-spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ import {runBenchmark} from '@angular/dev-infra-private/benchmark/driver-utilitie
1111

1212
describe('button performance benchmarks', () => {
1313
beforeAll(() => {
14-
browser.rootEl = '#root';
14+
browser.angularAppRoot('#root');
1515
});
1616

1717
it('renders a basic raised button', async() => {
1818
await runBenchmark({
1919
id: 'button-render',
2020
url: '',
2121
ignoreBrowserSynchronization: true,
22-
params: [],
2322
prepare: async () => await $('#hide').click(),
2423
work: async () => await $('#show').click(),
2524
});
@@ -30,7 +29,6 @@ describe('button performance benchmarks', () => {
3029
id: 'button-click',
3130
url: '',
3231
ignoreBrowserSynchronization: true,
33-
params: [],
3432
setup: async () => await $('#show').click(),
3533
work: async () => await $('.mat-raised-button').click(),
3634
});

test/benchmarks/material/card/card.perf-spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ import {runBenchmark} from '@angular/dev-infra-private/benchmark/driver-utilitie
1111

1212
describe('card performance benchmarks', () => {
1313
beforeAll(() => {
14-
browser.rootEl = '#root';
14+
browser.angularAppRoot('#root');
1515
});
1616

1717
it('renders a simple card', async() => {
1818
await runBenchmark({
1919
id: 'card-render',
2020
url: '',
2121
ignoreBrowserSynchronization: true,
22-
params: [],
2322
prepare: async () => await $('#hide').click(),
2423
work: async () => await $('#show').click()
2524
});

test/benchmarks/material/checkbox/checkbox.perf-spec.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ import {runBenchmark} from '@angular/dev-infra-private/benchmark/driver-utilitie
1111

1212
describe('checkbox performance benchmarks', () => {
1313
beforeAll(() => {
14-
browser.rootEl = '#root';
14+
browser.angularAppRoot('#root');
1515
});
1616

1717
it('renders a checked checkbox', async() => {
1818
await runBenchmark({
1919
id: 'checkbox-render-checked',
2020
url: '',
2121
ignoreBrowserSynchronization: true,
22-
params: [],
2322
setup: async () => {
2423
await $('#show').click();
2524
await $('mat-checkbox').click();
@@ -38,7 +37,6 @@ describe('checkbox performance benchmarks', () => {
3837
id: 'checkbox-render-unchecked',
3938
url: '',
4039
ignoreBrowserSynchronization: true,
41-
params: [],
4240
setup: async() => await $('#show').click(),
4341
prepare: async () => {
4442
expect(await $('mat-checkbox input').isSelected())
@@ -54,7 +52,6 @@ describe('checkbox performance benchmarks', () => {
5452
id: 'checkbox-render-indeterminate',
5553
url: '',
5654
ignoreBrowserSynchronization: true,
57-
params: [],
5855
setup: async() => {
5956
await $('#show').click();
6057
await $('#indeterminate').click();
@@ -73,7 +70,6 @@ describe('checkbox performance benchmarks', () => {
7370
id: 'checkbox-click-unchecked-to-checked',
7471
url: '',
7572
ignoreBrowserSynchronization: true,
76-
params: [],
7773
setup: async () => {
7874
await $('#show').click();
7975
await $('mat-checkbox').click();
@@ -92,7 +88,6 @@ describe('checkbox performance benchmarks', () => {
9288
id: 'checkbox-click-checked-to-unchecked',
9389
url: '',
9490
ignoreBrowserSynchronization: true,
95-
params: [],
9691
setup: async () => await $('#show').click(),
9792
prepare: async () => {
9893
await $('mat-checkbox').click();

test/benchmarks/material/chips/chips.perf-spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ import {runBenchmark} from '@angular/dev-infra-private/benchmark/driver-utilitie
1111

1212
describe('chip performance benchmarks', () => {
1313
beforeAll(() => {
14-
browser.rootEl = '#root';
14+
browser.angularAppRoot('#root');
1515
});
1616

1717
it('renders a single chip', async() => {
1818
await runBenchmark({
1919
id: 'single-chip-render',
2020
url: '',
2121
ignoreBrowserSynchronization: true,
22-
params: [],
2322
prepare: async () => await $('#hide-single').click(),
2423
work: async () => await $('#show-single').click(),
2524
});
@@ -30,7 +29,6 @@ describe('chip performance benchmarks', () => {
3029
id: 'multiple-chip-render',
3130
url: '',
3231
ignoreBrowserSynchronization: true,
33-
params: [],
3432
prepare: async () => await $('#hide-multiple').click(),
3533
work: async () => await $('#show-multiple').click(),
3634
});
@@ -41,7 +39,6 @@ describe('chip performance benchmarks', () => {
4139
id: 'chip-click',
4240
url: '',
4341
ignoreBrowserSynchronization: true,
44-
params: [],
4542
setup: async() => await $('#show-single').click(),
4643
work: async () => await $('.mat-chip').click(),
4744
});

test/benchmarks/material/form-field/form-field.perf-spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ function runFormFieldRenderBenchmark(testId: string, showBtnId: string) {
1414
id: testId,
1515
url: '',
1616
ignoreBrowserSynchronization: true,
17-
params: [],
1817
prepare: async () => await $('#hide').click(),
1918
work: async () => await $(showBtnId).click()
2019
});
2120
}
2221

2322
describe('form field performance benchmarks', () => {
2423
beforeAll(() => {
25-
browser.rootEl = '#root';
24+
browser.angularAppRoot('#root');
2625
});
2726

2827
it('renders an input in a form field', async() => {

test/benchmarks/material/menu/menu.perf-spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ describe('menu performance benchmarks', () => {
2626
id: 'open-and-close-basic-menu',
2727
url: '',
2828
ignoreBrowserSynchronization: true,
29-
params: [],
3029
setup: async () => {
3130
trigger = element(by.buttonText('Basic Menu'));
3231
},
@@ -43,7 +42,6 @@ describe('menu performance benchmarks', () => {
4342
id: 'shallow-open-and-close-nested-menu',
4443
url: '',
4544
ignoreBrowserSynchronization: true,
46-
params: [],
4745
setup: async () => {
4846
trigger = element(by.buttonText('Nested Menu'));
4947
},
@@ -60,7 +58,6 @@ describe('menu performance benchmarks', () => {
6058
id: 'deep-open-and-close-nested-menus',
6159
url: '',
6260
ignoreBrowserSynchronization: true,
63-
params: [],
6461
setup: () => {
6562
trigger = element(by.buttonText('Nested Menu'));
6663
},

test/benchmarks/material/radio/radio.perf-spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ import {runBenchmark} from '@angular/dev-infra-private/benchmark/driver-utilitie
1111

1212
describe('radio button performance benchmarks', () => {
1313
beforeAll(() => {
14-
browser.rootEl = '#root';
14+
browser.angularAppRoot('#root');
1515
});
1616

1717
it('renders two radio buttons', async() => {
1818
await runBenchmark({
1919
id: 'render-two-radio-buttons',
2020
url: '',
2121
ignoreBrowserSynchronization: true,
22-
params: [],
2322
prepare: async () => await $('#hide-two').click(),
2423
work: async () => await $('#show-two').click(),
2524
});
@@ -30,7 +29,6 @@ describe('radio button performance benchmarks', () => {
3029
id: 'render-ten-radio-buttons',
3130
url: '',
3231
ignoreBrowserSynchronization: true,
33-
params: [],
3432
prepare: async () => await $('#hide-ten').click(),
3533
work: async () => await $('#show-ten').click(),
3634
});
@@ -41,7 +39,6 @@ describe('radio button performance benchmarks', () => {
4139
id: 'click-radio-button',
4240
url: '',
4341
ignoreBrowserSynchronization: true,
44-
params: [],
4542
setup: async() => await $('#show-two').click(),
4643
prepare: async() => await $('#btn-1').click(),
4744
work: async () => await $('#btn-2').click(),

test/benchmarks/material/slide-toggle/slide-toggle.perf-spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ import {runBenchmark} from '@angular/dev-infra-private/benchmark/driver-utilitie
1111

1212
describe('slide toggle performance benchmarks', () => {
1313
beforeAll(() => {
14-
browser.rootEl = '#root';
14+
browser.angularAppRoot('#root');
1515
});
1616

1717
it('renders a slide toggle', async() => {
1818
await runBenchmark({
1919
id: 'slide-toggle-render',
2020
url: '',
2121
ignoreBrowserSynchronization: true,
22-
params: [],
2322
prepare: async () => await $('#hide').click(),
2423
work: async () => await $('#show').click(),
2524
});
@@ -30,7 +29,6 @@ describe('slide toggle performance benchmarks', () => {
3029
id: 'slide-toggle-click',
3130
url: '',
3231
ignoreBrowserSynchronization: true,
33-
params: [],
3432
setup: async () => await $('#show').click(),
3533
work: async () => await $('.mat-slide-toggle-bar').click(),
3634
});

test/benchmarks/material/table/table.perf-spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ function runTableRenderBenchmark(testId: string, buttonId: string) {
1414
id: testId,
1515
url: '',
1616
ignoreBrowserSynchronization: true,
17-
params: [],
18-
prepare: async () => await $('#hide').click(),
17+
prepare: async () => await $('#hide').click(),
1918
work: async () => await $(buttonId).click(),
2019
});
2120
}
2221

2322
describe('table performance benchmarks', () => {
2423
beforeAll(() => {
25-
browser.rootEl = '#root';
24+
browser.angularAppRoot('#root');
2625
});
2726

2827
it('renders 10 rows with 5 cols', async() => {

test/benchmarks/material/tabs/tabs.perf-spec.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ import {runBenchmark} from '@angular/dev-infra-private/benchmark/driver-utilitie
1111

1212
describe('tabs performance benchmarks', () => {
1313
beforeAll(() => {
14-
browser.rootEl = '#root';
14+
browser.angularAppRoot('#root');
1515
});
1616

1717
it('renders three tabs', async() => {
1818
await runBenchmark({
1919
id: 'three-tab-render',
2020
url: '',
2121
ignoreBrowserSynchronization: true,
22-
params: [],
2322
prepare: async() => await $('#hide').click(),
2423
work: async() => await $('#show-three-tabs').click(),
2524
});
@@ -30,7 +29,6 @@ describe('tabs performance benchmarks', () => {
3029
id: 'ten-tab-render',
3130
url: '',
3231
ignoreBrowserSynchronization: true,
33-
params: [],
3432
prepare: async() => await $('#hide').click(),
3533
work: async() => await $('#show-ten-tabs').click(),
3634
});
@@ -41,7 +39,6 @@ describe('tabs performance benchmarks', () => {
4139
id: 'twenty-tab-render',
4240
url: '',
4341
ignoreBrowserSynchronization: true,
44-
params: [],
4542
prepare: async() => await $('#hide').click(),
4643
work: async() => await $('#show-twenty-tabs').click(),
4744
});
@@ -52,7 +49,6 @@ describe('tabs performance benchmarks', () => {
5249
id: 'tab-switching',
5350
url: '',
5451
ignoreBrowserSynchronization: true,
55-
params: [],
5652
setup: async() => await $('#show-three-tabs').click(),
5753
prepare: async() => await $('#mat-tab-label-0-0').click(),
5854
work: async() => await $('#mat-tab-label-0-1').click(),
@@ -67,7 +63,6 @@ describe('tabs performance benchmarks', () => {
6763
id: 'tab-pagination',
6864
url: '',
6965
ignoreBrowserSynchronization: true,
70-
params: [],
7166
prepare: async() => {
7267
await $('#hide').click();
7368
await $('#show-twenty-tabs').click();

test/benchmarks/mdc/button/button.perf-spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ import {runBenchmark} from '@angular/dev-infra-private/benchmark/driver-utilitie
1111

1212
describe('button performance benchmarks', () => {
1313
beforeAll(() => {
14-
browser.rootEl = '#root';
14+
browser.angularAppRoot('#root');
1515
});
1616

1717
it('renders a basic raised button', async() => {
1818
await runBenchmark({
1919
id: 'button-render',
2020
url: '',
2121
ignoreBrowserSynchronization: true,
22-
params: [],
2322
prepare: async () => await $('#hide').click(),
2423
work: async () => await $('#show').click(),
2524
});
@@ -30,7 +29,6 @@ describe('button performance benchmarks', () => {
3029
id: 'button-click',
3130
url: '',
3231
ignoreBrowserSynchronization: true,
33-
params: [],
3432
setup: async () => await $('#show').click(),
3533
work: async () => await $('.mat-mdc-raised-button').click(),
3634
});

test/benchmarks/mdc/card/card.perf-spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ import {runBenchmark} from '@angular/dev-infra-private/benchmark/driver-utilitie
1111

1212
describe('card performance benchmarks', () => {
1313
beforeAll(() => {
14-
browser.rootEl = '#root';
14+
browser.angularAppRoot('#root');
1515
});
1616

1717
it('renders a simple card', async() => {
1818
await runBenchmark({
1919
id: 'card-render',
2020
url: '',
2121
ignoreBrowserSynchronization: true,
22-
params: [],
2322
prepare: async () => await $('#hide').click(),
2423
work: async () => await $('#show').click()
2524
});

0 commit comments

Comments
 (0)