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
1b5899a4
Unverified
Commit
1b5899a4
authored
May 30, 2023
by
Tomasz Gucio
Committed by
GitHub
May 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid catching FlutterError in TextPainter tests (#127604)
parent
90afc5e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
text_painter_test.dart
packages/flutter/test/painting/text_painter_test.dart
+26
-26
No files found.
packages/flutter/test/painting/text_painter_test.dart
View file @
1b5899a4
...
...
@@ -1253,34 +1253,34 @@ void main() {
..
text
=
const
TextSpan
(
text:
'TEXT'
)
..
textDirection
=
TextDirection
.
ltr
;
FlutterError
?
exception
;
try
{
painter
.
getPositionForOffset
(
Offset
.
zero
);
}
on
FlutterError
catch
(
e
)
{
exception
=
e
;
}
expect
(
exception
?.
message
,
contains
(
'The TextPainter has never been laid out.'
));
exception
=
null
;
try
{
painter
.
layout
();
painter
.
getPositionForOffset
(
Offset
.
zero
);
}
on
FlutterError
catch
(
e
)
{
exception
=
e
;
}
expect
(
exception
,
isNull
);
exception
=
null
;
expect
(
()
=>
painter
.
getPositionForOffset
(
Offset
.
zero
),
throwsA
(
isA
<
FlutterError
>().
having
(
(
FlutterError
error
)
=>
error
.
message
,
'message'
,
contains
(
'The TextPainter has never been laid out.'
),
)),
);
try
{
painter
.
markNeedsLayout
();
painter
.
getPositionForOffset
(
Offset
.
zero
);
}
on
FlutterError
catch
(
e
)
{
exception
=
e
;
}
expect
(
()
{
painter
.
layout
();
painter
.
getPositionForOffset
(
Offset
.
zero
);
},
returnsNormally
,
);
expect
(
exception
?.
message
,
contains
(
'The calls that first invalidated the text layout were:'
));
exception
=
null
;
expect
(
()
{
painter
.
markNeedsLayout
();
painter
.
getPositionForOffset
(
Offset
.
zero
);
},
throwsA
(
isA
<
FlutterError
>().
having
(
(
FlutterError
error
)
=>
error
.
message
,
'message'
,
contains
(
'The calls that first invalidated the text layout were:'
),
)),
);
painter
.
dispose
();
});
...
...
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