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
ff68b625
Unverified
Commit
ff68b625
authored
Oct 02, 2023
by
Kostia Sokolovskyi
Committed by
GitHub
Oct 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a couple of CupertinoTextField tests to avoid leak-tracking test failures. (#135851)
parent
0eb2cb50
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
8 deletions
+24
-8
text_field_test.dart
packages/flutter/test/cupertino/text_field_test.dart
+24
-8
No files found.
packages/flutter/test/cupertino/text_field_test.dart
View file @
ff68b625
...
@@ -2485,13 +2485,11 @@ void main() {
...
@@ -2485,13 +2485,11 @@ void main() {
await
gesture
.
up
();
await
gesture
.
up
();
await
tester
.
pump
();
await
tester
.
pump
();
expect
(
find
.
byType
(
CupertinoButton
),
isContextMenuProvidedByPlatform
?
findsNothing
:
findsNWidgets
(
4
));
expect
(
find
.
byType
(
CupertinoButton
),
isContextMenuProvidedByPlatform
?
findsNothing
:
findsNWidgets
(
4
));
// Skip the magnifier hide animation, so it can release resources.
await
tester
.
pump
(
const
Duration
(
milliseconds:
150
));
},
},
// TODO(derdilla): remove after fixing and leak track other failing tests in
// this file. https://github.com/flutter/flutter/issues/135803
leakTrackingTestConfig:
const
LeakTrackingTestConfig
(
notDisposedAllowList:
<
String
,
int
?>{
'ValueNotifier<_OverlayEntryWidgetState?>'
:
1
})
);
);
//
testWidgetsWithLeakTracking
(
'Readonly text field does not have tap action'
,
(
WidgetTester
tester
)
async
{
testWidgetsWithLeakTracking
(
'Readonly text field does not have tap action'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
...
@@ -5816,7 +5814,7 @@ void main() {
...
@@ -5816,7 +5814,7 @@ void main() {
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
}),
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
}),
);
);
testWidgets
(
'Can move cursor when dragging, when tap is on collapsed selection (iOS)'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Can move cursor when dragging, when tap is on collapsed selection (iOS)'
,
(
WidgetTester
tester
)
async
{
final
TextEditingController
controller
=
TextEditingController
();
final
TextEditingController
controller
=
TextEditingController
();
addTearDown
(
controller
.
dispose
);
addTearDown
(
controller
.
dispose
);
...
@@ -5860,11 +5858,17 @@ void main() {
...
@@ -5860,11 +5858,17 @@ void main() {
expect
(
controller
.
selection
.
isCollapsed
,
true
);
expect
(
controller
.
selection
.
isCollapsed
,
true
);
expect
(
controller
.
selection
.
baseOffset
,
testValue
.
indexOf
(
'i'
));
expect
(
controller
.
selection
.
baseOffset
,
testValue
.
indexOf
(
'i'
));
// End gesture and skip the magnifier hide animation, so it can release
// resources.
await
gesture
.
up
();
await
tester
.
pump
();
await
tester
.
pump
(
const
Duration
(
milliseconds:
150
));
},
},
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
}),
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
}),
);
);
testWidgets
(
'Can move cursor when dragging, when tap is on collapsed selection (iOS) - multiline'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Can move cursor when dragging, when tap is on collapsed selection (iOS) - multiline'
,
(
WidgetTester
tester
)
async
{
final
TextEditingController
controller
=
TextEditingController
();
final
TextEditingController
controller
=
TextEditingController
();
addTearDown
(
controller
.
dispose
);
addTearDown
(
controller
.
dispose
);
...
@@ -5909,6 +5913,12 @@ void main() {
...
@@ -5909,6 +5913,12 @@ void main() {
expect
(
controller
.
selection
.
isCollapsed
,
true
);
expect
(
controller
.
selection
.
isCollapsed
,
true
);
expect
(
controller
.
selection
.
baseOffset
,
testValue
.
indexOf
(
'i'
));
expect
(
controller
.
selection
.
baseOffset
,
testValue
.
indexOf
(
'i'
));
// End gesture and skip the magnifier hide animation, so it can release
// resources.
await
gesture
.
up
();
await
tester
.
pump
();
await
tester
.
pump
(
const
Duration
(
milliseconds:
150
));
},
},
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
}),
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
}),
);
);
...
@@ -5990,7 +6000,7 @@ void main() {
...
@@ -5990,7 +6000,7 @@ void main() {
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
}),
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
}),
);
);
testWidgets
(
'Can move cursor when dragging (Android)'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Can move cursor when dragging (Android)'
,
(
WidgetTester
tester
)
async
{
final
TextEditingController
controller
=
TextEditingController
();
final
TextEditingController
controller
=
TextEditingController
();
addTearDown
(
controller
.
dispose
);
addTearDown
(
controller
.
dispose
);
...
@@ -6031,6 +6041,12 @@ void main() {
...
@@ -6031,6 +6041,12 @@ void main() {
expect
(
controller
.
selection
.
isCollapsed
,
true
);
expect
(
controller
.
selection
.
isCollapsed
,
true
);
expect
(
controller
.
selection
.
baseOffset
,
testValue
.
indexOf
(
'g'
));
expect
(
controller
.
selection
.
baseOffset
,
testValue
.
indexOf
(
'g'
));
// End gesture and skip the magnifier hide animation, so it can release
// resources.
await
gesture
.
up
();
await
tester
.
pump
();
await
tester
.
pump
(
const
Duration
(
milliseconds:
150
));
},
},
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
,
TargetPlatform
.
fuchsia
}),
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
android
,
TargetPlatform
.
fuchsia
}),
);
);
...
...
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