Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover some cupertino tests with leak tracing #135149

Merged
merged 31 commits into from
Sep 21, 2023
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f56513f
update tab_scaffold_test.dart
NobodyForNothing Sep 15, 2023
8434a91
Merge branch 'flutter:master' into test-cupertino-no-problems
NobodyForNothing Sep 16, 2023
6362ae2
update activity_indicator_test.dart
NobodyForNothing Sep 16, 2023
caf817b
update adaptive_text_selection_toolbar_test.dart and fix notDisposed
NobodyForNothing Sep 16, 2023
92a5345
Merge branch 'flutter:master' into test-cupertino-no-problems
NobodyForNothing Sep 20, 2023
3f7e52e
update cupertino/bottom_tab_bar_test
NobodyForNothing Sep 20, 2023
5654de8
update cupertino/button_test
NobodyForNothing Sep 20, 2023
335bac1
update cupertino/checkbox_test
NobodyForNothing Sep 20, 2023
7cd081e
update colors_test.dart
NobodyForNothing Sep 20, 2023
d45488b
update context_menu_action_test.dart
NobodyForNothing Sep 20, 2023
750628f
merge upstream
NobodyForNothing Sep 20, 2023
176a6ec
update context_menu_test.dart
NobodyForNothing Sep 20, 2023
72b5e69
update debug_test.dart
NobodyForNothing Sep 20, 2023
7165f4b
update desktop_text_selection_toolbar_button_test.dart
NobodyForNothing Sep 20, 2023
bf77e89
update desktop_text_selection_toolbar_test.dart
NobodyForNothing Sep 20, 2023
57f6b9f
update form_row_test.dart
NobodyForNothing Sep 20, 2023
9d26844
update icon_theme_data_test.dart
NobodyForNothing Sep 20, 2023
2313b12
update list_section_test.dart
NobodyForNothing Sep 20, 2023
16e77e4
update list_tile_test.dart
NobodyForNothing Sep 20, 2023
26f9ad1
update localizations_test.dart
NobodyForNothing Sep 20, 2023
c3029ad
update refresh_test.dart
NobodyForNothing Sep 20, 2023
eddadd9
update route_test.dart
NobodyForNothing Sep 20, 2023
75ff81e
update scrollbar_paint_test.dart
NobodyForNothing Sep 20, 2023
f3a8c10
update segmented_control_test.dart
NobodyForNothing Sep 20, 2023
efc2ce7
update slider_test.dart
NobodyForNothing Sep 20, 2023
2c38b2c
update tab_test.dart
NobodyForNothing Sep 20, 2023
6c3d8a4
update text_field_restoration_test.dart
NobodyForNothing Sep 20, 2023
01f64ec
update text_selection_toolbar_button_test.dart
NobodyForNothing Sep 20, 2023
d4e7f12
update text_selection_toolbar_test.dart
NobodyForNothing Sep 20, 2023
8902eff
update theme_test.dart
NobodyForNothing Sep 20, 2023
59c8a2c
remove redundant comments
NobodyForNothing Sep 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update cupertino/bottom_tab_bar_test
  • Loading branch information
NobodyForNothing committed Sep 20, 2023
commit 3f7e52ed096c1154356dc4715f7723da85f4bc7b
31 changes: 16 additions & 15 deletions packages/flutter/test/cupertino/bottom_tab_bar_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';

import '../image_data.dart';
import '../widgets/semantics_tester.dart';
Expand All @@ -29,7 +30,7 @@ Future<void> pumpWidgetWithBoilerplate(WidgetTester tester, Widget widget) async

