Unverified Commit 0aafdfa5 authored by Tong Mu's avatar Tong Mu Committed by GitHub

Redo: Rewrite MouseTracker's tracking and notifying algorithm (#42486)

* Revert "Revert "Rewrite MouseTracker's tracking and notifying algorithm (#42031)" (#42478)"

This reverts commit eede7929.

* Fix tests
parent 4dcf1ab8
...@@ -2435,7 +2435,7 @@ class ObjectFlagProperty<T> extends DiagnosticsProperty<T> { ...@@ -2435,7 +2435,7 @@ class ObjectFlagProperty<T> extends DiagnosticsProperty<T> {
/// ///
/// See also: /// See also:
/// ///
/// * [ObjectFlagSummary], which provides similar functionality but accepts /// * [ObjectFlagProperty], which provides similar functionality but accepts
/// only one flag, and is preferred if there is only one entry. /// only one flag, and is preferred if there is only one entry.
/// * [IterableProperty], which provides similar functionality describing /// * [IterableProperty], which provides similar functionality describing
/// the values a collection of objects. /// the values a collection of objects.
......
...@@ -836,7 +836,7 @@ void main() { ...@@ -836,7 +836,7 @@ void main() {
// Move to the overlapping area // Move to the overlapping area
await gesture.moveTo(const Offset(75, 75)); await gesture.moveTo(const Offset(75, 75));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(logs, <String>['enterA', 'enterC', 'enterB']); expect(logs, <String>['enterA', 'enterB', 'enterC']);
logs.clear(); logs.clear();
// Move to the B only area // Move to the B only area
...@@ -866,7 +866,7 @@ void main() { ...@@ -866,7 +866,7 @@ void main() {
// Move out // Move out
await gesture.moveTo(const Offset(160, 160)); await gesture.moveTo(const Offset(160, 160));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(logs, <String>['exitA', 'exitB', 'exitC']); expect(logs, <String>['exitC', 'exitB', 'exitA']);
}); });
testWidgets('an opaque one should prevent MouseRegions behind it receiving pointers', (WidgetTester tester) async { testWidgets('an opaque one should prevent MouseRegions behind it receiving pointers', (WidgetTester tester) async {
...@@ -890,13 +890,13 @@ void main() { ...@@ -890,13 +890,13 @@ void main() {
// Move to the B only area // Move to the B only area
await gesture.moveTo(const Offset(25, 75)); await gesture.moveTo(const Offset(25, 75));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(logs, <String>['enterB', 'exitC']); expect(logs, <String>['exitC', 'enterB']);
logs.clear(); logs.clear();
// Move back to the overlapping area // Move back to the overlapping area
await gesture.moveTo(const Offset(75, 75)); await gesture.moveTo(const Offset(75, 75));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(logs, <String>['enterC', 'exitB']); expect(logs, <String>['exitB', 'enterC']);
logs.clear(); logs.clear();
// Move to the C only area // Move to the C only area
...@@ -914,7 +914,7 @@ void main() { ...@@ -914,7 +914,7 @@ void main() {
// Move out // Move out
await gesture.moveTo(const Offset(160, 160)); await gesture.moveTo(const Offset(160, 160));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(logs, <String>['exitA', 'exitC']); expect(logs, <String>['exitC', 'exitA']);
}); });
testWidgets('opaque should default to true', (WidgetTester tester) async { testWidgets('opaque should default to true', (WidgetTester tester) async {
...@@ -938,7 +938,7 @@ void main() { ...@@ -938,7 +938,7 @@ void main() {
// Move out // Move out
await gesture.moveTo(const Offset(160, 160)); await gesture.moveTo(const Offset(160, 160));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(logs, <String>['exitA', 'exitC']); expect(logs, <String>['exitC', 'exitA']);
}); });
}); });
......
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