Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
641f4e24
Unverified
Commit
641f4e24
authored
Jul 20, 2022
by
Sai Sandeep Mutyala
Committed by
GitHub
Jul 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow setting of TestWidgetsFlutterBinding.pointerEventSource (#107976)
parent
c05d4799
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
binding.dart
packages/flutter_test/lib/src/binding.dart
+4
-5
bindings_test.dart
packages/flutter_test/test/bindings_test.dart
+5
-0
No files found.
packages/flutter_test/lib/src/binding.dart
View file @
641f4e24
...
...
@@ -494,8 +494,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
///
/// When [handlePointerEvent] is called directly, [pointerEventSource]
/// is [TestBindingEventSource.device].
TestBindingEventSource
get
pointerEventSource
=>
_pointerEventSource
;
TestBindingEventSource
_pointerEventSource
=
TestBindingEventSource
.
device
;
TestBindingEventSource
pointerEventSource
=
TestBindingEventSource
.
device
;
/// Dispatch an event to the targets found by a hit test on its position,
/// and remember its source as [pointerEventSource].
...
...
@@ -530,12 +529,12 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
/// to the previous value.
@protected
void
withPointerEventSource
(
TestBindingEventSource
source
,
VoidCallback
task
)
{
final
TestBindingEventSource
previousSource
=
_
pointerEventSource
;
_
pointerEventSource
=
source
;
final
TestBindingEventSource
previousSource
=
pointerEventSource
;
pointerEventSource
=
source
;
try
{
task
();
}
finally
{
_
pointerEventSource
=
previousSource
;
pointerEventSource
=
previousSource
;
}
}
...
...
packages/flutter_test/test/bindings_test.dart
View file @
641f4e24
...
...
@@ -31,6 +31,11 @@ void main() {
binding
.
defaultTestTimeout
=
const
test_package
.
Timeout
(
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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment