Skip to content

Commit

Permalink
Reverts "Wide gamut framework gradient test (flutter#153976)" (flutte…
Browse files Browse the repository at this point in the history
…r#157615)

Reverts: flutter#153976
Initiated by: jonahwilliams
Reason for reverting: failing on postsubmit
Original PR Author: gaaclarke

Reviewed By: {jonahwilliams}

This change reverts the following previous change:
issue: flutter#127855
depends on flutter/engine#54748 being rolled into the framework
  • Loading branch information
auto-submit[bot] authored Oct 25, 2024
1 parent 4f66f13 commit add7e81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,45 +175,5 @@ void main() {
await channel.invokeMethod('test') as List<Object?>;
expect(_findColor(result, _deepRed), isTrue);
});

testWidgets('draw wide gamut linear gradient works', (WidgetTester tester) async {
app.run(app.Setup.linearGradient);
await tester.pumpAndSettle(const Duration(seconds: 2));

const MethodChannel channel = MethodChannel('flutter/screenshot');
final List<Object?> result =
await channel.invokeMethod('test') as List<Object?>;
expect(_findColor(result, _deepRed), isTrue);
});

testWidgets('draw wide gamut radial gradient works', (WidgetTester tester) async {
app.run(app.Setup.radialGradient);
await tester.pumpAndSettle(const Duration(seconds: 2));

const MethodChannel channel = MethodChannel('flutter/screenshot');
final List<Object?> result =
await channel.invokeMethod('test') as List<Object?>;
expect(_findColor(result, _deepRed), isTrue);
});

testWidgets('draw wide gamut conical gradient works', (WidgetTester tester) async {
app.run(app.Setup.conicalGradient);
await tester.pumpAndSettle(const Duration(seconds: 2));

const MethodChannel channel = MethodChannel('flutter/screenshot');
final List<Object?> result =
await channel.invokeMethod('test') as List<Object?>;
expect(_findColor(result, _deepRed), isTrue);
});

testWidgets('draw wide gamut sweep gradient works', (WidgetTester tester) async {
app.run(app.Setup.sweepGradient);
await tester.pumpAndSettle(const Duration(seconds: 2));

const MethodChannel channel = MethodChannel('flutter/screenshot');
final List<Object?> result =
await channel.invokeMethod('test') as List<Object?>;
expect(_findColor(result, _deepRed), isTrue);
});
});
}
106 changes: 2 additions & 104 deletions dev/integration_tests/wide_gamut_test/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const String _displayP3Logo =
'gr3yrjmlwqXLjmWw1O2I5Wmp9Xxjyh+AVIZ6ADIAqcwClakzeMgApDILVKbO4CED'
'kMosUJk6g4dUBuRfvf1am9VRqzYAAAAASUVORK5CYII=';

void main() => run(Setup.sweepGradient);
void main() => run(Setup.container);

enum Setup {
none,
Expand All @@ -146,10 +146,6 @@ enum Setup {
blur,
drawnImage,
container,
linearGradient,
radialGradient,
conicalGradient,
sweepGradient,
}

void run(Setup setup) {
Expand Down Expand Up @@ -269,14 +265,7 @@ class _MyHomePageState extends State<MyHomePage> {
_loadImage().then((ui.Image? value) => setState(() { _image = value; }));
case Setup.drawnImage:
_drawImage().then((ui.Image? value) => setState(() { _image = value; }));
case Setup.image ||
Setup.blur ||
Setup.none ||
Setup.container ||
Setup.linearGradient ||
Setup.radialGradient ||
Setup.conicalGradient ||
Setup.sweepGradient:
case Setup.image || Setup.blur || Setup.none || Setup.container:
break;
}
super.initState();
Expand Down Expand Up @@ -319,97 +308,6 @@ class _MyHomePageState extends State<MyHomePage> {
green: 0,
blue: 0,
colorSpace: ui.ColorSpace.displayP3));
case Setup.linearGradient:
imageWidget = Container(
width: 100,
height: 100,
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: <Color>[
Color.from(
alpha: 1,
red: 1,
green: 0,
blue: 0,
colorSpace: ui.ColorSpace.displayP3),
Color.from(
alpha: 1,
red: 0,
green: 1,
blue: 0,
colorSpace: ui.ColorSpace.displayP3)],
),
),
);
case Setup.radialGradient:
imageWidget = Container(
width: 100,
height: 100,
decoration: const BoxDecoration(
gradient: RadialGradient(
colors: <Color>[
Color.from(
alpha: 1,
red: 1,
green: 0,
blue: 0,
colorSpace: ui.ColorSpace.displayP3),
Color.from(
alpha: 1,
red: 0,
green: 1,
blue: 0,
colorSpace: ui.ColorSpace.displayP3)],
),
),
);
case Setup.conicalGradient:
imageWidget = Container(
width: 100,
height: 100,
decoration: const BoxDecoration(
gradient: RadialGradient(
focal: Alignment(0.2, 0.2),
colors: <Color>[
Color.from(
alpha: 1,
red: 1,
green: 0,
blue: 0,
colorSpace: ui.ColorSpace.displayP3),
Color.from(
alpha: 1,
red: 0,
green: 1,
blue: 0,
colorSpace: ui.ColorSpace.displayP3)],
),
),
);
case Setup.sweepGradient:
imageWidget = Container(
width: 100,
height: 100,
decoration: const BoxDecoration(
gradient: SweepGradient(
colors: <Color>[
Color.from(
alpha: 1,
red: 1,
green: 0,
blue: 0,
colorSpace: ui.ColorSpace.displayP3),
Color.from(
alpha: 1,
red: 0,
green: 1,
blue: 0,
colorSpace: ui.ColorSpace.displayP3)],
),
),
);
}

return Scaffold(
Expand Down

0 comments on commit add7e81

Please sign in to comment.