Skip to content

Commit

Permalink
Cover more tests with leak tracking. (flutter#134363)
Browse files Browse the repository at this point in the history
  • Loading branch information
polina-c authored Sep 11, 2023
1 parent 6de4e16 commit 219efce
Show file tree
Hide file tree
Showing 37 changed files with 349 additions and 325 deletions.
8 changes: 4 additions & 4 deletions packages/flutter/test/material/about_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ void main() {
expect(find.text('Exception: Injected failure'), findsOneWidget);
});

testWidgets('Material2 - LicensePage master view layout position - ltr', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Material2 - LicensePage master view layout position - ltr', (WidgetTester tester) async {
const TextDirection textDirection = TextDirection.ltr;
const Size defaultSize = Size(800.0, 600.0);
const Size wideSize = Size(1200.0, 600.0);
Expand Down Expand Up @@ -1592,7 +1592,7 @@ void main() {
expect(tester.getCenter(find.byType(ListView)), const Offset(160, 356));
});

testWidgets('Material2 - LicensePage master view layout position - rtl', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Material2 - LicensePage master view layout position - rtl', (WidgetTester tester) async {
const TextDirection textDirection = TextDirection.rtl;
const Size defaultSize = Size(800.0, 600.0);
const Size wideSize = Size(1200.0, 600.0);
Expand Down Expand Up @@ -1657,7 +1657,7 @@ void main() {
expect(tester.getCenter(find.byType(ListView)), const Offset(1040.0, 356.0));
});

testWidgets('Material3 - LicensePage master view layout position - rtl', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Material3 - LicensePage master view layout position - rtl', (WidgetTester tester) async {
const TextDirection textDirection = TextDirection.rtl;
const Size defaultSize = Size(800.0, 600.0);
const Size wideSize = Size(1200.0, 600.0);
Expand Down Expand Up @@ -1724,7 +1724,7 @@ void main() {
expect(tester.getCenter(find.byType(ListView)), const Offset(1040.0, 356.0));
});

testWidgets('License page title in lateral UI does not use AppBarTheme.foregroundColor', (WidgetTester tester) async {
testWidgetsWithLeakTracking('License page title in lateral UI does not use AppBarTheme.foregroundColor', (WidgetTester tester) async {
// This is a regression test for https://github.com/flutter/flutter/issues/108991
final ThemeData theme = ThemeData(
appBarTheme: const AppBarTheme(foregroundColor: Color(0xFFFFFFFF)),
Expand Down
110 changes: 55 additions & 55 deletions packages/flutter/test/material/bottom_sheet_test.dart

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/flutter/test/material/bottom_sheet_theme_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void main() {
expect(material.clipBehavior, clipBehavior);
});

testWidgets('Modal bottom sheet-specific parameters are used for modal bottom sheets', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Modal bottom sheet-specific parameters are used for modal bottom sheets', (WidgetTester tester) async {
const double modalElevation = 5.0;
const double persistentElevation = 7.0;
const Color modalBackgroundColor = Colors.yellow;
Expand Down Expand Up @@ -249,7 +249,7 @@ void main() {
expect(material.color, null);
});

testWidgets('Modal bottom sheets respond to theme changes', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Modal bottom sheets respond to theme changes', (WidgetTester tester) async {
const double lightElevation = 5.0;
const double darkElevation = 3.0;
const Color lightBackgroundColor = Colors.green;
Expand Down
3 changes: 2 additions & 1 deletion packages/flutter/test/material/button_theme_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';


void main() {
Expand Down Expand Up @@ -67,7 +68,7 @@ void main() {
expect(theme.colorScheme, const ColorScheme.dark());
});

testWidgets('ButtonTheme alignedDropdown', (WidgetTester tester) async {
testWidgetsWithLeakTracking('ButtonTheme alignedDropdown', (WidgetTester tester) async {
final Key dropdownKey = UniqueKey();

Widget buildFrame({ required bool alignedDropdown, required TextDirection textDirection }) {
Expand Down
10 changes: 5 additions & 5 deletions packages/flutter/test/material/drawer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void main() {
expect(state.isEndDrawerOpen, equals(false));
});

testWidgets('Scaffold.drawer - null restorationId ', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Scaffold.drawer - null restorationId ', (WidgetTester tester) async {
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
await tester.pumpWidget(
MaterialApp(
Expand All @@ -236,7 +236,7 @@ void main() {
expect(find.text('drawer'), findsNothing);
});

testWidgets('Scaffold.endDrawer - null restorationId ', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Scaffold.endDrawer - null restorationId ', (WidgetTester tester) async {
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
await tester.pumpWidget(
MaterialApp(
Expand All @@ -259,7 +259,7 @@ void main() {
expect(find.text('endDrawer'), findsNothing);
});

testWidgets('Scaffold.drawer state restoration test', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Scaffold.drawer state restoration test', (WidgetTester tester) async {
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
await tester.pumpWidget(
MaterialApp(
Expand Down Expand Up @@ -290,7 +290,7 @@ void main() {
expect(find.text('drawer'), findsOneWidget);
});

testWidgets('Scaffold.endDrawer state restoration test', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Scaffold.endDrawer state restoration test', (WidgetTester tester) async {
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
await tester.pumpWidget(
MaterialApp(
Expand Down Expand Up @@ -321,7 +321,7 @@ void main() {
expect(find.text('endDrawer'), findsOneWidget);
});

testWidgets('Both drawer and endDrawer state restoration test', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Both drawer and endDrawer state restoration test', (WidgetTester tester) async {
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
await tester.pumpWidget(
MaterialApp(
Expand Down
Loading

0 comments on commit 219efce

Please sign in to comment.