Unverified Commit e1fdb1aa authored by LongCatIsLooong's avatar LongCatIsLooong Committed by GitHub

migrate `Tooltip` to use `OverlayPortal` (#127728)

https://github.com/flutter/flutter/issues/7151 isn't a problem with OverlayPortal so the test is removed.
Also removed some `mounted` checks since they're no longer needed.
parent 9e8143a0
......@@ -1041,15 +1041,9 @@ void main() {
),
);
// The tooltip overlay still on the tree and it will removed in the next frame.
// Dispatch the mouse in and out events before the overlay detached.
await gesture.moveTo(tester.getCenter(find.text(tooltipText)));
await gesture.moveTo(Offset.zero);
await tester.pumpAndSettle();
// Go without crashes.
await gesture.removePointer();
// The tooltip should be removed, including the overlay child.
expect(find.text(tooltipText), findsNothing);
expect(find.byTooltip(tooltipText), findsNothing);
});
testWidgetsWithLeakTracking('Calling ensureTooltipVisible on an unmounted TooltipState returns false', (WidgetTester tester) async {
......@@ -1435,35 +1429,6 @@ void main() {
semantics.dispose();
});
testWidgetsWithLeakTracking('Tooltip overlay does not update', (WidgetTester tester) async {
Widget buildApp(String text) {
return MaterialApp(
home: Center(
child: Tooltip(
message: text,
child: Container(
width: 100.0,
height: 100.0,
color: Colors.green[500],
),
),
),
);
}
await tester.pumpWidget(buildApp(tooltipText));
await tester.longPress(find.byType(Tooltip));
expect(find.text(tooltipText), findsOneWidget);
await tester.pumpWidget(buildApp('NEW'));
expect(find.text(tooltipText), findsOneWidget);
await tester.tapAt(const Offset(5.0, 5.0));
await tester.pump();
await tester.pump(const Duration(seconds: 1));
expect(find.text(tooltipText), findsNothing);
await tester.longPress(find.byType(Tooltip));
expect(find.text(tooltipText), findsNothing);
});
testWidgetsWithLeakTracking('Tooltip text scales with textScaleFactor', (WidgetTester tester) async {
Widget buildApp(String text, { required double textScaleFactor }) {
return MediaQuery(
......
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