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
b94b5842
Unverified
Commit
b94b5842
authored
Oct 04, 2022
by
Camille Simon
Committed by
GitHub
Oct 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Android] Fix spell_check integration test flakiness (#112109)
parent
07c5ebca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
22 deletions
+35
-22
.ci.yaml
.ci.yaml
+1
-1
integration_test.dart
..._tests/spell_check/integration_test/integration_test.dart
+34
-21
No files found.
.ci.yaml
View file @
b94b5842
...
...
@@ -2107,7 +2107,7 @@ targets:
task_name
:
routing_test
-
name
:
Linux_android spell_check_test
bringup
:
true
bringup
:
true
# TESTING PURPOSES ONLY
recipe
:
devicelab/devicelab_drone
presubmit
:
false
timeout
:
60
...
...
dev/integration_tests/spell_check/integration_test/integration_test.dart
View file @
b94b5842
...
...
@@ -12,22 +12,35 @@ import 'package:spell_check/main.dart';
late
DefaultSpellCheckService
defaultSpellCheckService
;
late
Locale
locale
;
/// Copy from flutter/test/widgets/editable_text_utils.dart.
RenderEditable
findRenderEditable
(
WidgetTester
tester
,
Type
type
)
{
final
RenderObject
root
=
tester
.
renderObject
(
find
.
byType
(
type
));
/// Waits to find [EditableText] that displays text with misspelled
/// words marked the same as the [TextSpan] provided and returns
/// true if it is found before timing out at 20 seconds.
Future
<
bool
>
findTextSpanTree
(
WidgetTester
tester
,
TextSpan
inlineSpan
,
)
async
{
final
RenderObject
root
=
tester
.
renderObject
(
find
.
byType
(
EditableText
));
expect
(
root
,
isNotNull
);
late
RenderEditable
renderEditable
;
RenderEditable
?
renderEditable
;
void
recursiveFinder
(
RenderObject
child
)
{
if
(
child
is
RenderEditable
)
{
if
(
child
is
RenderEditable
&&
child
.
text
==
inlineSpan
)
{
renderEditable
=
child
;
return
;
}
child
.
visitChildren
(
recursiveFinder
);
}
root
.
visitChildren
(
recursiveFinder
);
expect
(
renderEditable
,
isNotNull
);
return
renderEditable
;
final
DateTime
endTime
=
tester
.
binding
.
clock
.
now
().
add
(
const
Duration
(
seconds:
20
));
do
{
if
(
tester
.
binding
.
clock
.
now
().
isAfter
(
endTime
))
{
return
false
;
}
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
root
.
visitChildren
(
recursiveFinder
);
}
while
(
renderEditable
==
null
);
return
true
;
}
Future
<
void
>
main
()
async
{
...
...
@@ -147,21 +160,21 @@ Future<void> main() async {
await
tester
.
pumpWidget
(
const
MyApp
());
await
tester
.
enterText
(
find
.
byType
(
EditableText
),
'Hey cfabiueqqocnakoef! Hey!'
);
await
tester
.
pumpAndSettle
();
final
RenderEditable
renderEditable
=
findRenderEditable
(
tester
,
EditableText
);
final
TextSpan
textSpanTree
=
renderEditable
.
text
!
as
TextSpan
;
await
tester
.
enterText
(
find
.
byType
(
EditableText
),
'Hey cfabiueq qocnakoef! Hey!'
);
const
TextSpan
expectedTextSpanTree
=
TextSpan
(
style:
style
,
children:
<
TextSpan
>[
TextSpan
(
style:
style
,
text:
'Hey '
),
TextSpan
(
style:
misspelledTextStyle
,
text:
'cfabiueqqocnakoef'
),
TextSpan
(
style:
style
,
text:
'! Hey!'
),
]);
expect
(
textSpanTree
,
equals
(
expectedTextSpanTree
));
style:
style
,
children:
<
TextSpan
>[
TextSpan
(
style:
style
,
text:
'Hey '
),
TextSpan
(
style:
misspelledTextStyle
,
text:
'cfabiueq'
),
TextSpan
(
style:
style
,
text:
' '
),
TextSpan
(
style:
misspelledTextStyle
,
text:
'qocnakoef'
),
TextSpan
(
style:
style
,
text:
'! Hey!'
),
]);
final
bool
expectedTextSpanTreeFound
=
await
findTextSpanTree
(
tester
,
expectedTextSpanTree
);
expect
(
expectedTextSpanTreeFound
,
isTrue
);
});
test
(
...
...
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