Skip to content

Commit

Permalink
[framework] Skip 5 failing framework tests. (#143618)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahwilliams authored Feb 17, 2024
1 parent e0f126a commit bb1c7a6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 9 deletions.
19 changes: 19 additions & 0 deletions packages/flutter/test/impeller_test_helpers.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:io' as io;
import 'package:flutter/foundation.dart';

/// Whether or not Flutter CI has configured Impeller for this test run.
///
/// This is intended only to be used for a migration effort to enable Impeller
/// on Flutter CI.
///
/// See also: https://github.com/flutter/flutter/issues/143616
bool get impellerEnabled {
if (kIsWeb) {
return false;
}
return io.Platform.environment.containsKey('FLUTTER_TEST_IMPELLER');
}
8 changes: 5 additions & 3 deletions packages/flutter/test/widgets/default_colors_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import '../impeller_test_helpers.dart';

const double _crispText = 100.0; // this font size is selected to avoid needing any antialiasing.
const String _expText = 'Éxp'; // renders in the test font as:

Expand Down Expand Up @@ -38,7 +40,7 @@ void main() {
const Offset(799, 599): const Color(0x00000000), // the background
},
);
}, skip: !canCaptureImage); // [intended] Test relies on captureImage, which is not supported on web currently.
}, skip: !canCaptureImage || impellerEnabled); // [intended] Test relies on captureImage, which is not supported on web currently.

testWidgets('Default text color', (WidgetTester tester) async {
await tester.pumpWidget(const ColoredBox(
Expand All @@ -63,7 +65,7 @@ void main() {
const Offset(799, 599): const Color(0xFFABCDEF), // the background
},
);
}, skip: !canCaptureImage); // [intended] Test relies on captureImage, which is not supported on web currently.
}, skip: !canCaptureImage || impellerEnabled); // [intended] Test relies on captureImage, which is not supported on web currently.

testWidgets('Default text selection color', (WidgetTester tester) async {
final GlobalKey key = GlobalKey();
Expand Down Expand Up @@ -118,7 +120,7 @@ void main() {
const Offset(799, 599): const Color(0xFFFFFFFF), // the background
},
);
}, skip: !canCaptureImage); // [intended] Test relies on captureImage, which is not supported on web currently.
}, skip: !canCaptureImage || impellerEnabled); // [intended] Test relies on captureImage, which is not supported on web currently.
}

Color _getPixel(ByteData bytes, int x, int y, int width) {
Expand Down
4 changes: 3 additions & 1 deletion packages/flutter/test/widgets/snapshot_widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';

import '../impeller_test_helpers.dart';

void main() {
testWidgets('SnapshotWidget can rasterize child', (WidgetTester tester) async {
final SnapshotController controller = SnapshotController(allowSnapshotting: true);
Expand Down Expand Up @@ -325,7 +327,7 @@ void main() {

await expectLater(find.byKey(repaintBoundaryKey), matchesReferenceImage(imageWhenDisabled));
},
skip: kIsWeb); // TODO(jonahwilliams): https://github.com/flutter/flutter/issues/106689
skip: kIsWeb || impellerEnabled); // TODO(jonahwilliams): https://github.com/flutter/flutter/issues/106689

test('SnapshotPainter dispatches memory events', () async {
await expectLater(
Expand Down
11 changes: 6 additions & 5 deletions packages/flutter/test/widgets/widget_inspector_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:leak_tracker/leak_tracker.dart';

import '../impeller_test_helpers.dart';
import 'widget_inspector_test_utils.dart';

// Start of block of code where widget creation location line numbers and
Expand Down Expand Up @@ -3869,7 +3870,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
_CreationLocation location = knownLocations[id]!;
expect(location.file, equals(file));
// ClockText widget.
expect(location.line, equals(56));
expect(location.line, equals(57));
expect(location.column, equals(9));
expect(location.name, equals('ClockText'));
expect(count, equals(1));
Expand All @@ -3879,7 +3880,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
location = knownLocations[id]!;
expect(location.file, equals(file));
// Text widget in _ClockTextState build method.
expect(location.line, equals(94));
expect(location.line, equals(95));
expect(location.column, equals(12));
expect(location.name, equals('Text'));
expect(count, equals(1));
Expand All @@ -3906,7 +3907,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
location = knownLocations[id]!;
expect(location.file, equals(file));
// ClockText widget.
expect(location.line, equals(56));
expect(location.line, equals(57));
expect(location.column, equals(9));
expect(location.name, equals('ClockText'));
expect(count, equals(3)); // 3 clock widget instances rebuilt.
Expand All @@ -3916,7 +3917,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
location = knownLocations[id]!;
expect(location.file, equals(file));
// Text widget in _ClockTextState build method.
expect(location.line, equals(94));
expect(location.line, equals(95));
expect(location.column, equals(12));
expect(location.name, equals('Text'));
expect(count, equals(3)); // 3 clock widget instances rebuilt.
Expand Down Expand Up @@ -4551,7 +4552,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
screenshot12,
matchesGoldenFile('inspector.sizedBox_debugPaint_margin.png'),
);
});
}, skip: impellerEnabled); // TODO(jonahwilliams): https://github.com/flutter/flutter/issues/143616

group('layout explorer', () {
const String group = 'test-group';
Expand Down

0 comments on commit bb1c7a6

Please sign in to comment.