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
0d30546c
Unverified
Commit
0d30546c
authored
Sep 08, 2023
by
Polina Cherkasova
Committed by
GitHub
Sep 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TestWidgetsFlutterBinding should dispose old RestorationManager on reset. (#133999)
parent
e08173e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
binding.dart
packages/flutter_test/lib/src/binding.dart
+1
-0
bindings_reset_test.dart
packages/flutter_test/test/bindings_reset_test.dart
+20
-0
No files found.
packages/flutter_test/lib/src/binding.dart
View file @
0d30546c
...
...
@@ -244,6 +244,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
/// If [registerTestTextInput] returns true when this method is called,
/// the [testTextInput] is configured to simulate the keyboard.
void
reset
()
{
_restorationManager
?.
dispose
();
_restorationManager
=
null
;
resetGestureBinding
();
testTextInput
.
reset
();
...
...
packages/flutter_test/test/bindings_reset_test.dart
0 → 100644
View file @
0d30546c
// 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_test/flutter_test.dart'
;
void
main
(
)
{
test
(
'Disposes restoration manager on reset.'
,
()
{
final
AutomatedTestWidgetsFlutterBinding
binding
=
AutomatedTestWidgetsFlutterBinding
();
int
oldCounter
=
0
;
final
TestRestorationManager
oldRestorationManager
=
binding
.
restorationManager
;
oldRestorationManager
.
addListener
(()
=>
oldCounter
++);
oldRestorationManager
.
notifyListeners
();
expect
(
oldCounter
,
1
);
binding
.
reset
();
expect
(
oldRestorationManager
.
notifyListeners
,
throwsA
((
Object
e
)
=>
e
.
toString
().
contains
(
'disposed'
)));
});
}
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