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> {
if (!widget.transitionBetweenRoutes || !_isTransitionable(context)) {
// 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(
// Lint ignore to maintain backward compatibility.
widget.actionsForegroundColor, // ignore: deprecated_member_use
widget.actionsForegroundColor, // ignore: deprecated_member_use_from_same_package
context,
Builder(
// Get the context that might have a possibly changed CupertinoTheme.
......@@ -631,7 +631,7 @@ class _CupertinoSliverNavigationBarState extends State<CupertinoSliverNavigation
@override
Widget build(BuildContext context) {
// 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(
keys: keys,
......@@ -649,7 +649,7 @@ class _CupertinoSliverNavigationBarState extends State<CupertinoSliverNavigation
return _wrapActiveColor(
// Lint ignore to maintain backward compatibility.
widget.actionsForegroundColor, // ignore: deprecated_member_use
widget.actionsForegroundColor, // ignore: deprecated_member_use_from_same_package
context,
SliverPersistentHeader(
pinned: true, // iOS navigation bars are always pinned.
......
......@@ -1476,7 +1476,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin {
// Backwards compatibility for deprecated resizeToAvoidBottomPadding property
bool get _resizeToAvoidBottomInset {
// ignore: deprecated_member_use
// ignore: deprecated_member_use_from_same_package
return widget.resizeToAvoidBottomInset ?? widget.resizeToAvoidBottomPadding ?? true;
}
......
......@@ -84,10 +84,10 @@ mixin PaintingBinding on BindingBase, ServicesBinding {
_kDecodedCacheRatioCap = value;
}
// ignore: deprecated_member_use
// ignore: deprecated_member_use_from_same_package
/// Calls through to [dart:ui] with [decodedCacheRatioCap] from [ImageCache].
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
......
......@@ -16,7 +16,7 @@ class PaintingBindingSpy extends BindingBase with ServicesBinding, PaintingBindi
@override
Future<ui.Codec> instantiateImageCodec(Uint8List list) {
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
......@@ -32,11 +32,11 @@ void main() {
test('decodedCacheRatio', () async {
// final PaintingBinding binding = PaintingBinding.instance;
// 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.
binding.decodedCacheRatioCap = 1.0; // ignore: deprecated_member_use
expect(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_from_same_package
});
test('instantiateImageCodec used for loading images', () async {
......
......@@ -6,7 +6,7 @@ import 'dart:ui' as ui;
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()
..style = ui.PaintingStyle.stroke
..strokeWidth = 1.0
......@@ -26,41 +26,46 @@ void main() {
group('succeeds', () {
testWidgets('when images have the same content', (WidgetTester tester) async {
await expectLater(
createTestImage(100, 100, red),
matchesReferenceImage(createTestImage(100, 100, red)),
await createTestImage(100, 100, red),
matchesReferenceImage(await createTestImage(100, 100, red)),
);
await expectLater(
createTestImage(100, 100, green),
matchesReferenceImage(createTestImage(100, 100, green)),
await createTestImage(100, 100, green),
matchesReferenceImage(await createTestImage(100, 100, green)),
);
await expectLater(
createTestImage(100, 100, transparentRed),
matchesReferenceImage(createTestImage(100, 100, transparentRed)),
await createTestImage(100, 100, transparentRed),
matchesReferenceImage(await createTestImage(100, 100, transparentRed)),
);
});
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));
});
});
group('fails', () {
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(
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]'),
);
});
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(
await matchesReferenceImage(createTestImage(100, 100, red)).matchAsync(createTestImage(100, 100, transparentRed)),
await matchesReferenceImage(red100).matchAsync(transparentRed100),
equals('does not match on 57 pixels'),
);
final ui.Image green100 = await createTestImage(100, 100, green);
expect(
await matchesReferenceImage(createTestImage(100, 100, red)).matchAsync(createTestImage(100, 100, green)),
await matchesReferenceImage(red100).matchAsync(green100),
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