Unverified Commit 199cb2f5 authored by Dan Field's avatar Dan Field Committed by GitHub

Revert "Allow setting of TestWidgetsFlutterBinding.pointerEventSource (#107976)" (#108038)

This reverts commit 641f4e24.
parent 1e2be6ed
...@@ -494,7 +494,8 @@ abstract class TestWidgetsFlutterBinding extends BindingBase ...@@ -494,7 +494,8 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
/// ///
/// When [handlePointerEvent] is called directly, [pointerEventSource] /// When [handlePointerEvent] is called directly, [pointerEventSource]
/// is [TestBindingEventSource.device]. /// is [TestBindingEventSource.device].
TestBindingEventSource pointerEventSource = TestBindingEventSource.device; TestBindingEventSource get pointerEventSource => _pointerEventSource;
TestBindingEventSource _pointerEventSource = TestBindingEventSource.device;
/// Dispatch an event to the targets found by a hit test on its position, /// Dispatch an event to the targets found by a hit test on its position,
/// and remember its source as [pointerEventSource]. /// and remember its source as [pointerEventSource].
...@@ -529,12 +530,12 @@ abstract class TestWidgetsFlutterBinding extends BindingBase ...@@ -529,12 +530,12 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
/// to the previous value. /// to the previous value.
@protected @protected
void withPointerEventSource(TestBindingEventSource source, VoidCallback task) { void withPointerEventSource(TestBindingEventSource source, VoidCallback task) {
final TestBindingEventSource previousSource = pointerEventSource; final TestBindingEventSource previousSource = _pointerEventSource;
pointerEventSource = source; _pointerEventSource = source;
try { try {
task(); task();
} finally { } finally {
pointerEventSource = previousSource; _pointerEventSource = previousSource;
} }
} }
......
...@@ -31,11 +31,6 @@ void main() { ...@@ -31,11 +31,6 @@ void main() {
binding.defaultTestTimeout = const test_package.Timeout(Duration(minutes: 5)); binding.defaultTestTimeout = const test_package.Timeout(Duration(minutes: 5));
expect(binding.defaultTestTimeout.duration, const Duration(minutes: 5)); expect(binding.defaultTestTimeout.duration, const Duration(minutes: 5));
}); });
test('allows setting pointerEventSource to TestBindingEventSource.test', () {
binding.pointerEventSource = TestBindingEventSource.test;
expect(binding.pointerEventSource, TestBindingEventSource.test);
});
}); });
// The next three tests must run in order -- first using `test`, then `testWidgets`, then `test` again. // The next three tests must run in order -- first using `test`, then `testWidgets`, then `test` again.
......
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