From 3d896d8743696be3ec262c36381f386a36fea57c Mon Sep 17 00:00:00 2001 From: "auto-submit[bot]" <98614782+auto-submit[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 12:47:13 -0800 Subject: [PATCH] Reverts "Update `image_filter_test` and `color_filter_test.dart` for Material 3 (#158985)" (#159437) Reverts: flutter/flutter#158985 Initiated by: QuncCccccc Reason for reverting: to unblock tree Original PR Author: TahaTesser Reviewed By: {QuncCccccc} 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]. [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 Co-authored-by: auto-submit[bot] --- .../test/widgets/color_filter_test.dart | 43 +-------- .../test/widgets/image_filter_test.dart | 93 ++----------------- 2 files changed, 11 insertions(+), 125 deletions(-) diff --git a/packages/flutter/test/widgets/color_filter_test.dart b/packages/flutter/test/widgets/color_filter_test.dart index 0119afb7c9..6ddb5892f9 100644 --- a/packages/flutter/test/widgets/color_filter_test.dart +++ b/packages/flutter/test/widgets/color_filter_test.dart @@ -30,7 +30,8 @@ void main() { ); }); - testWidgets('Material2 - Color filter - sepia', (WidgetTester tester) async { + testWidgets('Color filter - sepia', (WidgetTester tester) async { + const ColorFilter sepia = ColorFilter.matrix([ 0.39, 0.769, 0.189, 0, 0, // 0.349, 0.686, 0.168, 0, 0, // @@ -64,45 +65,7 @@ void main() { ); await expectLater( find.byType(ColorFiltered), - matchesGoldenFile('color_filter_sepia_m2.png'), - ); - }, skip: impellerEnabled); // https://github.com/flutter/flutter/issues/143616 - - testWidgets('Color filter - sepia', (WidgetTester tester) async { - const ColorFilter sepia = ColorFilter.matrix([ - 0.39, 0.769, 0.189, 0, 0, // - 0.349, 0.686, 0.168, 0, 0, // - 0.272, 0.534, 0.131, 0, 0, // - 0, 0, 0, 1, 0, // - ]); - await tester.pumpWidget( - RepaintBoundary( - child: ColorFiltered( - colorFilter: sepia, - child: MaterialApp( - debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616 - title: 'Flutter Demo', - theme: ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue)), - home: Scaffold( - appBar: AppBar( - title: const Text('Sepia ColorFilter Test'), - ), - body: const Center( - child:Text('Hooray!'), - ), - floatingActionButton: FloatingActionButton( - onPressed: () { }, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), - ), - ), - ), - ), - ); - await expectLater( - find.byType(ColorFiltered), - matchesGoldenFile('color_filter_sepia_m3.png'), + matchesGoldenFile('color_filter_sepia.png'), ); }, skip: impellerEnabled); // https://github.com/flutter/flutter/issues/143616 diff --git a/packages/flutter/test/widgets/image_filter_test.dart b/packages/flutter/test/widgets/image_filter_test.dart index b2d37e85ca..c92d04ca7b 100644 --- a/packages/flutter/test/widgets/image_filter_test.dart +++ b/packages/flutter/test/widgets/image_filter_test.dart @@ -82,12 +82,12 @@ void main() { ); }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/101874 - testWidgets('Material2 - Image filter - matrix', (WidgetTester tester) async { + testWidgets('Image filter - matrix', (WidgetTester tester) async { final ImageFilter matrix = ImageFilter.matrix(Float64List.fromList([ - 0.5, 0.0, 0.0, 0.0, - 0.0, 0.5, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0, + 0.5, 0.0, 0.0, 0.0, // + 0.0, 0.5, 0.0, 0.0, // + 0.0, 0.0, 1.0, 0.0, // + 0.0, 0.0, 0.0, 1.0, // ])); await tester.pumpWidget( RepaintBoundary( @@ -116,49 +116,11 @@ void main() { ); await expectLater( find.byType(ImageFiltered), - matchesGoldenFile('image_filter_matrix_m2.png'), + matchesGoldenFile('image_filter_matrix.png'), ); }); - testWidgets('Image filter - matrix', (WidgetTester tester) async { - final ImageFilter matrix = ImageFilter.matrix(Float64List.fromList([ - 0.5, 0.0, 0.0, 0.0, - 0.0, 0.5, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0, - ])); - await tester.pumpWidget( - RepaintBoundary( - child: ImageFiltered( - imageFilter: matrix, - child: MaterialApp( - title: 'Flutter Demo', - theme: ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue)), - debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616 - home: Scaffold( - appBar: AppBar( - title: const Text('Matrix ImageFilter Test'), - ), - body: const Center( - child:Text('Hooray!'), - ), - floatingActionButton: FloatingActionButton( - onPressed: () { }, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), - ), - ), - ), - ), - ); - await expectLater( - find.byType(ImageFiltered), - matchesGoldenFile('image_filter_matrix_m3.png'), - ); - }); - - testWidgets('Material2 - Image filter - matrix with offset', (WidgetTester tester) async { + testWidgets('Image filter - matrix with offset', (WidgetTester tester) async { final Matrix4 matrix = Matrix4.rotationZ(pi / 18); final ImageFilter matrixFilter = ImageFilter.matrix(matrix.storage); final Key key = GlobalKey(); @@ -193,46 +155,7 @@ void main() { ); await expectLater( find.byKey(key), - matchesGoldenFile('image_filter_matrix_offset_m2.png'), - ); - }); - - testWidgets('Image filter - matrix with offset', (WidgetTester tester) async { - final Matrix4 matrix = Matrix4.rotationZ(pi / 18); - final ImageFilter matrixFilter = ImageFilter.matrix(matrix.storage); - final Key key = GlobalKey(); - await tester.pumpWidget( - RepaintBoundary( - key: key, - child: Transform.translate( - offset: const Offset(50, 50), - child: ImageFiltered( - imageFilter: matrixFilter, - child: MaterialApp( - title: 'Flutter Demo', - theme: ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue)), - debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616 - home: Scaffold( - appBar: AppBar( - title: const Text('Matrix ImageFilter Test'), - ), - body: const Center( - child:Text('Hooray!'), - ), - floatingActionButton: FloatingActionButton( - onPressed: () { }, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), - ), - ), - ), - ), - ), - ); - await expectLater( - find.byKey(key), - matchesGoldenFile('image_filter_matrix_offset_m3.png'), + matchesGoldenFile('image_filter_matrix_offset.png'), ); });