diff --git a/packages/material_ui/temporarily_disabled_tests/circle_avatar_test.dart b/packages/material_ui/test/circle_avatar_test.dart similarity index 95% rename from packages/material_ui/temporarily_disabled_tests/circle_avatar_test.dart rename to packages/material_ui/test/circle_avatar_test.dart index eff7ff5d8ef3..37020cb5f578 100644 --- a/packages/material_ui/temporarily_disabled_tests/circle_avatar_test.dart +++ b/packages/material_ui/test/circle_avatar_test.dart @@ -2,9 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@Skip( - 'This file is skipped due to a cross-import that needs to be fixed. Tracked in https://github.com/flutter/flutter/issues/177028.', -) // This file is run as part of a reduced test set in CI on Mac and Windows // machines. @Tags(['reduced-test-set']) @@ -12,12 +9,12 @@ library; import 'dart:typed_data'; -import 'package:material_ui/material_ui.dart'; +import 'package:flutter/foundation.dart' show SynchronousFuture; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; -import '../image_data.dart'; -import '../painting/mocks_for_image_cache.dart'; +import 'image_data.dart'; void main() { testWidgets('CircleAvatar with dark background color', (WidgetTester tester) async { @@ -94,7 +91,7 @@ void main() { WidgetTester tester, ) async { addTearDown(imageCache.clear); - final errorImage = ErrorImageProvider(); + final errorImage = _ErrorImageProvider(); var caughtForegroundImageError = false; await tester.pumpWidget( wrap( @@ -341,3 +338,15 @@ Widget wrap({required Widget child}) { ), ); } + +class _ErrorImageProvider extends ImageProvider<_ErrorImageProvider> { + @override + ImageStreamCompleter loadImage(_ErrorImageProvider key, ImageDecoderCallback decode) { + throw Exception('Simulated image loading failure'); + } + + @override + Future<_ErrorImageProvider> obtainKey(ImageConfiguration configuration) { + return SynchronousFuture<_ErrorImageProvider>(this); + } +} diff --git a/packages/material_ui/temporarily_disabled_tests/color_scheme_test.dart b/packages/material_ui/test/color_scheme_test.dart similarity index 99% rename from packages/material_ui/temporarily_disabled_tests/color_scheme_test.dart rename to packages/material_ui/test/color_scheme_test.dart index 8576a1412731..38f5bad47c92 100644 --- a/packages/material_ui/temporarily_disabled_tests/color_scheme_test.dart +++ b/packages/material_ui/test/color_scheme_test.dart @@ -2,15 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@Skip( - 'This file is skipped due to a cross-import that needs to be fixed. Tracked in https://github.com/flutter/flutter/issues/177028.', -) import 'package:flutter/foundation.dart'; -import 'package:material_ui/material_ui.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:material_color_utilities/material_color_utilities.dart'; +import 'package:material_ui/material_ui.dart'; -import '../image_data.dart'; +import 'image_data.dart'; void main() { test('ColorScheme lerp special cases', () { diff --git a/packages/material_ui/test/image_data.dart b/packages/material_ui/test/image_data.dart new file mode 100644 index 000000000000..0135a4a60687 --- /dev/null +++ b/packages/material_ui/test/image_data.dart @@ -0,0 +1,596 @@ +// Copyright 2013 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +const List kBlueSquarePng = [ + 0x89, + 0x50, + 0x4e, + 0x47, + 0x0d, + 0x0a, + 0x1a, + 0x0a, + 0x00, + 0x00, + 0x00, + 0x0d, + 0x49, + 0x48, + 0x44, + 0x52, + 0x00, + 0x00, + 0x00, + 0x32, + 0x00, + 0x00, + 0x00, + 0x32, + 0x08, + 0x06, + 0x00, + 0x00, + 0x00, + 0x1e, + 0x3f, + 0x88, + 0xb1, + 0x00, + 0x00, + 0x00, + 0x48, + 0x49, + 0x44, + 0x41, + 0x54, + 0x78, + 0xda, + 0xed, + 0xcf, + 0x31, + 0x0d, + 0x00, + 0x30, + 0x08, + 0x00, + 0xb0, + 0x61, + 0x63, + 0x2f, + 0xfe, + 0x2d, + 0x61, + 0x05, + 0x34, + 0xf0, + 0x92, + 0xd6, + 0x41, + 0x23, + 0x7f, + 0xf5, + 0x3b, + 0x20, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x36, + 0x06, + 0x03, + 0x6e, + 0x69, + 0x47, + 0x12, + 0x8e, + 0xea, + 0xaa, + 0x00, + 0x00, + 0x00, + 0x00, + 0x49, + 0x45, + 0x4e, + 0x44, + 0xae, + 0x42, + 0x60, + 0x82, +]; + +const List kTransparentImage = [ + 0x89, + 0x50, + 0x4E, + 0x47, + 0x0D, + 0x0A, + 0x1A, + 0x0A, + 0x00, + 0x00, + 0x00, + 0x0D, + 0x49, + 0x48, + 0x44, + 0x52, + 0x00, + 0x00, + 0x00, + 0x01, + 0x00, + 0x00, + 0x00, + 0x01, + 0x08, + 0x06, + 0x00, + 0x00, + 0x00, + 0x1F, + 0x15, + 0xC4, + 0x89, + 0x00, + 0x00, + 0x00, + 0x06, + 0x62, + 0x4B, + 0x47, + 0x44, + 0x00, + 0xFF, + 0x00, + 0xFF, + 0x00, + 0xFF, + 0xA0, + 0xBD, + 0xA7, + 0x93, + 0x00, + 0x00, + 0x00, + 0x09, + 0x70, + 0x48, + 0x59, + 0x73, + 0x00, + 0x00, + 0x0B, + 0x13, + 0x00, + 0x00, + 0x0B, + 0x13, + 0x01, + 0x00, + 0x9A, + 0x9C, + 0x18, + 0x00, + 0x00, + 0x00, + 0x07, + 0x74, + 0x49, + 0x4D, + 0x45, + 0x07, + 0xE6, + 0x03, + 0x10, + 0x17, + 0x07, + 0x1D, + 0x2E, + 0x5E, + 0x30, + 0x9B, + 0x00, + 0x00, + 0x00, + 0x0B, + 0x49, + 0x44, + 0x41, + 0x54, + 0x08, + 0xD7, + 0x63, + 0x60, + 0x00, + 0x02, + 0x00, + 0x00, + 0x05, + 0x00, + 0x01, + 0xE2, + 0x26, + 0x05, + 0x9B, + 0x00, + 0x00, + 0x00, + 0x00, + 0x49, + 0x45, + 0x4E, + 0x44, + 0xAE, + 0x42, + 0x60, + 0x82, +]; + +const List kBlueRectPng = [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 100, + 8, + 6, + 0, + 0, + 0, + 112, + 226, + 149, + 84, + 0, + 0, + 0, + 4, + 115, + 66, + 73, + 84, + 8, + 8, + 8, + 8, + 124, + 8, + 100, + 136, + 0, + 0, + 1, + 0, + 73, + 68, + 65, + 84, + 120, + 156, + 237, + 209, + 65, + 13, + 0, + 32, + 16, + 192, + 176, + 3, + 255, + 158, + 225, + 141, + 2, + 246, + 104, + 21, + 44, + 217, + 154, + 57, + 103, + 200, + 216, + 191, + 3, + 120, + 25, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 204, + 5, + 234, + 78, + 2, + 198, + 180, + 170, + 48, + 200, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130, +];