[Mouse] Remove all pointers at the end of tests (#102694)

This commit is contained in:
Tong Mu
2022-05-19 17:48:10 -07:00
committed by GitHub
parent 4c0b0be2da
commit 23bc3d64eb
61 changed files with 2 additions and 267 deletions

View File

@@ -952,10 +952,6 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
HardwareKeyboard.instance.clearState();
// ignore: invalid_use_of_visible_for_testing_member
keyEventManager.clearState();
assert(!RendererBinding.instance.mouseTracker.mouseIsConnected,
'The MouseTracker thinks that there is still a mouse connected, which indicates that a '
'test has not removed the mouse pointer which it added. Call removePointer on the '
'active mouse gesture to remove the mouse pointer.');
// ignore: invalid_use_of_visible_for_testing_member
RendererBinding.instance.initMouseTracker();
}

View File

@@ -34,7 +34,6 @@ void main() {
await gesture.moveTo(location);
expect(hoverEvent, isNotNull);
expect(hoverEvent!.position, location);
await gesture.removePointer();
});
testWidgets('hitTesting works when using setSurfaceSize', (WidgetTester tester) async {