Fix transforms for things with RenderPointerListeners (#32535)
This fixes #32525, because it now marks the compositing bits as needing to be recalculated if the mouse tracker changes its idea of whether or not a mouse is attached. This bug occurred because the test framework was leaking state from one test to the next (the state about whether a mouse pointer was active), and so even though there was a "passing" test when run in order with the other tests in the file, when the test was run individually (or first), it would have failed and caught the bug. This adds an assert to make sure that after each test there are no simulated mouse pointers connected, and now calls removePointer in all of the tests where this was a problem.
This commit is contained in:
@@ -695,6 +695,10 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
|
||||
_pendingExceptionDetails = null;
|
||||
_parentZone = null;
|
||||
buildOwner.focusManager = FocusManager();
|
||||
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.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@ class TestPointer {
|
||||
return PointerDownEvent(
|
||||
timeStamp: timeStamp,
|
||||
kind: kind,
|
||||
device: _device,
|
||||
pointer: pointer,
|
||||
position: location,
|
||||
);
|
||||
@@ -125,6 +126,7 @@ class TestPointer {
|
||||
return PointerMoveEvent(
|
||||
timeStamp: timeStamp,
|
||||
kind: kind,
|
||||
device: _device,
|
||||
pointer: pointer,
|
||||
position: newLocation,
|
||||
delta: delta,
|
||||
@@ -143,6 +145,7 @@ class TestPointer {
|
||||
return PointerUpEvent(
|
||||
timeStamp: timeStamp,
|
||||
kind: kind,
|
||||
device: _device,
|
||||
pointer: pointer,
|
||||
position: location,
|
||||
);
|
||||
@@ -160,6 +163,7 @@ class TestPointer {
|
||||
return PointerCancelEvent(
|
||||
timeStamp: timeStamp,
|
||||
kind: kind,
|
||||
device: _device,
|
||||
pointer: pointer,
|
||||
position: location,
|
||||
);
|
||||
@@ -225,8 +229,8 @@ class TestPointer {
|
||||
return PointerHoverEvent(
|
||||
timeStamp: timeStamp,
|
||||
kind: kind,
|
||||
position: newLocation,
|
||||
device: _device,
|
||||
position: newLocation,
|
||||
delta: delta,
|
||||
);
|
||||
}
|
||||
@@ -246,6 +250,7 @@ class TestPointer {
|
||||
return PointerScrollEvent(
|
||||
timeStamp: timeStamp,
|
||||
kind: kind,
|
||||
device: _device,
|
||||
position: location,
|
||||
scrollDelta: scrollDelta,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user