Unverified Commit e8bfa81b authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Roll engine to 5983e34a3c0e1217da7e8bbe9f2fe685048fe259 (#26596)

parent fc779c69
fea645b801343c8a103bc0ff66539f40ef57321a 5983e34a3c0e1217da7e8bbe9f2fe685048fe259
...@@ -420,12 +420,12 @@ class _CupertinoNavigationBarState extends State<CupertinoNavigationBar> { ...@@ -420,12 +420,12 @@ class _CupertinoNavigationBarState extends State<CupertinoNavigationBar> {
if (!widget.transitionBetweenRoutes || !_isTransitionable(context)) { if (!widget.transitionBetweenRoutes || !_isTransitionable(context)) {
// Lint ignore to maintain backward compatibility. // Lint ignore to maintain backward compatibility.
return _wrapActiveColor(widget.actionsForegroundColor, context, navBar); // ignore: deprecated_member_use return _wrapActiveColor(widget.actionsForegroundColor, context, navBar); // ignore: deprecated_member_use_from_same_package
} }
return _wrapActiveColor( return _wrapActiveColor(
// Lint ignore to maintain backward compatibility. // Lint ignore to maintain backward compatibility.
widget.actionsForegroundColor, // ignore: deprecated_member_use widget.actionsForegroundColor, // ignore: deprecated_member_use_from_same_package
context, context,
Builder( Builder(
// Get the context that might have a possibly changed CupertinoTheme. // Get the context that might have a possibly changed CupertinoTheme.
...@@ -631,7 +631,7 @@ class _CupertinoSliverNavigationBarState extends State<CupertinoSliverNavigation ...@@ -631,7 +631,7 @@ class _CupertinoSliverNavigationBarState extends State<CupertinoSliverNavigation
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// Lint ignore to maintain backward compatibility. // Lint ignore to maintain backward compatibility.
final Color actionsForegroundColor = widget.actionsForegroundColor ?? CupertinoTheme.of(context).primaryColor; // ignore: deprecated_member_use final Color actionsForegroundColor = widget.actionsForegroundColor ?? CupertinoTheme.of(context).primaryColor; // ignore: deprecated_member_use_from_same_package
final _NavigationBarStaticComponents components = _NavigationBarStaticComponents( final _NavigationBarStaticComponents components = _NavigationBarStaticComponents(
keys: keys, keys: keys,
...@@ -649,7 +649,7 @@ class _CupertinoSliverNavigationBarState extends State<CupertinoSliverNavigation ...@@ -649,7 +649,7 @@ class _CupertinoSliverNavigationBarState extends State<CupertinoSliverNavigation
return _wrapActiveColor( return _wrapActiveColor(
// Lint ignore to maintain backward compatibility. // Lint ignore to maintain backward compatibility.
widget.actionsForegroundColor, // ignore: deprecated_member_use widget.actionsForegroundColor, // ignore: deprecated_member_use_from_same_package
context, context,
SliverPersistentHeader( SliverPersistentHeader(
pinned: true, // iOS navigation bars are always pinned. pinned: true, // iOS navigation bars are always pinned.
......
...@@ -1476,7 +1476,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin { ...@@ -1476,7 +1476,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin {
// Backwards compatibility for deprecated resizeToAvoidBottomPadding property // Backwards compatibility for deprecated resizeToAvoidBottomPadding property
bool get _resizeToAvoidBottomInset { bool get _resizeToAvoidBottomInset {
// ignore: deprecated_member_use // ignore: deprecated_member_use_from_same_package
return widget.resizeToAvoidBottomInset ?? widget.resizeToAvoidBottomPadding ?? true; return widget.resizeToAvoidBottomInset ?? widget.resizeToAvoidBottomPadding ?? true;
} }
......
...@@ -84,10 +84,10 @@ mixin PaintingBinding on BindingBase, ServicesBinding { ...@@ -84,10 +84,10 @@ mixin PaintingBinding on BindingBase, ServicesBinding {
_kDecodedCacheRatioCap = value; _kDecodedCacheRatioCap = value;
} }
// ignore: deprecated_member_use // ignore: deprecated_member_use_from_same_package
/// Calls through to [dart:ui] with [decodedCacheRatioCap] from [ImageCache]. /// Calls through to [dart:ui] with [decodedCacheRatioCap] from [ImageCache].
Future<ui.Codec> instantiateImageCodec(Uint8List list) { Future<ui.Codec> instantiateImageCodec(Uint8List list) {
return ui.instantiateImageCodec(list, decodedCacheRatioCap: decodedCacheRatioCap); // ignore: deprecated_member_use return ui.instantiateImageCodec(list, decodedCacheRatioCap: decodedCacheRatioCap); // ignore: deprecated_member_use_from_same_package
} }
@override @override
......
...@@ -16,7 +16,7 @@ class PaintingBindingSpy extends BindingBase with ServicesBinding, PaintingBindi ...@@ -16,7 +16,7 @@ class PaintingBindingSpy extends BindingBase with ServicesBinding, PaintingBindi
@override @override
Future<ui.Codec> instantiateImageCodec(Uint8List list) { Future<ui.Codec> instantiateImageCodec(Uint8List list) {
counter++; counter++;
return ui.instantiateImageCodec(list, decodedCacheRatioCap: decodedCacheRatioCap); // ignore: deprecated_member_use return ui.instantiateImageCodec(list, decodedCacheRatioCap: decodedCacheRatioCap); // ignore: deprecated_member_use_from_same_package
} }
@override @override
...@@ -32,11 +32,11 @@ void main() { ...@@ -32,11 +32,11 @@ void main() {
test('decodedCacheRatio', () async { test('decodedCacheRatio', () async {
// final PaintingBinding binding = PaintingBinding.instance; // final PaintingBinding binding = PaintingBinding.instance;
// Has default value. // Has default value.
expect(binding.decodedCacheRatioCap, isNot(null)); // ignore: deprecated_member_use expect(binding.decodedCacheRatioCap, isNot(null)); // ignore: deprecated_member_use_from_same_package
// Can be set. // Can be set.
binding.decodedCacheRatioCap = 1.0; // ignore: deprecated_member_use binding.decodedCacheRatioCap = 1.0; // ignore: deprecated_member_use_from_same_package
expect(binding.decodedCacheRatioCap, 1.0); // ignore: deprecated_member_use expect(binding.decodedCacheRatioCap, 1.0); // ignore: deprecated_member_use_from_same_package
}); });
test('instantiateImageCodec used for loading images', () async { test('instantiateImageCodec used for loading images', () async {
......
...@@ -6,7 +6,7 @@ import 'dart:ui' as ui; ...@@ -6,7 +6,7 @@ import 'dart:ui' as ui;
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
ui.Image createTestImage(int width, int height, ui.Color color) { Future<ui.Image> createTestImage(int width, int height, ui.Color color) {
final ui.Paint paint = ui.Paint() final ui.Paint paint = ui.Paint()
..style = ui.PaintingStyle.stroke ..style = ui.PaintingStyle.stroke
..strokeWidth = 1.0 ..strokeWidth = 1.0
...@@ -26,41 +26,46 @@ void main() { ...@@ -26,41 +26,46 @@ void main() {
group('succeeds', () { group('succeeds', () {
testWidgets('when images have the same content', (WidgetTester tester) async { testWidgets('when images have the same content', (WidgetTester tester) async {
await expectLater( await expectLater(
createTestImage(100, 100, red), await createTestImage(100, 100, red),
matchesReferenceImage(createTestImage(100, 100, red)), matchesReferenceImage(await createTestImage(100, 100, red)),
); );
await expectLater( await expectLater(
createTestImage(100, 100, green), await createTestImage(100, 100, green),
matchesReferenceImage(createTestImage(100, 100, green)), matchesReferenceImage(await createTestImage(100, 100, green)),
); );
await expectLater( await expectLater(
createTestImage(100, 100, transparentRed), await createTestImage(100, 100, transparentRed),
matchesReferenceImage(createTestImage(100, 100, transparentRed)), matchesReferenceImage(await createTestImage(100, 100, transparentRed)),
); );
}); });
testWidgets('when images are identical', (WidgetTester tester) async { testWidgets('when images are identical', (WidgetTester tester) async {
final ui.Image image = createTestImage(100, 100, red); final ui.Image image = await createTestImage(100, 100, red);
await expectLater(image, matchesReferenceImage(image)); await expectLater(image, matchesReferenceImage(image));
}); });
}); });
group('fails', () { group('fails', () {
testWidgets('when image sizes do not match', (WidgetTester tester) async { testWidgets('when image sizes do not match', (WidgetTester tester) async {
final ui.Image red50 = await createTestImage(50, 50, red);
final ui.Image red100 = await createTestImage(100, 100, red);
expect( expect(
await matchesReferenceImage(createTestImage(50, 50, red)).matchAsync(createTestImage(100, 100, red)), await matchesReferenceImage(red50).matchAsync(red100),
equals('does not match as width or height do not match. [100×100] != [50×50]'), equals('does not match as width or height do not match. [100×100] != [50×50]'),
); );
}); });
testWidgets('when image pixels do not match', (WidgetTester tester) async { testWidgets('when image pixels do not match', (WidgetTester tester) async {
final ui.Image red100 = await createTestImage(100, 100, red);
final ui.Image transparentRed100 = await createTestImage(100, 100, transparentRed);
expect( expect(
await matchesReferenceImage(createTestImage(100, 100, red)).matchAsync(createTestImage(100, 100, transparentRed)), await matchesReferenceImage(red100).matchAsync(transparentRed100),
equals('does not match on 57 pixels'), equals('does not match on 57 pixels'),
); );
final ui.Image green100 = await createTestImage(100, 100, green);
expect( expect(
await matchesReferenceImage(createTestImage(100, 100, red)).matchAsync(createTestImage(100, 100, green)), await matchesReferenceImage(red100).matchAsync(green100),
equals('does not match on 57 pixels'), equals('does not match on 57 pixels'),
); );
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment