Skip to content

Commit 199cb2f

Browse files
authored
Revert "Allow setting of TestWidgetsFlutterBinding.pointerEventSource (#107976)" (#108038)
This reverts commit 641f4e2.
1 parent 1e2be6e commit 199cb2f

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

packages/flutter_test/lib/src/binding.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,8 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
494494
///
495495
/// When [handlePointerEvent] is called directly, [pointerEventSource]
496496
/// is [TestBindingEventSource.device].
497-
TestBindingEventSource pointerEventSource = TestBindingEventSource.device;
497+
TestBindingEventSource get pointerEventSource => _pointerEventSource;
498+
TestBindingEventSource _pointerEventSource = TestBindingEventSource.device;
498499

499500
/// Dispatch an event to the targets found by a hit test on its position,
500501
/// and remember its source as [pointerEventSource].
@@ -529,12 +530,12 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
529530
/// to the previous value.
530531
@protected
531532
void withPointerEventSource(TestBindingEventSource source, VoidCallback task) {
532-
final TestBindingEventSource previousSource = pointerEventSource;
533-
pointerEventSource = source;
533+
final TestBindingEventSource previousSource = _pointerEventSource;
534+
_pointerEventSource = source;
534535
try {
535536
task();
536537
} finally {
537-
pointerEventSource = previousSource;
538+
_pointerEventSource = previousSource;
538539
}
539540
}
540541

packages/flutter_test/test/bindings_test.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ void main() {
3131
binding.defaultTestTimeout = const test_package.Timeout(Duration(minutes: 5));
3232
expect(binding.defaultTestTimeout.duration, const Duration(minutes: 5));
3333
});
34-
35-
test('allows setting pointerEventSource to TestBindingEventSource.test', () {
36-
binding.pointerEventSource = TestBindingEventSource.test;
37-
expect(binding.pointerEventSource, TestBindingEventSource.test);
38-
});
3934
});
4035

4136
// The next three tests must run in order -- first using `test`, then `testWidgets`, then `test` again.

0 commit comments

Comments
 (0)