Skip to content

Commit 3d896d8

Browse files
auto-submit[bot]auto-submit[bot]
andauthored
Reverts "Update image_filter_test and color_filter_test.dart for Material 3 (#158985)" (#159437)
<!-- start_original_pr_link --> Reverts: flutter/flutter#158985 <!-- end_original_pr_link --> <!-- start_initiating_author --> Initiated by: QuncCccccc <!-- end_initiating_author --> <!-- start_revert_reason --> Reason for reverting: to unblock tree <!-- end_revert_reason --> <!-- start_original_pr_author --> Original PR Author: TahaTesser <!-- end_original_pr_author --> <!-- start_reviewers --> Reviewed By: {QuncCccccc} <!-- end_reviewers --> <!-- start_revert_body --> This change reverts the following previous change: Updated unit tests for `ColorFiltered` and `ImageFiltered` to have M2 and M3 versions. More info in #139076 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat [Data Driven Fixes]: https://github.com/flutter/flutter/wiki/Data-driven-Fixes <!-- end_revert_body --> Co-authored-by: auto-submit[bot] <[email protected]>
1 parent 7b9f853 commit 3d896d8

File tree

2 files changed

+11
-125
lines changed

2 files changed

+11
-125
lines changed

packages/flutter/test/widgets/color_filter_test.dart

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -30,45 +30,8 @@ void main() {
3030
);
3131
});
3232

