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
3a18e6ee
Unverified
Commit
3a18e6ee
authored
Nov 22, 2021
by
nt4f04uNd
Committed by
GitHub
Nov 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix reassemble in LiveTestWidgetsFlutterBinding (#92217)
parent
6ae721de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
binding.dart
packages/flutter_test/lib/src/binding.dart
+9
-0
live_binding_test.dart
packages/flutter_test/test/live_binding_test.dart
+6
-0
No files found.
packages/flutter_test/lib/src/binding.dart
View file @
3a18e6ee
...
...
@@ -1391,6 +1391,7 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
Completer
<
void
>?
_pendingFrame
;
bool
_expectingFrame
=
false
;
bool
_expectingFrameToReassemble
=
false
;
bool
_viewNeedsPaint
=
false
;
bool
_runningAsyncTasks
=
false
;
...
...
@@ -1426,12 +1427,19 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
super
.
scheduleForcedFrame
();
}
@override
Future
<
void
>
reassembleApplication
()
{
_expectingFrameToReassemble
=
true
;
return
super
.
reassembleApplication
();
}
bool
?
_doDrawThisFrame
;
@override
void
handleBeginFrame
(
Duration
?
rawTimeStamp
)
{
assert
(
_doDrawThisFrame
==
null
);
if
(
_expectingFrame
||
_expectingFrameToReassemble
||
(
framePolicy
==
LiveTestWidgetsFlutterBindingFramePolicy
.
fullyLive
)
||
(
framePolicy
==
LiveTestWidgetsFlutterBindingFramePolicy
.
benchmarkLive
)
||
(
framePolicy
==
LiveTestWidgetsFlutterBindingFramePolicy
.
benchmark
)
||
...
...
@@ -1450,6 +1458,7 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
super
.
handleDrawFrame
();
_doDrawThisFrame
=
null
;
_viewNeedsPaint
=
false
;
_expectingFrameToReassemble
=
false
;
if
(
_expectingFrame
)
{
// set during pump
assert
(
_pendingFrame
!=
null
);
_pendingFrame
!.
complete
();
// unlocks the test API
...
...
packages/flutter_test/test/live_binding_test.dart
View file @
3a18e6ee
...
...
@@ -94,4 +94,10 @@ void main() {
expect
(
widgetCenter
.
dx
,
windowCenterX
);
expect
(
widgetCenter
.
dy
,
windowCenterY
);
});
testWidgets
(
"reassembleApplication doesn't get stuck"
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/79150
await
expectLater
(
tester
.
binding
.
reassembleApplication
(),
completes
);
},
timeout:
const
Timeout
(
Duration
(
seconds:
30
)));
}
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