Skip to content

Commit f4da874

Browse files
wagnermacielandrewseguin
authored andcommitted
test(mdc-checkbox): add performance tests for mdc-checkbox (#20129)
* fix(mdc-indigo-pink): add mat-core and mat-core-theme to indigo-pink * fixup! fix(mdc-indigo-pink): add mat-core and mat-core-theme to indigo-pink * test(mdc-checkbox): add performance tests for mdc-checkbox * fix(benchmarks): remove unnecessary providers * fixup! test(mdc-checkbox): add performance tests for mdc-checkbox * fixup! test(mdc-checkbox): add performance tests for mdc-checkbox * fixup! test(mdc-checkbox): add performance tests for mdc-checkbox (cherry picked from commit df516c5)
1 parent e84374d commit f4da874

File tree

12 files changed

+185
-10
lines changed

12 files changed

+185
-10
lines changed

test/benchmarks/material/card/app.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export class CardBenchmarkApp {
3030
hide() { this.isVisible = false; }
3131
}
3232

33-
3433
@NgModule({
3534
declarations: [CardBenchmarkApp],
3635
imports: [

test/benchmarks/material/checkbox/app.module.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ import {MatCheckboxModule} from '@angular/material/checkbox';
2929
styleUrls: ['//src/material/core/theming/prebuilt/indigo-pink.css'],
3030
})
3131
export class CheckboxBenchmarkApp {
32+
33+
// isChecked is used to maintain the buttons checked state even after it has been hidden. This is
34+
// used, for example, when we want to test the render speed of a checked vs unchecked checkbox.
35+
3236
isChecked = false;
3337
isVisible = false;
3438
isIndeterminate = false;
@@ -39,7 +43,6 @@ export class CheckboxBenchmarkApp {
3943
toggleIsChecked() { this.isChecked = !this.isChecked; }
4044
}
4145

42-
4346
@NgModule({
4447
declarations: [CheckboxBenchmarkApp],
4548
imports: [

test/benchmarks/material/chips/app.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export class ChipsBenchmarkApp {
4646
hideMultiple() { this.isMultipleVisible = false; }
4747
}
4848

49-
5049
@NgModule({
5150
declarations: [ChipsBenchmarkApp],
5251
imports: [

test/benchmarks/material/form-field/app.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export class FormFieldBenchmarkApp {
5959
}
6060
}
6161

62-
6362
@NgModule({
6463
declarations: [FormFieldBenchmarkApp],
6564
imports: [

test/benchmarks/material/radio/app.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export class RadioBenchmarkApp {
5353
hideTen() { this.isTenVisible = false; }
5454
}
5555

56-
5756
@NgModule({
5857
declarations: [RadioBenchmarkApp],
5958
imports: [

test/benchmarks/material/slide-toggle/app.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export class SlideToggleBenchmarkApp {
3131
hide() { this.isVisible = false; }
3232
}
3333

34-
3534
@NgModule({
3635
declarations: [SlideToggleBenchmarkApp],
3736
imports: [

test/benchmarks/material/table/app.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export class TableBenchmarkApp {
5454
showTenRowsTwentyCols() { this.isTenRowsTwentyColsVisible = true; }
5555
}
5656

57-
5857
@NgModule({
5958
declarations: [BasicTable, TableBenchmarkApp],
6059
imports: [

test/benchmarks/mdc/button/app.module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@ export class ButtonBenchmarkApp {
3030
hide() { this.isVisible = false; }
3131
}
3232

33-
3433
@NgModule({
3534
declarations: [ButtonBenchmarkApp],
3635
imports: [
3736
BrowserModule,
3837
MatButtonModule,
3938
],
40-
providers: [],
4139
bootstrap: [ButtonBenchmarkApp],
4240
})
4341
export class AppModule {}

test/benchmarks/mdc/card/app.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export class CardBenchmarkApp {
3030
hide() { this.isVisible = false; }
3131
}
3232

33-
3433
@NgModule({
3534
declarations: [CardBenchmarkApp],
3635
imports: [
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
load("@npm_angular_dev_infra_private//benchmark/component_benchmark:component_benchmark.bzl", "component_benchmark")
2+
3+
# TODO(wagnermaciel): Update this target to provide indigo-pink in a way that doesn't require having to import it with
4+
# stylesUrls inside the components once `component_benchmark` supports asset injection.
5+
6+
component_benchmark(
7+
name = "benchmark",
8+
driver = ":checkbox.perf-spec.ts",
9+
driver_deps = [
10+
"@npm//@angular/dev-infra-private",
11+
"@npm//protractor",
12+
"@npm//@types/jasmine",
13+
],
14+
ng_deps = [
15+
"@npm//@angular/core",
16+
"@npm//@angular/platform-browser",
17+
"//src/material-experimental/mdc-checkbox",
18+
],
19+
ng_srcs = [":app.module.ts"],
20+
prefix = "",
21+
styles = ["//src/material-experimental/mdc-theming:indigo_pink_prebuilt"],
22+
)

0 commit comments

Comments
 (0)