33-
testWidgets('Material2 - Color filter - sepia', (WidgetTester tester) async {
34-
const ColorFilter sepia = ColorFilter.matrix(<double>[
35-
0.39, 0.769, 0.189, 0, 0, //
36-
0.349, 0.686, 0.168, 0, 0, //
37-
0.272, 0.534, 0.131, 0, 0, //
38-
0, 0, 0, 1, 0, //
39-
]);
40-
await tester.pumpWidget(
41-
RepaintBoundary(
42-
child: ColorFiltered(
43-
colorFilter: sepia,
44-
child: MaterialApp(
45-
debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616
46-
title: 'Flutter Demo',
47-
theme: ThemeData(primarySwatch: Colors.blue, useMaterial3: false),
48-
home: Scaffold(
49-
appBar: AppBar(
50-
title: const Text('Sepia ColorFilter Test'),
51-
),
52-
body: const Center(
53-
child:Text('Hooray!'),
54-
),
55-
floatingActionButton: FloatingActionButton(
56-
onPressed: () { },
57-
tooltip: 'Increment',
58-
child: const Icon(Icons.add),
59-
),
60-
),
61-
),
62-
),
63-
),
64-
);
65-
await expectLater(
66-
find.byType(ColorFiltered),
67-
matchesGoldenFile('color_filter_sepia_m2.png'),
68-
);
69-
}, skip: impellerEnabled); // https://github.com/flutter/flutter/issues/143616
70-
7133
testWidgets('Color filter - sepia', (WidgetTester tester) async {
34+
7235
const ColorFilter sepia = ColorFilter.matrix(<double>[
7336
0.39, 0.769, 0.189, 0, 0, //
7437
0.349, 0.686, 0.168, 0, 0, //
@@ -82,7 +45,7 @@ void main() {
8245
child: MaterialApp(
8346
debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616
8447
title: 'Flutter Demo',
85-
theme: ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue)),
48+
theme: ThemeData(primarySwatch: Colors.blue, useMaterial3: false),
8649
home: Scaffold(
8750
appBar: AppBar(
8851
title: const Text('Sepia ColorFilter Test'),
@@ -102,7 +65,7 @@ void main() {
10265
);
10366
await expectLater(
10467
find.byType(ColorFiltered),
105-
matchesGoldenFile('color_filter_sepia_m3.png'),
68+
matchesGoldenFile('color_filter_sepia.png'),
10669
);
10770
}, skip: impellerEnabled); // https://github.com/flutter/flutter/issues/143616
10871

packages/flutter/test/widgets/image_filter_test.dart

Lines changed: 8 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -82,58 +82,20 @@ void main() {
8282
);
8383
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/101874
8484

85-
testWidgets('Material2 - Image filter - matrix', (WidgetTester tester) async {
86-
final ImageFilter matrix = ImageFilter.matrix(Float64List.fromList(<double>[
87-
0.5, 0.0, 0.0, 0.0,
88-
0.0, 0.5, 0.0, 0.0,
89-
0.0, 0.0, 1.0, 0.0,
90-
0.0, 0.0, 0.0, 1.0,
91-
]));
92-
await tester.pumpWidget(
93-
RepaintBoundary(
94-
child: ImageFiltered(
95-
imageFilter: matrix,
96-
child: MaterialApp(
97-
title: 'Flutter Demo',
98-
theme: ThemeData(useMaterial3: false, primarySwatch: Colors.blue),
99-
debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616
100-
home: Scaffold(
101-
appBar: AppBar(
102-
title: const Text('Matrix ImageFilter Test'),
103-
),
104-
body: const Center(
105-
child:Text('Hooray!'),
106-
),
107-
floatingActionButton: FloatingActionButton(
108-
onPressed: () { },
109-
tooltip: 'Increment',
110-
child: const Icon(Icons.add),
111-
),
112-
),
113-
),
114-
),
115-
),
116-
);
117-
await expectLater(
118-
find.byType(ImageFiltered),
119-
matchesGoldenFile('image_filter_matrix_m2.png'),
120-
);
121-
});
122-
12385
testWidgets('Image filter - matrix', (WidgetTester tester) async {
12486
final ImageFilter matrix = ImageFilter.matrix(Float64List.fromList(<double>[
125-
0.5, 0.0, 0.0, 0.0,
126-
0.0, 0.5, 0.0, 0.0,
127-
0.0, 0.0, 1.0, 0.0,
128-
0.0, 0.0, 0.0, 1.0,
87+
0.5, 0.0, 0.0, 0.0, //
88+
0.0, 0.5, 0.0, 0.0, //
89+
0.0, 0.0, 1.0, 0.0, //
90+
0.0, 0.0, 0.0, 1.0, //
12991
]));
13092
await tester.pumpWidget(
13193
RepaintBoundary(
13294
child: ImageFiltered(
13395
imageFilter: matrix,
13496
child: MaterialApp(
13597
title: 'Flutter Demo',
136-
theme: ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue)),
98+
theme: ThemeData(useMaterial3: false, primarySwatch: Colors.blue),
13799
debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616
138100
home: Scaffold(
139101
appBar: AppBar(
@@ -154,46 +116,7 @@ void main() {
154116
);
155117
await expectLater(
156118
find.byType(ImageFiltered),
157-
matchesGoldenFile('image_filter_matrix_m3.png'),
158-
);
159-
});
160-
161-
testWidgets('Material2 - Image filter - matrix with offset', (WidgetTester tester) async {
162-
final Matrix4 matrix = Matrix4.rotationZ(pi / 18);
163-
final ImageFilter matrixFilter = ImageFilter.matrix(matrix.storage);
164-
final Key key = GlobalKey();
165-
await tester.pumpWidget(
166-
RepaintBoundary(
167-
key: key,
168-
child: Transform.translate(
169-
offset: const Offset(50, 50),
170-
child: ImageFiltered(
171-
imageFilter: matrixFilter,
172-
child: MaterialApp(
173-
title: 'Flutter Demo',
174-
theme: ThemeData(useMaterial3: false, primarySwatch: Colors.blue),
175-
debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616
176-
home: Scaffold(
177-
appBar: AppBar(
178-
title: const Text('Matrix ImageFilter Test'),
179-
),
180-
body: const Center(
181-
child:Text('Hooray!'),
182-
),
183-
floatingActionButton: FloatingActionButton(
184-
onPressed: () { },
185-
tooltip: 'Increment',
186-
child: const Icon(Icons.add),
187-
),
188-
),
189-
),
190-
),
191-
),
192-
),
193-
);
194-
await expectLater(
195-
find.byKey(key),
196-
matchesGoldenFile('image_filter_matrix_offset_m2.png'),
119+
matchesGoldenFile('image_filter_matrix.png'),
197120
);
198121
});
199122

@@ -210,7 +133,7 @@ void main() {
210133
imageFilter: matrixFilter,
211134
child: MaterialApp(
212135
title: 'Flutter Demo',
213-
theme: ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue)),
136+
theme: ThemeData(useMaterial3: false, primarySwatch: Colors.blue),
214137
debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616
215138
home: Scaffold(
216139
appBar: AppBar(
@@ -232,7 +155,7 @@ void main() {
232155
);
233156
await expectLater(
234157
find.byKey(key),
235-
matchesGoldenFile('image_filter_matrix_offset_m3.png'),
158+
matchesGoldenFile('image_filter_matrix_offset.png'),
236159
);
237160
});
238161

0 commit comments

Comments
 (0)