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
61477b59
Unverified
Commit
61477b59
authored
Jul 08, 2020
by
Ming Lyu (CareF)
Committed by
GitHub
Jul 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PointerAddedEvent handling in LiveTestWidgetsFlutterBinding (#61102)
* Fix PointerAddedEvent handling in tester
parent
cc1af3af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
binding.dart
packages/flutter_test/lib/src/binding.dart
+5
-2
live_binding_test.dart
packages/flutter_test/test/live_binding_test.dart
+19
-0
No files found.
packages/flutter_test/lib/src/binding.dart
View file @
61477b59
...
...
@@ -1433,8 +1433,11 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
switch
(
source
)
{
case
TestBindingEventSource
.
test
:
if
(!
renderView
.
_pointers
.
containsKey
(
event
.
pointer
))
{
assert
(
event
.
down
);
renderView
.
_pointers
[
event
.
pointer
]
=
_LiveTestPointerRecord
(
event
.
pointer
,
event
.
position
);
assert
(
event
.
down
||
event
is
PointerAddedEvent
);
if
(
event
.
down
)
{
renderView
.
_pointers
[
event
.
pointer
]
=
_LiveTestPointerRecord
(
event
.
pointer
,
event
.
position
);
}
}
else
{
renderView
.
_pointers
[
event
.
pointer
].
position
=
event
.
position
;
if
(!
event
.
down
)
...
...
packages/flutter_test/test/live_binding_test.dart
0 → 100644
View file @
61477b59
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
// This file is for testings that require a `LiveTestWidgetsFlutterBinding`
void
main
(
)
{
LiveTestWidgetsFlutterBinding
();
testWidgets
(
'Input PointerAddedEvent'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Text
(
'Test'
)));
await
tester
.
pump
();
final
TestGesture
gesture
=
await
tester
.
createGesture
();
// This mimics the start of a gesture as seen on a device, where inputs
// starts with a PointerAddedEvent.
await
gesture
.
addPointer
();
});
}
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