Future<void> main() async {

testWidgets('Need at least 2 tabs', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Need at least 2 tabs', (WidgetTester tester) async {
await expectLater(
() => pumpWidgetWithBoilerplate(tester, CupertinoTabBar(
items: <BottomNavigationBarItem>[
Expand All @@ -47,7 +48,7 @@ Future<void> main() async {
);
});

testWidgets('Active and inactive colors', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Active and inactive colors', (WidgetTester tester) async {
await pumpWidgetWithBoilerplate(tester, MediaQuery(
data: const MediaQueryData(),
child: CupertinoTabBar(
Expand Down Expand Up @@ -81,7 +82,7 @@ Future<void> main() async {
});


testWidgets('BottomNavigationBar.label will create a text widget', (WidgetTester tester) async {
testWidgetsWithLeakTracking('BottomNavigationBar.label will create a text widget', (WidgetTester tester) async {
await pumpWidgetWithBoilerplate(tester, MediaQuery(
data: const MediaQueryData(),
child: CupertinoTabBar(
Expand All @@ -103,7 +104,7 @@ Future<void> main() async {
expect(find.text('Tab 2'), findsOneWidget);
});

testWidgets('Active and inactive colors dark mode', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Active and inactive colors dark mode', (WidgetTester tester) async {
const CupertinoDynamicColor dynamicActiveColor = CupertinoDynamicColor.withBrightness(
color: Color(0xFF000000),
darkColor: Color(0xFF000001),
Expand Down Expand Up @@ -191,7 +192,7 @@ Future<void> main() async {
expect(decoration2.border!.top.color.value, 0x29000000);
});

testWidgets('Tabs respects themes', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Tabs respects themes', (WidgetTester tester) async {
await tester.pumpWidget(
CupertinoApp(
home: CupertinoTabBar(
Expand Down Expand Up @@ -255,7 +256,7 @@ Future<void> main() async {
expect(actualActive.text.style!.color, isSameColorAs(CupertinoColors.activeBlue.darkColor));
});

testWidgets('Use active icon', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Use active icon', (WidgetTester tester) async {
final MemoryImage activeIcon = MemoryImage(Uint8List.fromList(kBlueSquarePng));
final MemoryImage inactiveIcon = MemoryImage(Uint8List.fromList(kTransparentImage));

Expand Down Expand Up @@ -288,7 +289,7 @@ Future<void> main() async {
expect(image.image, activeIcon);
});

testWidgets('Adjusts height to account for bottom padding', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Adjusts height to account for bottom padding', (WidgetTester tester) async {
final CupertinoTabBar tabBar = CupertinoTabBar(
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
Expand Down Expand Up @@ -327,7 +328,7 @@ Future<void> main() async {
expect(tester.getSize(find.byType(CupertinoTabBar)).height, 90.0);
});

testWidgets('Set custom height', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Set custom height', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/51704
const double tabBarHeight = 56.0;
final CupertinoTabBar tabBar = CupertinoTabBar(
Expand Down Expand Up @@ -370,7 +371,7 @@ Future<void> main() async {
expect(tester.getSize(find.byType(CupertinoTabBar)).height, tabBarHeight + bottomPadding);
});

testWidgets('Ensure bar height will not change when toggle keyboard', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Ensure bar height will not change when toggle keyboard', (WidgetTester tester) async {
const double tabBarHeight = 56.0;
final CupertinoTabBar tabBar = CupertinoTabBar(
height: tabBarHeight,
Expand Down Expand Up @@ -424,7 +425,7 @@ Future<void> main() async {
expect(tester.getSize(find.byType(CupertinoTabBar)).height, tabBarHeight + bottomPadding);
});

testWidgets('Opaque background does not add blur effects', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Opaque background does not add blur effects', (WidgetTester tester) async {
await pumpWidgetWithBoilerplate(tester, MediaQuery(
data: const MediaQueryData(),
child: CupertinoTabBar(
Expand Down Expand Up @@ -463,7 +464,7 @@ Future<void> main() async {
expect(find.byType(BackdropFilter), findsNothing);
});

testWidgets('Tap callback', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Tap callback', (WidgetTester tester) async {
late int callbackTab;

await pumpWidgetWithBoilerplate(tester, MediaQuery(
Expand Down Expand Up @@ -491,7 +492,7 @@ Future<void> main() async {
expect(callbackTab, 1);
});

testWidgets('tabs announce semantics', (WidgetTester tester) async {
testWidgetsWithLeakTracking('tabs announce semantics', (WidgetTester tester) async {
final SemanticsTester semantics = SemanticsTester(tester);

await pumpWidgetWithBoilerplate(tester, MediaQuery(
Expand Down Expand Up @@ -526,7 +527,7 @@ Future<void> main() async {
semantics.dispose();
});

testWidgets('Label of items should be nullable', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Label of items should be nullable', (WidgetTester tester) async {
final MemoryImage iconProvider = MemoryImage(Uint8List.fromList(kTransparentImage));
final List<int> itemsTapped = <int>[];

Expand Down Expand Up @@ -563,7 +564,7 @@ Future<void> main() async {
expect(itemsTapped, <int>[1]);
});

testWidgets('Hide border hides the top border of the tabBar', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Hide border hides the top border of the tabBar', (WidgetTester tester) async {
await pumpWidgetWithBoilerplate(
tester,
MediaQuery(
Expand Down Expand Up @@ -623,7 +624,7 @@ Future<void> main() async {
expect(boxDecorationHiddenBorder.border, isNull);
});

testWidgets('Hovering over tab bar item updates cursor to clickable on Web', (WidgetTester tester) async {
testWidgetsWithLeakTracking('Hovering over tab bar item updates cursor to clickable on Web', (WidgetTester tester) async {
await pumpWidgetWithBoilerplate(
tester,
MediaQuery(
Expand Down