Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gspencergoog committed May 25, 2022
1 parent 2b39e74 commit 6a41416
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 6 additions & 3 deletions packages/flutter/lib/src/gestures/binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,12 @@ mixin GestureBinding on BindingBase implements HitTestable, HitTestDispatcher, H
debugPrint('$event');
return true;
}());
assert(hitTestResult != null || event is PointerAddedEvent || event is PointerRemovedEvent);
assert(event.position != null);
dispatchEvent(event, hitTestResult);
if (hitTestResult != null ||
event is PointerAddedEvent ||
event is PointerRemovedEvent) {
assert(event.position != null);
dispatchEvent(event, hitTestResult);
}
}

/// Determine which [HitTestTarget] objects are located at a given position.
Expand Down
7 changes: 7 additions & 0 deletions packages/flutter/test/material/debug_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ void main() {
' Localizations\n'
' MediaQuery\n'
' _MediaQueryFromWindow\n'
' _ShortcutRegistrarMarker\n'
' _ShortcutsMarker\n'
' Semantics\n'
' _FocusMarker\n'
' Focus\n'
' Shortcuts\n'
' ShortcutRegistrar\n'
' _FocusMarker\n'
' Focus\n'
' _FocusTraversalGroupMarker\n'
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/test/widgets/focus_manager_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@ void main() {
final String messagesStr = messages.toString();
expect(messagesStr.split('\n').length, equals(58));
expect(messagesStr, contains(RegExp(r' └─Child 1: FocusScopeNode#[a-f0-9]{5}\(parent1 \[PRIMARY FOCUS\]\)')));
expect(messagesStr, contains('FOCUS: Notifying 2 dirty nodes'));
expect(messagesStr, contains('FOCUS: Notified 2 dirty nodes'));
expect(messagesStr, contains(RegExp(r'FOCUS: Scheduling update, current focus is null, next focus will be FocusScopeNode#.*parent1')));
});
}

0 comments on commit 6a41416

Please sign in to comment.