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
9f69a367
Unverified
Commit
9f69a367
authored
Mar 06, 2023
by
LongCatIsLooong
Committed by
GitHub
Mar 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update test font (#121306)
Update test font
parent
57c7aa53
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
290 additions
and
350 deletions
+290
-350
button_test.dart
packages/flutter/test/cupertino/button_test.dart
+0
-1
route_test.dart
packages/flutter/test/cupertino/route_test.dart
+1
-1
text_field_test.dart
packages/flutter/test/cupertino/text_field_test.dart
+3
-13
chip_test.dart
packages/flutter/test/material/chip_test.dart
+1
-1
input_decorator_test.dart
packages/flutter/test/material/input_decorator_test.dart
+133
-134
tabs_test.dart
packages/flutter/test/material/tabs_test.dart
+8
-8
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+21
-21
theme_data_test.dart
packages/flutter/test/material/theme_data_test.dart
+3
-3
toggle_buttons_test.dart
packages/flutter/test/material/toggle_buttons_test.dart
+8
-8
text_painter_rtl_test.dart
packages/flutter/test/painting/text_painter_rtl_test.dart
+16
-16
text_painter_test.dart
packages/flutter/test/painting/text_painter_test.dart
+2
-11
editable_gesture_test.dart
packages/flutter/test/rendering/editable_gesture_test.dart
+1
-3
editable_test.dart
packages/flutter/test/rendering/editable_test.dart
+29
-61
paragraph_test.dart
packages/flutter/test/rendering/paragraph_test.dart
+8
-8
baseline_test.dart
packages/flutter/test/widgets/baseline_test.dart
+3
-4
basic_test.dart
packages/flutter/test/widgets/basic_test.dart
+15
-18
default_colors_test.dart
packages/flutter/test/widgets/default_colors_test.dart
+1
-1
scrollable_fling_test.dart
packages/flutter/test/widgets/scrollable_fling_test.dart
+0
-1
selectable_text_test.dart
packages/flutter/test/widgets/selectable_text_test.dart
+22
-22
semantics_tester_test.dart
packages/flutter/test/widgets/semantics_tester_test.dart
+1
-1
text_selection_test.dart
packages/flutter/test/widgets/text_selection_test.dart
+1
-1
text_test.dart
packages/flutter/test/widgets/text_test.dart
+10
-10
wrap_test.dart
packages/flutter/test/widgets/wrap_test.dart
+3
-3
No files found.
packages/flutter/test/cupertino/button_test.dart
View file @
9f69a367
...
@@ -12,7 +12,6 @@ import 'package:flutter_test/flutter_test.dart';
...
@@ -12,7 +12,6 @@ import 'package:flutter_test/flutter_test.dart';
import
'../widgets/semantics_tester.dart'
;
import
'../widgets/semantics_tester.dart'
;
const
TextStyle
testStyle
=
TextStyle
(
const
TextStyle
testStyle
=
TextStyle
(
fontFamily:
'Ahem'
,
fontSize:
10.0
,
fontSize:
10.0
,
letterSpacing:
0.0
,
letterSpacing:
0.0
,
);
);
...
...
packages/flutter/test/cupertino/route_test.dart
View file @
9f69a367
...
@@ -160,7 +160,7 @@ void main() {
...
@@ -160,7 +160,7 @@ void main() {
// Also shows the previous page's title next to the back button.
// Also shows the previous page's title next to the back button.
expect
(
find
.
widgetWithText
(
CupertinoButton
,
'An iPod'
),
findsOneWidget
);
expect
(
find
.
widgetWithText
(
CupertinoButton
,
'An iPod'
),
findsOneWidget
);
// 3 paddings + 1
ahem
character at font size 34.0.
// 3 paddings + 1
test font
character at font size 34.0.
expect
(
tester
.
getTopLeft
(
find
.
text
(
'An iPod'
)).
dx
,
8.0
+
4.0
+
34.0
+
6.0
);
expect
(
tester
.
getTopLeft
(
find
.
text
(
'An iPod'
)).
dx
,
8.0
+
4.0
+
34.0
+
6.0
);
});
});
...
...
packages/flutter/test/cupertino/text_field_test.dart
View file @
9f69a367
...
@@ -3496,10 +3496,7 @@ void main() {
...
@@ -3496,10 +3496,7 @@ void main() {
child:
CupertinoTextField
(
child:
CupertinoTextField
(
dragStartBehavior:
DragStartBehavior
.
down
,
dragStartBehavior:
DragStartBehavior
.
down
,
controller:
controller
,
controller:
controller
,
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
10.0
),
fontFamily:
'Ahem'
,
fontSize:
10.0
,
),
),
),
),
),
),
),
...
@@ -4045,10 +4042,7 @@ void main() {
...
@@ -4045,10 +4042,7 @@ void main() {
child:
CupertinoTextField
(
child:
CupertinoTextField
(
dragStartBehavior:
DragStartBehavior
.
down
,
dragStartBehavior:
DragStartBehavior
.
down
,
controller:
controller
,
controller:
controller
,
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
10.0
),
fontFamily:
'Ahem'
,
fontSize:
10.0
,
),
),
),
),
),
),
),
...
@@ -4180,10 +4174,7 @@ void main() {
...
@@ -4180,10 +4174,7 @@ void main() {
child:
CupertinoTextField
(
child:
CupertinoTextField
(
dragStartBehavior:
DragStartBehavior
.
down
,
dragStartBehavior:
DragStartBehavior
.
down
,
controller:
controller
,
controller:
controller
,
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
10.0
),
fontFamily:
'Ahem'
,
fontSize:
10.0
,
),
),
),
),
),
),
),
...
@@ -7858,7 +7849,6 @@ void main() {
...
@@ -7858,7 +7849,6 @@ void main() {
testWidgets
(
'placeholder style overflow works'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'placeholder style overflow works'
,
(
WidgetTester
tester
)
async
{
final
String
placeholder
=
'hint text'
*
20
;
final
String
placeholder
=
'hint text'
*
20
;
const
TextStyle
placeholderStyle
=
TextStyle
(
const
TextStyle
placeholderStyle
=
TextStyle
(
fontFamily:
'Ahem'
,
fontSize:
14.0
,
fontSize:
14.0
,
overflow:
TextOverflow
.
fade
,
overflow:
TextOverflow
.
fade
,
);
);
...
...
packages/flutter/test/material/chip_test.dart
View file @
9f69a367
...
@@ -576,7 +576,7 @@ void main() {
...
@@ -576,7 +576,7 @@ void main() {
);
);
testWidgets
(
'Chip in row works ok'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Chip in row works ok'
,
(
WidgetTester
tester
)
async
{
const
TextStyle
style
=
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
);
const
TextStyle
style
=
TextStyle
(
fontSize:
10.0
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
wrapForChip
(
wrapForChip
(
child:
const
Row
(
child:
const
Row
(
...
...
packages/flutter/test/material/input_decorator_test.dart
View file @
9f69a367
This diff is collapsed.
Click to expand it.
packages/flutter/test/material/tabs_test.dart
View file @
9f69a367
...
@@ -288,24 +288,24 @@ void main() {
...
@@ -288,24 +288,24 @@ void main() {
testWidgets
(
'Tab sizing - text'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tab sizing - text'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
fontFamily:
'
Ahem
'
),
home:
const
Center
(
child:
Material
(
child:
Tab
(
text:
'x'
)))),
MaterialApp
(
theme:
ThemeData
(
fontFamily:
'
FlutterTest
'
),
home:
const
Center
(
child:
Material
(
child:
Tab
(
text:
'x'
)))),
);
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
!.
fontFamily
,
'
Ahem
'
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
!.
fontFamily
,
'
FlutterTest
'
);
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
14.0
,
46.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
14.0
,
46.0
));
});
});
testWidgets
(
'Tab sizing - icon and text'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tab sizing - icon and text'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
fontFamily:
'
Ahem
'
),
home:
const
Center
(
child:
Material
(
child:
Tab
(
icon:
SizedBox
(
width:
10.0
,
height:
10.0
),
text:
'x'
)))),
MaterialApp
(
theme:
ThemeData
(
fontFamily:
'
FlutterTest
'
),
home:
const
Center
(
child:
Material
(
child:
Tab
(
icon:
SizedBox
(
width:
10.0
,
height:
10.0
),
text:
'x'
)))),
);
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
!.
fontFamily
,
'
Ahem
'
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
!.
fontFamily
,
'
FlutterTest
'
);
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
14.0
,
72.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
14.0
,
72.0
));
});
});
testWidgets
(
'Tab sizing - icon, iconMargin and text'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tab sizing - icon, iconMargin and text'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
MaterialApp
(
MaterialApp
(
theme:
ThemeData
(
fontFamily:
'
Ahem
'
),
theme:
ThemeData
(
fontFamily:
'
FlutterTest
'
),
home:
const
Center
(
home:
const
Center
(
child:
Material
(
child:
Material
(
child:
Tab
(
child:
Tab
(
...
@@ -322,15 +322,15 @@ void main() {
...
@@ -322,15 +322,15 @@ void main() {
),
),
),
),
);
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
!.
fontFamily
,
'
Ahem
'
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
!.
fontFamily
,
'
FlutterTest
'
);
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
210.0
,
72.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
210.0
,
72.0
));
});
});
testWidgets
(
'Tab sizing - icon and child'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tab sizing - icon and child'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
fontFamily:
'
Ahem
'
),
home:
const
Center
(
child:
Material
(
child:
Tab
(
icon:
SizedBox
(
width:
10.0
,
height:
10.0
),
child:
Text
(
'x'
))))),
MaterialApp
(
theme:
ThemeData
(
fontFamily:
'
FlutterTest
'
),
home:
const
Center
(
child:
Material
(
child:
Tab
(
icon:
SizedBox
(
width:
10.0
,
height:
10.0
),
child:
Text
(
'x'
))))),
);
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
!.
fontFamily
,
'
Ahem
'
);
expect
(
tester
.
renderObject
<
RenderParagraph
>(
find
.
byType
(
RichText
)).
text
.
style
!.
fontFamily
,
'
FlutterTest
'
);
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
14.0
,
72.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Tab
)),
const
Size
(
14.0
,
72.0
));
});
});
...
...
packages/flutter/test/material/text_field_test.dart
View file @
9f69a367
...
@@ -2241,7 +2241,7 @@ void main() {
...
@@ -2241,7 +2241,7 @@ void main() {
child:
TextField
(
child:
TextField
(
dragStartBehavior:
DragStartBehavior
.
down
,
dragStartBehavior:
DragStartBehavior
.
down
,
controller:
controller
,
controller:
controller
,
style:
const
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
),
style:
const
TextStyle
(
fontSize:
10.0
),
),
),
),
),
),
),
...
@@ -6913,20 +6913,20 @@ void main() {
...
@@ -6913,20 +6913,20 @@ void main() {
key:
keyA
,
key:
keyA
,
decoration:
null
,
decoration:
null
,
controller:
controllerA
,
controller:
controllerA
,
style:
const
TextStyle
(
fontSize:
10.0
),
style:
const
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
10.0
),
strutStyle:
StrutStyle
.
disabled
,
strutStyle:
StrutStyle
.
disabled
,
),
),
),
),
const
Text
(
const
Text
(
'abc'
,
'abc'
,
style:
TextStyle
(
fontSize:
20.0
),
style:
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
20.0
),
),
),
Expanded
(
Expanded
(
child:
TextField
(
child:
TextField
(
key:
keyB
,
key:
keyB
,
decoration:
null
,
decoration:
null
,
controller:
controllerB
,
controller:
controllerB
,
style:
const
TextStyle
(
fontSize:
30.0
),
style:
const
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
30.0
),
strutStyle:
StrutStyle
.
disabled
,
strutStyle:
StrutStyle
.
disabled
,
),
),
),
),
...
@@ -6935,17 +6935,17 @@ void main() {
...
@@ -6935,17 +6935,17 @@ void main() {
),
),
);
);
// The
Ahem font extends 0.2
* fontSize below the baseline.
// The
test font extends 0.25
* fontSize below the baseline.
// So the three row elements line up like this:
// So the three row elements line up like this:
//
//
// A abc B
// A
abc B
// ---------
baseline
// ---------
----
baseline
// 2
4 6 space below the baseline = 0.2
* fontSize
// 2
.5 5 7.5 space below the baseline = 0.25
* fontSize
// ---------
rowBottomY
// ---------
----
rowBottomY
final
double
rowBottomY
=
tester
.
getBottomLeft
(
find
.
byType
(
Row
)).
dy
;
final
double
rowBottomY
=
tester
.
getBottomLeft
(
find
.
byType
(
Row
)).
dy
;
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyA
)).
dy
,
moreOrLessEquals
(
rowBottomY
-
4.0
,
epsilon:
0.001
)
);
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyA
)).
dy
,
rowBottomY
-
5.0
);
expect
(
tester
.
getBottomLeft
(
find
.
text
(
'abc'
)).
dy
,
moreOrLessEquals
(
rowBottomY
-
2.0
,
epsilon:
0.001
)
);
expect
(
tester
.
getBottomLeft
(
find
.
text
(
'abc'
)).
dy
,
rowBottomY
-
2.5
);
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyB
)).
dy
,
rowBottomY
);
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyB
)).
dy
,
rowBottomY
);
});
});
...
@@ -6966,19 +6966,19 @@ void main() {
...
@@ -6966,19 +6966,19 @@ void main() {
key:
keyA
,
key:
keyA
,
decoration:
null
,
decoration:
null
,
controller:
controllerA
,
controller:
controllerA
,
style:
const
TextStyle
(
fontSize:
10.0
),
style:
const
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
10.0
),
),
),
),
),
const
Text
(
const
Text
(
'abc'
,
'abc'
,
style:
TextStyle
(
fontSize:
20.0
),
style:
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
20.0
),
),
),
Expanded
(
Expanded
(
child:
TextField
(
child:
TextField
(
key:
keyB
,
key:
keyB
,
decoration:
null
,
decoration:
null
,
controller:
controllerB
,
controller:
controllerB
,
style:
const
TextStyle
(
fontSize:
30.0
),
style:
const
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
30.0
),
),
),
),
),
],
],
...
@@ -6986,18 +6986,18 @@ void main() {
...
@@ -6986,18 +6986,18 @@ void main() {
),
),
);
);
// The
Ahem font extends 0.2
* fontSize below the baseline.
// The
test font extends 0.25
* fontSize below the baseline.
// So the three row elements line up like this:
// So the three row elements line up like this:
//
//
// A abc B
// A
abc B
// ---------
baseline
// ---------
----
baseline
// 2
4 6 space below the baseline = 0.2
* fontSize
// 2
.5 5 7.5 space below the baseline = 0.25
* fontSize
// ---------
rowBottomY
// ---------
----
rowBottomY
final
double
rowBottomY
=
tester
.
getBottomLeft
(
find
.
byType
(
Row
)).
dy
;
final
double
rowBottomY
=
tester
.
getBottomLeft
(
find
.
byType
(
Row
)).
dy
;
// The values here should match the version with strut disabled ('TextField baseline alignment no-strut')
// The values here should match the version with strut disabled ('TextField baseline alignment no-strut')
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyA
)).
dy
,
moreOrLessEquals
(
rowBottomY
-
4.0
,
epsilon:
0.001
)
);
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyA
)).
dy
,
rowBottomY
-
5.0
);
expect
(
tester
.
getBottomLeft
(
find
.
text
(
'abc'
)).
dy
,
moreOrLessEquals
(
rowBottomY
-
2.0
,
epsilon:
0.001
)
);
expect
(
tester
.
getBottomLeft
(
find
.
text
(
'abc'
)).
dy
,
rowBottomY
-
2.5
);
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyB
)).
dy
,
rowBottomY
);
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyB
)).
dy
,
rowBottomY
);
});
});
...
...
packages/flutter/test/material/theme_data_test.dart
View file @
9f69a367
...
@@ -101,14 +101,14 @@ void main() {
...
@@ -101,14 +101,14 @@ void main() {
test
(
'Can control fontFamily default'
,
()
{
test
(
'Can control fontFamily default'
,
()
{
final
ThemeData
themeData
=
ThemeData
(
final
ThemeData
themeData
=
ThemeData
(
fontFamily:
'
Ahem
'
,
fontFamily:
'
FlutterTest
'
,
textTheme:
const
TextTheme
(
textTheme:
const
TextTheme
(
titleLarge:
TextStyle
(
fontFamily:
'Roboto'
),
titleLarge:
TextStyle
(
fontFamily:
'Roboto'
),
),
),
);
);
expect
(
themeData
.
textTheme
.
bodyLarge
!.
fontFamily
,
equals
(
'
Ahem
'
));
expect
(
themeData
.
textTheme
.
bodyLarge
!.
fontFamily
,
equals
(
'
FlutterTest
'
));
expect
(
themeData
.
primaryTextTheme
.
displaySmall
!.
fontFamily
,
equals
(
'
Ahem
'
));
expect
(
themeData
.
primaryTextTheme
.
displaySmall
!.
fontFamily
,
equals
(
'
FlutterTest
'
));
// Shouldn't override the specified style's family
// Shouldn't override the specified style's family
expect
(
themeData
.
textTheme
.
titleLarge
!.
fontFamily
,
equals
(
'Roboto'
));
expect
(
themeData
.
textTheme
.
titleLarge
!.
fontFamily
,
equals
(
'Roboto'
));
...
...
packages/flutter/test/material/toggle_buttons_test.dart
View file @
9f69a367
...
@@ -1337,27 +1337,27 @@ void main() {
...
@@ -1337,27 +1337,27 @@ void main() {
borderWidth:
5.0
,
borderWidth:
5.0
,
isSelected:
const
<
bool
>[
false
,
true
],
isSelected:
const
<
bool
>[
false
,
true
],
children:
const
<
Widget
>[
children:
const
<
Widget
>[
Text
(
'First child'
,
style:
TextStyle
(
fontFamily:
'
Ahem
'
,
fontSize:
10.0
)),
Text
(
'First child'
,
style:
TextStyle
(
fontFamily:
'
FlutterTest
'
,
fontSize:
10.0
)),
Text
(
'Second child'
,
style:
TextStyle
(
fontFamily:
'
Ahem
'
,
fontSize:
10.0
)),
Text
(
'Second child'
,
style:
TextStyle
(
fontFamily:
'
FlutterTest
'
,
fontSize:
10.0
)),
],
],
),
),
const
MaterialButton
(
const
MaterialButton
(
onPressed:
null
,
onPressed:
null
,
child:
Text
(
'Material Button'
,
style:
TextStyle
(
fontFamily:
'
Ahem
'
,
fontSize:
20.0
)),
child:
Text
(
'Material Button'
,
style:
TextStyle
(
fontFamily:
'
FlutterTest
'
,
fontSize:
20.0
)),
),
),
const
Text
(
'Text'
,
style:
TextStyle
(
fontFamily:
'
Ahem
'
,
fontSize:
30.0
)),
const
Text
(
'Text'
,
style:
TextStyle
(
fontFamily:
'
FlutterTest
'
,
fontSize:
30.0
)),
],
],
),
),
),
),
),
),
);
);
// The
Ahem font extends 0.2
* fontSize below the baseline.
// The
test font extends 0.25
* fontSize below the baseline.
// So the three row elements line up like this:
// So the three row elements line up like this:
//
//
// ToggleButton MaterialButton Text
// ToggleButton MaterialButton Text
// ------------------------------------ baseline
// ------------------------------------ baseline
// 2
4 6 space below the baseline = 0.2
* fontSize
// 2
.5 5 7.5 space below the baseline = 0.25
* fontSize
// ------------------------------------ widget text dy values
// ------------------------------------ widget text dy values
final
double
firstToggleButtonDy
=
tester
.
getBottomLeft
(
find
.
text
(
'First child'
)).
dy
;
final
double
firstToggleButtonDy
=
tester
.
getBottomLeft
(
find
.
text
(
'First child'
)).
dy
;
...
@@ -1366,8 +1366,8 @@ void main() {
...
@@ -1366,8 +1366,8 @@ void main() {
final
double
textDy
=
tester
.
getBottomLeft
(
find
.
text
(
'Text'
)).
dy
;
final
double
textDy
=
tester
.
getBottomLeft
(
find
.
text
(
'Text'
)).
dy
;
expect
(
firstToggleButtonDy
,
secondToggleButtonDy
);
expect
(
firstToggleButtonDy
,
secondToggleButtonDy
);
expect
(
firstToggleButtonDy
,
m
oreOrLessEquals
(
materialButtonDy
-
2.0
,
epsilon:
0.001
)
);
expect
(
firstToggleButtonDy
,
m
aterialButtonDy
-
2.5
);
expect
(
firstToggleButtonDy
,
moreOrLessEquals
(
textDy
-
4.0
,
epsilon:
0.001
)
);
expect
(
firstToggleButtonDy
,
textDy
-
5.0
);
});
});
testWidgets
(
'Directionality test'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Directionality test'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/painting/text_painter_rtl_test.dart
View file @
9f69a367
...
@@ -16,7 +16,7 @@ void main() {
...
@@ -16,7 +16,7 @@ void main() {
painter
.
text
=
const
TextSpan
(
painter
.
text
=
const
TextSpan
(
text:
'ABC DEF
\n
GHI'
,
text:
'ABC DEF
\n
GHI'
,
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
),
style:
TextStyle
(
fontSize:
10.0
),
);
);
painter
.
layout
();
painter
.
layout
();
...
@@ -42,7 +42,7 @@ void main() {
...
@@ -42,7 +42,7 @@ void main() {
painter
.
text
=
const
TextSpan
(
painter
.
text
=
const
TextSpan
(
text:
'
${Unicode.RLO}
HEBREW1
${Unicode.LRO}
english2
${Unicode.PDF}
HEBREW3
${Unicode.PDF}
'
,
text:
'
${Unicode.RLO}
HEBREW1
${Unicode.LRO}
english2
${Unicode.PDF}
HEBREW3
${Unicode.PDF}
'
,
// 0 12345678 9 101234567 18 90123456 27
// 0 12345678 9 101234567 18 90123456 27
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
),
style:
TextStyle
(
fontSize:
10.0
),
);
);
TextSpan
textSpan
=
painter
.
text
!
as
TextSpan
;
TextSpan
textSpan
=
painter
.
text
!
as
TextSpan
;
expect
(
textSpan
.
text
!.
length
,
28
);
expect
(
textSpan
.
text
!.
length
,
28
);
...
@@ -175,7 +175,7 @@ void main() {
...
@@ -175,7 +175,7 @@ void main() {
painter
.
text
=
const
TextSpan
(
painter
.
text
=
const
TextSpan
(
text:
'
${Unicode.RLO}
HEBREW1
${Unicode.LRO}
english2
${Unicode.PDF}
HEBREW3
${Unicode.PDF}
'
,
text:
'
${Unicode.RLO}
HEBREW1
${Unicode.LRO}
english2
${Unicode.PDF}
HEBREW3
${Unicode.PDF}
'
,
// 0 12345678 9 101234567 18 90123456 27
// 0 12345678 9 101234567 18 90123456 27
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
),
style:
TextStyle
(
fontSize:
10.0
),
);
);
final
TextSpan
textSpan
=
painter
.
text
!
as
TextSpan
;
final
TextSpan
textSpan
=
painter
.
text
!
as
TextSpan
;
expect
(
textSpan
.
text
!.
length
,
28
);
expect
(
textSpan
.
text
!.
length
,
28
);
...
@@ -266,7 +266,7 @@ void main() {
...
@@ -266,7 +266,7 @@ void main() {
painter
.
text
=
const
TextSpan
(
painter
.
text
=
const
TextSpan
(
text:
'A
\
u05D0'
,
// A, Alef
text:
'A
\
u05D0'
,
// A, Alef
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
),
style:
TextStyle
(
fontSize:
10.0
),
);
);
final
TextSpan
textSpan
=
painter
.
text
!
as
TextSpan
;
final
TextSpan
textSpan
=
painter
.
text
!
as
TextSpan
;
expect
(
textSpan
.
text
!.
length
,
2
);
expect
(
textSpan
.
text
!.
length
,
2
);
...
@@ -333,14 +333,14 @@ void main() {
...
@@ -333,14 +333,14 @@ void main() {
..
textDirection
=
TextDirection
.
ltr
;
..
textDirection
=
TextDirection
.
ltr
;
painter
.
text
=
const
TextSpan
(
painter
.
text
=
const
TextSpan
(
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
),
style:
TextStyle
(
fontSize:
10.0
),
children:
<
TextSpan
>[
children:
<
TextSpan
>[
TextSpan
(
TextSpan
(
text:
'hello'
,
// width 50
text:
'hello'
,
// width 50
),
),
TextSpan
(
TextSpan
(
text:
'lovely'
,
// width 120
text:
'lovely'
,
// width 120
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
20.0
),
style:
TextStyle
(
fontSize:
20.0
),
),
),
TextSpan
(
TextSpan
(
text:
'world'
,
// width 50
text:
'world'
,
// width 50
...
@@ -368,14 +368,14 @@ void main() {
...
@@ -368,14 +368,14 @@ void main() {
..
textDirection
=
TextDirection
.
ltr
;
..
textDirection
=
TextDirection
.
ltr
;
painter
.
text
=
const
TextSpan
(
painter
.
text
=
const
TextSpan
(
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
),
style:
TextStyle
(
fontSize:
10.0
),
children:
<
TextSpan
>[
children:
<
TextSpan
>[
TextSpan
(
TextSpan
(
text:
'hello'
,
// width 50
text:
'hello'
,
// width 50
),
),
TextSpan
(
TextSpan
(
text:
'
\
u062C
\
u0645
\
u064A
\
u0644'
,
// width 80
text:
'
\
u062C
\
u0645
\
u064A
\
u0644'
,
// width 80
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
20.0
),
style:
TextStyle
(
fontSize:
20.0
),
),
),
TextSpan
(
TextSpan
(
text:
'world'
,
// width 50
text:
'world'
,
// width 50
...
@@ -425,14 +425,14 @@ void main() {
...
@@ -425,14 +425,14 @@ void main() {
..
textDirection
=
TextDirection
.
rtl
;
..
textDirection
=
TextDirection
.
rtl
;
painter
.
text
=
const
TextSpan
(
painter
.
text
=
const
TextSpan
(
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
),
style:
TextStyle
(
fontSize:
10.0
),
children:
<
TextSpan
>[
children:
<
TextSpan
>[
TextSpan
(
TextSpan
(
text:
'hello'
,
// width 50
text:
'hello'
,
// width 50
),
),
TextSpan
(
TextSpan
(
text:
'
\
u062C
\
u0645
\
u064A
\
u0644'
,
// width 80
text:
'
\
u062C
\
u0645
\
u064A
\
u0644'
,
// width 80
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
20.0
),
style:
TextStyle
(
fontSize:
20.0
),
),
),
TextSpan
(
TextSpan
(
text:
'world'
,
// width 50
text:
'world'
,
// width 50
...
@@ -463,7 +463,7 @@ void main() {
...
@@ -463,7 +463,7 @@ void main() {
final
String
pyramid
=
rlo
(
lro
(
rlo
(
lro
(
rlo
(
''
)))));
final
String
pyramid
=
rlo
(
lro
(
rlo
(
lro
(
rlo
(
''
)))));
painter
.
text
=
TextSpan
(
painter
.
text
=
TextSpan
(
text:
pyramid
,
text:
pyramid
,
style:
const
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
),
style:
const
TextStyle
(
fontSize:
10.0
),
);
);
painter
.
layout
();
painter
.
layout
();
...
@@ -494,7 +494,7 @@ void main() {
...
@@ -494,7 +494,7 @@ void main() {
painter
.
text
=
const
TextSpan
(
painter
.
text
=
const
TextSpan
(
text:
'ABC
\
u05D0
\
u05D1
\
u05D2DEF'
,
// A B C Alef Bet Gimel D E F -- but the Hebrew letters are RTL
text:
'ABC
\
u05D0
\
u05D1
\
u05D2DEF'
,
// A B C Alef Bet Gimel D E F -- but the Hebrew letters are RTL
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
),
style:
TextStyle
(
fontSize:
10.0
),
);
);
painter
.
layout
();
painter
.
layout
();
...
@@ -578,7 +578,7 @@ void main() {
...
@@ -578,7 +578,7 @@ void main() {
painter
.
text
=
const
TextSpan
(
painter
.
text
=
const
TextSpan
(
text:
'
\
u05D0
\
u05D1
\
u05D2ABC
\
u05D3
\
u05D4
\
u05D5'
,
text:
'
\
u05D0
\
u05D1
\
u05D2ABC
\
u05D3
\
u05D4
\
u05D5'
,
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
),
style:
TextStyle
(
fontSize:
10.0
),
);
);
painter
.
layout
();
painter
.
layout
();
...
@@ -624,7 +624,7 @@ void main() {
...
@@ -624,7 +624,7 @@ void main() {
painter
.
text
=
const
TextSpan
(
painter
.
text
=
const
TextSpan
(
text:
' '
,
text:
' '
,
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
100.0
),
style:
TextStyle
(
fontSize:
100.0
),
children:
<
TextSpan
>[
children:
<
TextSpan
>[
TextSpan
(
TextSpan
(
text:
' '
,
text:
' '
,
...
@@ -685,10 +685,10 @@ void main() {
...
@@ -685,10 +685,10 @@ void main() {
..
textDirection
=
TextDirection
.
ltr
;
..
textDirection
=
TextDirection
.
ltr
;
painter
.
text
=
const
TextSpan
(
painter
.
text
=
const
TextSpan
(
text:
''
,
text:
''
,
style:
TextStyle
(
fontFamily:
'
Ahem
'
,
fontSize:
100.0
,
height:
1.0
),
style:
TextStyle
(
fontFamily:
'
FlutterTest
'
,
fontSize:
100.0
,
height:
1.0
),
);
);
painter
.
layout
();
painter
.
layout
();
expect
(
painter
.
computeDistanceToActualBaseline
(
TextBaseline
.
alphabetic
),
moreOrLessEquals
(
80.0
,
epsilon:
0.001
)
);
expect
(
painter
.
computeDistanceToActualBaseline
(
TextBaseline
.
alphabetic
),
75.0
);
painter
.
dispose
();
painter
.
dispose
();
});
});
}
}
...
...
packages/flutter/test/painting/text_painter_test.dart
View file @
9f69a367
...
@@ -199,11 +199,7 @@ void main() {
...
@@ -199,11 +199,7 @@ void main() {
final
TextPainter
painter
=
TextPainter
(
final
TextPainter
painter
=
TextPainter
(
text:
const
TextSpan
(
text:
const
TextSpan
(
text:
'X'
,
text:
'X'
,
style:
TextStyle
(
style:
TextStyle
(
inherit:
false
,
fontSize:
123.0
),
inherit:
false
,
fontFamily:
'Ahem'
,
fontSize:
123.0
,
),
),
),
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
);
);
...
@@ -216,11 +212,7 @@ void main() {
...
@@ -216,11 +212,7 @@ void main() {
final
TextPainter
painter
=
TextPainter
(
final
TextPainter
painter
=
TextPainter
(
text:
const
TextSpan
(
text:
const
TextSpan
(
text:
'X'
,
text:
'X'
,
style:
TextStyle
(
style:
TextStyle
(
inherit:
false
,
fontSize:
10.0
),
inherit:
false
,
fontFamily:
'Ahem'
,
fontSize:
10.0
,
),
),
),
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
textScaleFactor:
2.0
,
textScaleFactor:
2.0
,
...
@@ -268,7 +260,6 @@ void main() {
...
@@ -268,7 +260,6 @@ void main() {
test
(
'TextPainter intrinsic dimensions'
,
()
{
test
(
'TextPainter intrinsic dimensions'
,
()
{
const
TextStyle
style
=
TextStyle
(
const
TextStyle
style
=
TextStyle
(
inherit:
false
,
inherit:
false
,
fontFamily:
'Ahem'
,
fontSize:
10.0
,
fontSize:
10.0
,
);
);
TextPainter
painter
;
TextPainter
painter
;
...
...
packages/flutter/test/rendering/editable_gesture_test.dart
View file @
9f69a367
...
@@ -21,9 +21,7 @@ void main() {
...
@@ -21,9 +21,7 @@ void main() {
textSelectionDelegate:
delegate
,
textSelectionDelegate:
delegate
,
text:
const
TextSpan
(
text:
const
TextSpan
(
text:
'test'
,
text:
'test'
,
style:
TextStyle
(
style:
TextStyle
(
height:
1.0
,
fontSize:
10.0
),
height:
1.0
,
fontSize:
10.0
,
fontFamily:
'Ahem'
,
),
),
),
startHandleLayerLink:
LayerLink
(),
startHandleLayerLink:
LayerLink
(),
endHandleLayerLink:
LayerLink
(),
endHandleLayerLink:
LayerLink
(),
...
...
packages/flutter/test/rendering/editable_test.dart
View file @
9f69a367
This diff is collapsed.
Click to expand it.
packages/flutter/test/rendering/paragraph_test.dart
View file @
9f69a367
...
@@ -148,7 +148,7 @@ void main() {
...
@@ -148,7 +148,7 @@ void main() {
final
RenderParagraph
paragraph
=
RenderParagraph
(
final
RenderParagraph
paragraph
=
RenderParagraph
(
const
TextSpan
(
const
TextSpan
(
text:
'First '
,
text:
'First '
,
style:
TextStyle
(
fontFamily:
'
Ahem
'
,
fontSize:
10.0
),
style:
TextStyle
(
fontFamily:
'
FlutterTest
'
,
fontSize:
10.0
),
children:
<
InlineSpan
>[
children:
<
InlineSpan
>[
TextSpan
(
text:
'smallsecond '
,
style:
TextStyle
(
fontSize:
5.0
)),
TextSpan
(
text:
'smallsecond '
,
style:
TextStyle
(
fontSize:
5.0
)),
TextSpan
(
text:
'third fourth fifth'
),
TextSpan
(
text:
'third fourth fifth'
),
...
@@ -175,14 +175,14 @@ void main() {
...
@@ -175,14 +175,14 @@ void main() {
// The widths of the boxes should match the calculations above.
// The widths of the boxes should match the calculations above.
// The heights should all be 10, except for the box for 'smallsecond ',
// The heights should all be 10, except for the box for 'smallsecond ',
// which should have height 5, and be alphabetic baseline-aligned with
// which should have height 5, and be alphabetic baseline-aligned with
// 'First '. The
Ahem font specifies alphabetic baselines at 0.2em above th
e
// 'First '. The
test font specifies alphabetic baselines at 0.25em abov
e
//
bottom extent, and 0.8
em below the top, so the difference in top
//
the bottom extent, and 0.75
em below the top, so the difference in top
// alignment becomes (10px * 0.
8 - 5px * 0.8) = 4
px.
// alignment becomes (10px * 0.
75 - 5px * 0.75) = 3.75
px.
// 'First ':
// 'First ':
expect
(
boxes
[
0
],
const
TextBox
.
fromLTRBD
(
0.0
,
0.0
,
60.0
,
10.0
,
TextDirection
.
ltr
));
expect
(
boxes
[
0
],
const
TextBox
.
fromLTRBD
(
0.0
,
0.0
,
60.0
,
10.0
,
TextDirection
.
ltr
));
// 'smallsecond ' in size 5:
// 'smallsecond ' in size 5:
expect
(
boxes
[
1
],
const
TextBox
.
fromLTRBD
(
60.0
,
4.0
,
120.0
,
9.0
,
TextDirection
.
ltr
));
expect
(
boxes
[
1
],
const
TextBox
.
fromLTRBD
(
60.0
,
3.75
,
120.0
,
8.75
,
TextDirection
.
ltr
));
// 'third fourth ':
// 'third fourth ':
expect
(
boxes
[
2
],
const
TextBox
.
fromLTRBD
(
0.0
,
10.0
,
130.0
,
20.0
,
TextDirection
.
ltr
));
expect
(
boxes
[
2
],
const
TextBox
.
fromLTRBD
(
0.0
,
10.0
,
130.0
,
20.0
,
TextDirection
.
ltr
));
// 'fifth':
// 'fifth':
...
@@ -193,7 +193,7 @@ void main() {
...
@@ -193,7 +193,7 @@ void main() {
final
RenderParagraph
paragraph
=
RenderParagraph
(
final
RenderParagraph
paragraph
=
RenderParagraph
(
const
TextSpan
(
const
TextSpan
(
text:
'First '
,
text:
'First '
,
style:
TextStyle
(
fontFamily:
'
Ahem
'
,
fontSize:
10.0
),
style:
TextStyle
(
fontFamily:
'
FlutterTest
'
,
fontSize:
10.0
),
children:
<
InlineSpan
>[
children:
<
InlineSpan
>[
TextSpan
(
text:
'smallsecond '
,
style:
TextStyle
(
fontSize:
8.0
)),
TextSpan
(
text:
'smallsecond '
,
style:
TextStyle
(
fontSize:
8.0
)),
TextSpan
(
text:
'third fourth fifth'
),
TextSpan
(
text:
'third fourth fifth'
),
...
@@ -253,7 +253,7 @@ void main() {
...
@@ -253,7 +253,7 @@ void main() {
const
TextSpan
(
const
TextSpan
(
text:
'This
\n
'
// 4 characters * 10px font size = 40px width on the first line
text:
'This
\n
'
// 4 characters * 10px font size = 40px width on the first line
'is a wrapping test. It should wrap at manual newlines, and if softWrap is true, also at spaces.'
,
'is a wrapping test. It should wrap at manual newlines, and if softWrap is true, also at spaces.'
,
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
),
style:
TextStyle
(
fontSize:
10.0
),
),
),
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
maxLines:
1
,
maxLines:
1
,
...
@@ -333,7 +333,7 @@ void main() {
...
@@ -333,7 +333,7 @@ void main() {
text:
"How do you write like you're running out of time? Write day and night like you're running out of time?"
,
text:
"How do you write like you're running out of time? Write day and night like you're running out of time?"
,
// 0123456789 0123456789 012 345 0123456 012345 01234 012345678 012345678 0123 012 345 0123456 012345 01234
// 0123456789 0123456789 012 345 0123456 012345 01234 012345678 012345678 0123 012 345 0123456 012345 01234
// 0 1 2 3 4 5 6 7 8 9 10 11 12
// 0 1 2 3 4 5 6 7 8 9 10 11 12
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
),
style:
TextStyle
(
fontSize:
10.0
),
),
),
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
);
);
...
...
packages/flutter/test/widgets/baseline_test.dart
View file @
9f69a367
...
@@ -11,7 +11,6 @@ void main() {
...
@@ -11,7 +11,6 @@ void main() {
const
Center
(
const
Center
(
child:
DefaultTextStyle
(
child:
DefaultTextStyle
(
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
'Ahem'
,
fontSize:
100.0
,
fontSize:
100.0
,
),
),
child:
Text
(
'X'
,
textDirection:
TextDirection
.
ltr
),
child:
Text
(
'X'
,
textDirection:
TextDirection
.
ltr
),
...
@@ -25,11 +24,11 @@ void main() {
...
@@ -25,11 +24,11 @@ void main() {
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
const
Center
(
const
Center
(
child:
Baseline
(
child:
Baseline
(
baseline:
1
80
.0
,
baseline:
1
75
.0
,
baselineType:
TextBaseline
.
alphabetic
,
baselineType:
TextBaseline
.
alphabetic
,
child:
DefaultTextStyle
(
child:
DefaultTextStyle
(
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
'
Ahem
'
,
fontFamily:
'
FlutterTest
'
,
fontSize:
100.0
,
fontSize:
100.0
,
),
),
child:
Text
(
'X'
,
textDirection:
TextDirection
.
ltr
),
child:
Text
(
'X'
,
textDirection:
TextDirection
.
ltr
),
...
@@ -40,7 +39,7 @@ void main() {
...
@@ -40,7 +39,7 @@ void main() {
expect
(
tester
.
renderObject
<
RenderBox
>(
find
.
text
(
'X'
)).
size
,
const
Size
(
100.0
,
100.0
));
expect
(
tester
.
renderObject
<
RenderBox
>(
find
.
text
(
'X'
)).
size
,
const
Size
(
100.0
,
100.0
));
expect
(
expect
(
tester
.
renderObject
<
RenderBox
>(
find
.
byType
(
Baseline
)).
size
,
tester
.
renderObject
<
RenderBox
>(
find
.
byType
(
Baseline
)).
size
,
within
<
Size
>(
from:
const
Size
(
100.0
,
200.0
),
distance:
0.001
),
const
Size
(
100.0
,
200
),
);
);
});
});
...
...
packages/flutter/test/widgets/basic_test.dart
View file @
9f69a367
...
@@ -466,11 +466,11 @@ void main() {
...
@@ -466,11 +466,11 @@ void main() {
children:
<
Widget
>[
children:
<
Widget
>[
Text
(
'big text'
,
Text
(
'big text'
,
key:
key1
,
key:
key1
,
style:
const
TextStyle
(
fontSize:
fontSize1
),
style:
const
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
fontSize1
),
),
),
Text
(
'one
\n
two
\n
three
\n
four
\n
five
\n
six
\n
seven'
,
Text
(
'one
\n
two
\n
three
\n
four
\n
five
\n
six
\n
seven'
,
key:
key2
,
key:
key2
,
style:
const
TextStyle
(
fontSize:
fontSize2
),
style:
const
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
fontSize2
),
),
),
],
],
),
),
...
@@ -488,21 +488,18 @@ void main() {
...
@@ -488,21 +488,18 @@ void main() {
// lines, but being aligned by the first line's baseline, they hang far
// lines, but being aligned by the first line's baseline, they hang far
// below the baseline. The size of the parent row is just enough to
// below the baseline. The size of the parent row is just enough to
// contain both of them.
// contain both of them.
const
double
a
hemBaselineLocation
=
0.8
;
// https://web-platform-tests.org/writing-tests/ahem.html
const
double
a
scentRatio
=
0.75
;
const
double
aboveBaseline1
=
fontSize1
*
a
hemBaselineLocation
;
const
double
aboveBaseline1
=
fontSize1
*
a
scentRatio
;
const
double
belowBaseline1
=
fontSize1
*
(
1
-
a
hemBaselineLocation
);
const
double
belowBaseline1
=
fontSize1
*
(
1
-
a
scentRatio
);
const
double
aboveBaseline2
=
fontSize2
*
a
hemBaselineLocation
;
const
double
aboveBaseline2
=
fontSize2
*
a
scentRatio
;
const
double
belowBaseline2
=
fontSize2
*
(
1
-
a
hemBaselineLocation
)
+
fontSize2
*
6
;
const
double
belowBaseline2
=
fontSize2
*
(
1
-
a
scentRatio
)
+
fontSize2
*
6
;
final
double
aboveBaseline
=
math
.
max
(
aboveBaseline1
,
aboveBaseline2
);
final
double
aboveBaseline
=
math
.
max
(
aboveBaseline1
,
aboveBaseline2
);
final
double
belowBaseline
=
math
.
max
(
belowBaseline1
,
belowBaseline2
);
final
double
belowBaseline
=
math
.
max
(
belowBaseline1
,
belowBaseline2
);
expect
(
rowBox
.
size
.
height
,
greaterThan
(
textBox1
.
size
.
height
));
expect
(
rowBox
.
size
.
height
,
greaterThan
(
textBox1
.
size
.
height
));
expect
(
rowBox
.
size
.
height
,
greaterThan
(
textBox2
.
size
.
height
));
expect
(
rowBox
.
size
.
height
,
greaterThan
(
textBox2
.
size
.
height
));
expect
(
rowBox
.
size
.
height
,
moreOrLessEquals
(
aboveBaseline
+
belowBaseline
,
epsilon:
.
001
)
);
expect
(
rowBox
.
size
.
height
,
aboveBaseline
+
belowBaseline
,
);
expect
(
tester
.
getTopLeft
(
find
.
byKey
(
key1
)).
dy
,
0
);
expect
(
tester
.
getTopLeft
(
find
.
byKey
(
key1
)).
dy
,
0
);
expect
(
expect
(
tester
.
getTopLeft
(
find
.
byKey
(
key2
)).
dy
,
aboveBaseline1
-
aboveBaseline2
);
tester
.
getTopLeft
(
find
.
byKey
(
key2
)).
dy
,
moreOrLessEquals
(
aboveBaseline1
-
aboveBaseline2
,
epsilon:
.
001
),
);
});
});
testWidgets
(
'baseline aligned children account for a larger, no-baseline child size'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'baseline aligned children account for a larger, no-baseline child size'
,
(
WidgetTester
tester
)
async
{
...
@@ -521,11 +518,11 @@ void main() {
...
@@ -521,11 +518,11 @@ void main() {
children:
<
Widget
>[
children:
<
Widget
>[
Text
(
'big text'
,
Text
(
'big text'
,
key:
key1
,
key:
key1
,
style:
const
TextStyle
(
fontSize:
fontSize1
),
style:
const
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
fontSize1
),
),
),
Text
(
'one
\n
two
\n
three
\n
four
\n
five
\n
six
\n
seven'
,
Text
(
'one
\n
two
\n
three
\n
four
\n
five
\n
six
\n
seven'
,
key:
key2
,
key:
key2
,
style:
const
TextStyle
(
fontSize:
fontSize2
),
style:
const
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
fontSize2
),
),
),
const
FlutterLogo
(
size:
250
),
const
FlutterLogo
(
size:
250
),
],
],
...
@@ -544,16 +541,16 @@ void main() {
...
@@ -544,16 +541,16 @@ void main() {
// lines, but being aligned by the first line's baseline, they hang far
// lines, but being aligned by the first line's baseline, they hang far
// below the baseline. The FlutterLogo extends further than both Texts,
// below the baseline. The FlutterLogo extends further than both Texts,
// so the size of the parent row should contain the FlutterLogo as well.
// so the size of the parent row should contain the FlutterLogo as well.
const
double
a
hemBaselineLocation
=
0.8
;
// https://web-platform-tests.org/writing-tests/ahem.html
const
double
a
scentRatio
=
0.75
;
const
double
aboveBaseline1
=
fontSize1
*
a
hemBaselineLocation
;
const
double
aboveBaseline1
=
fontSize1
*
a
scentRatio
;
const
double
aboveBaseline2
=
fontSize2
*
a
hemBaselineLocation
;
const
double
aboveBaseline2
=
fontSize2
*
a
scentRatio
;
expect
(
rowBox
.
size
.
height
,
greaterThan
(
textBox1
.
size
.
height
));
expect
(
rowBox
.
size
.
height
,
greaterThan
(
textBox1
.
size
.
height
));
expect
(
rowBox
.
size
.
height
,
greaterThan
(
textBox2
.
size
.
height
));
expect
(
rowBox
.
size
.
height
,
greaterThan
(
textBox2
.
size
.
height
));
expect
(
rowBox
.
size
.
height
,
250
);
expect
(
rowBox
.
size
.
height
,
250
);
expect
(
tester
.
getTopLeft
(
find
.
byKey
(
key1
)).
dy
,
0
);
expect
(
tester
.
getTopLeft
(
find
.
byKey
(
key1
)).
dy
,
0
);
expect
(
expect
(
tester
.
getTopLeft
(
find
.
byKey
(
key2
)).
dy
,
tester
.
getTopLeft
(
find
.
byKey
(
key2
)).
dy
,
moreOrLessEquals
(
aboveBaseline1
-
aboveBaseline2
,
epsilon:
.
001
)
,
aboveBaseline1
-
aboveBaseline2
,
);
);
});
});
});
});
...
...
packages/flutter/test/widgets/default_colors_test.dart
View file @
9f69a367
...
@@ -9,7 +9,7 @@ import 'package:flutter/material.dart';
...
@@ -9,7 +9,7 @@ import 'package:flutter/material.dart';
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
const
double
_crispText
=
100.0
;
// this font size is selected to avoid needing any antialiasing.
const
double
_crispText
=
100.0
;
// this font size is selected to avoid needing any antialiasing.
const
String
_expText
=
'Éxp'
;
// renders in
Ahem
as:
const
String
_expText
=
'Éxp'
;
// renders in
the test font
as:
// ########
// ########
// ########
// ########
...
...
packages/flutter/test/widgets/scrollable_fling_test.dart
View file @
9f69a367
...
@@ -8,7 +8,6 @@ import 'package:flutter_test/flutter_test.dart';
...
@@ -8,7 +8,6 @@ import 'package:flutter_test/flutter_test.dart';
const
TextStyle
testFont
=
TextStyle
(
const
TextStyle
testFont
=
TextStyle
(
color:
Color
(
0xFF00FF00
),
color:
Color
(
0xFF00FF00
),
fontFamily:
'Ahem'
,
);
);
Future
<
void
>
pumpTest
(
WidgetTester
tester
,
TargetPlatform
platform
)
async
{
Future
<
void
>
pumpTest
(
WidgetTester
tester
,
TargetPlatform
platform
)
async
{
...
...
packages/flutter/test/widgets/selectable_text_test.dart
View file @
9f69a367
...
@@ -797,7 +797,7 @@ void main() {
...
@@ -797,7 +797,7 @@ void main() {
child:
SelectableText
(
child:
SelectableText
(
'abc def ghi'
,
'abc def ghi'
,
dragStartBehavior:
DragStartBehavior
.
down
,
dragStartBehavior:
DragStartBehavior
.
down
,
style:
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
10.0
),
style:
TextStyle
(
fontSize:
10.0
),
),
),
),
),
),
),
...
@@ -2071,19 +2071,19 @@ void main() {
...
@@ -2071,19 +2071,19 @@ void main() {
child:
SelectableText
(
child:
SelectableText
(
'A'
,
'A'
,
key:
keyA
,
key:
keyA
,
style:
const
TextStyle
(
fontSize:
10.0
),
style:
const
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
10.0
),
strutStyle:
StrutStyle
.
disabled
,
strutStyle:
StrutStyle
.
disabled
,
),
),
),
),
const
Text
(
const
Text
(
'abc'
,
'abc'
,
style:
TextStyle
(
fontSize:
20.0
),
style:
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
20.0
),
),
),
Expanded
(
Expanded
(
child:
SelectableText
(
child:
SelectableText
(
'B'
,
'B'
,
key:
keyB
,
key:
keyB
,
style:
const
TextStyle
(
fontSize:
30.0
),
style:
const
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
30.0
),
strutStyle:
StrutStyle
.
disabled
,
strutStyle:
StrutStyle
.
disabled
,
),
),
),
),
...
@@ -2092,17 +2092,17 @@ void main() {
...
@@ -2092,17 +2092,17 @@ void main() {
),
),
);
);
// The
Ahem font extends 0.2
* fontSize below the baseline.
// The
test font extends 0.25
* fontSize below the baseline.
// So the three row elements line up like this:
// So the three row elements line up like this:
//
//
// A abc B
// A
abc B
// ---------
baseline
// ---------
----
baseline
// 2
4 6 space below the baseline = 0.2
* fontSize
// 2
.5 5 7.5 space below the baseline = 0.25
* fontSize
// ---------
rowBottomY
// ---------
----
rowBottomY
final
double
rowBottomY
=
tester
.
getBottomLeft
(
find
.
byType
(
Row
)).
dy
;
final
double
rowBottomY
=
tester
.
getBottomLeft
(
find
.
byType
(
Row
)).
dy
;
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyA
)).
dy
,
moreOrLessEquals
(
rowBottomY
-
4.0
,
epsilon:
1
e
-
3
)
);
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyA
)).
dy
,
rowBottomY
-
5.0
);
expect
(
tester
.
getBottomLeft
(
find
.
text
(
'abc'
)).
dy
,
moreOrLessEquals
(
rowBottomY
-
2.0
,
epsilon:
1
e
-
3
)
);
expect
(
tester
.
getBottomLeft
(
find
.
text
(
'abc'
)).
dy
,
rowBottomY
-
2.5
);
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyB
)).
dy
,
rowBottomY
);
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyB
)).
dy
,
rowBottomY
);
});
});
...
@@ -2120,18 +2120,18 @@ void main() {
...
@@ -2120,18 +2120,18 @@ void main() {
child:
SelectableText
(
child:
SelectableText
(
'A'
,
'A'
,
key:
keyA
,
key:
keyA
,
style:
const
TextStyle
(
fontSize:
10.0
),
style:
const
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
10.0
),
),
),
),
),
const
Text
(
const
Text
(
'abc'
,
'abc'
,
style:
TextStyle
(
fontSize:
20.0
),
style:
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
20.0
),
),
),
Expanded
(
Expanded
(
child:
SelectableText
(
child:
SelectableText
(
'B'
,
'B'
,
key:
keyB
,
key:
keyB
,
style:
const
TextStyle
(
fontSize:
30.0
),
style:
const
TextStyle
(
font
Family:
'FlutterTest'
,
font
Size:
30.0
),
),
),
),
),
],
],
...
@@ -2139,17 +2139,17 @@ void main() {
...
@@ -2139,17 +2139,17 @@ void main() {
),
),
);
);
// The
Ahem font extends 0.2
* fontSize below the baseline.
// The
test font extends 0.25
* fontSize below the baseline.
// So the three row elements line up like this:
// So the three row elements line up like this:
//
//
// A abc B
// A
abc B
// ---------
baseline
// ---------
----
baseline
// 2
4 6 space below the baseline = 0.2
* fontSize
// 2
.5 5 7.5 space below the baseline = 0.25
* fontSize
// ---------
rowBottomY
// ---------
----
rowBottomY
final
double
rowBottomY
=
tester
.
getBottomLeft
(
find
.
byType
(
Row
)).
dy
;
final
double
rowBottomY
=
tester
.
getBottomLeft
(
find
.
byType
(
Row
)).
dy
;
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyA
)).
dy
,
moreOrLessEquals
(
rowBottomY
-
4.0
,
epsilon:
1
e
-
3
)
);
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyA
)).
dy
,
rowBottomY
-
5.0
);
expect
(
tester
.
getBottomLeft
(
find
.
text
(
'abc'
)).
dy
,
moreOrLessEquals
(
rowBottomY
-
2.0
,
epsilon:
1
e
-
3
)
);
expect
(
tester
.
getBottomLeft
(
find
.
text
(
'abc'
)).
dy
,
rowBottomY
-
2.5
);
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyB
)).
dy
,
rowBottomY
);
expect
(
tester
.
getBottomLeft
(
find
.
byKey
(
keyB
)).
dy
,
rowBottomY
);
});
});
...
@@ -2445,7 +2445,7 @@ void main() {
...
@@ -2445,7 +2445,7 @@ void main() {
testWidgets
(
'semantic nodes of offscreen recognizers are marked hidden'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'semantic nodes of offscreen recognizers are marked hidden'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/100395.
// Regression test for https://github.com/flutter/flutter/issues/100395.
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
const
TextStyle
textStyle
=
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
200
);
const
TextStyle
textStyle
=
TextStyle
(
fontSize:
200
);
const
String
onScreenText
=
'onscreen
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
'
;
const
String
onScreenText
=
'onscreen
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
'
;
const
String
offScreenText
=
'off screen'
;
const
String
offScreenText
=
'off screen'
;
final
ScrollController
controller
=
ScrollController
();
final
ScrollController
controller
=
ScrollController
();
...
...
packages/flutter/test/widgets/semantics_tester_test.dart
View file @
9f69a367
...
@@ -11,7 +11,7 @@ import 'semantics_tester.dart';
...
@@ -11,7 +11,7 @@ import 'semantics_tester.dart';
void
main
(
)
{
void
main
(
)
{
testWidgets
(
'Semantics tester visits last child'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Semantics tester visits last child'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
const
TextStyle
textStyle
=
TextStyle
(
fontFamily:
'Ahem'
);
const
TextStyle
textStyle
=
TextStyle
();
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
Text
.
rich
(
Text
.
rich
(
TextSpan
(
TextSpan
(
...
...
packages/flutter/test/widgets/text_selection_test.dart
View file @
9f69a367
...
@@ -1662,7 +1662,7 @@ class FakeEditable extends LeafRenderObjectWidget {
...
@@ -1662,7 +1662,7 @@ class FakeEditable extends LeafRenderObjectWidget {
class
FakeRenderEditable
extends
RenderEditable
{
class
FakeRenderEditable
extends
RenderEditable
{
FakeRenderEditable
(
EditableTextState
delegate
)
:
super
(
FakeRenderEditable
(
EditableTextState
delegate
)
:
super
(
text:
const
TextSpan
(
text:
const
TextSpan
(
style:
TextStyle
(
height:
1.0
,
fontSize:
10.0
,
fontFamily:
'Ahem'
),
style:
TextStyle
(
height:
1.0
,
fontSize:
10.0
),
text:
'placeholder'
,
text:
'placeholder'
,
),
),
startHandleLayerLink:
LayerLink
(),
startHandleLayerLink:
LayerLink
(),
...
...
packages/flutter/test/widgets/text_test.dart
View file @
9f69a367
...
@@ -135,7 +135,7 @@ void main() {
...
@@ -135,7 +135,7 @@ void main() {
testWidgets
(
'inline widgets works with ellipsis'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'inline widgets works with ellipsis'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/35869
// Regression test for https://github.com/flutter/flutter/issues/35869
const
TextStyle
textStyle
=
TextStyle
(
fontFamily:
'Ahem'
);
const
TextStyle
textStyle
=
TextStyle
();
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
Text
.
rich
(
Text
.
rich
(
TextSpan
(
TextSpan
(
...
@@ -168,7 +168,7 @@ void main() {
...
@@ -168,7 +168,7 @@ void main() {
testWidgets
(
'inline widgets hitTest works with ellipsis'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'inline widgets hitTest works with ellipsis'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/68559
// Regression test for https://github.com/flutter/flutter/issues/68559
const
TextStyle
textStyle
=
TextStyle
(
fontFamily:
'Ahem'
);
const
TextStyle
textStyle
=
TextStyle
();
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
Text
.
rich
(
Text
.
rich
(
TextSpan
(
TextSpan
(
...
@@ -514,7 +514,7 @@ void main() {
...
@@ -514,7 +514,7 @@ void main() {
testWidgets
(
'recognizers split semantic node'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'recognizers split semantic node'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
const
TextStyle
textStyle
=
TextStyle
(
fontFamily:
'Ahem'
);
const
TextStyle
textStyle
=
TextStyle
();
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
Text
.
rich
(
Text
.
rich
(
TextSpan
(
TextSpan
(
...
@@ -569,7 +569,7 @@ void main() {
...
@@ -569,7 +569,7 @@ void main() {
testWidgets
(
'semantic nodes of offscreen recognizers are marked hidden'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'semantic nodes of offscreen recognizers are marked hidden'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/100395.
// Regression test for https://github.com/flutter/flutter/issues/100395.
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
const
TextStyle
textStyle
=
TextStyle
(
font
Family:
'Ahem'
,
font
Size:
200
);
const
TextStyle
textStyle
=
TextStyle
(
fontSize:
200
);
const
String
onScreenText
=
'onscreen
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
'
;
const
String
onScreenText
=
'onscreen
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
'
;
const
String
offScreenText
=
'off screen'
;
const
String
offScreenText
=
'off screen'
;
final
ScrollController
controller
=
ScrollController
();
final
ScrollController
controller
=
ScrollController
();
...
@@ -637,7 +637,7 @@ void main() {
...
@@ -637,7 +637,7 @@ void main() {
testWidgets
(
'recognizers split semantic node when TextSpan overflows'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'recognizers split semantic node when TextSpan overflows'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
const
TextStyle
textStyle
=
TextStyle
(
fontFamily:
'Ahem'
);
const
TextStyle
textStyle
=
TextStyle
();
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
SizedBox
(
SizedBox
(
height:
10
,
height:
10
,
...
@@ -688,7 +688,7 @@ void main() {
...
@@ -688,7 +688,7 @@ void main() {
testWidgets
(
'recognizers split semantic nodes with text span labels'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'recognizers split semantic nodes with text span labels'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
const
TextStyle
textStyle
=
TextStyle
(
fontFamily:
'Ahem'
);
const
TextStyle
textStyle
=
TextStyle
();
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
Text
.
rich
(
Text
.
rich
(
TextSpan
(
TextSpan
(
...
@@ -746,7 +746,7 @@ void main() {
...
@@ -746,7 +746,7 @@ void main() {
testWidgets
(
'recognizers split semantic node - bidi'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'recognizers split semantic node - bidi'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
const
TextStyle
textStyle
=
TextStyle
(
fontFamily:
'Ahem'
);
const
TextStyle
textStyle
=
TextStyle
();
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
RichText
(
RichText
(
text:
TextSpan
(
text:
TextSpan
(
...
@@ -827,7 +827,7 @@ void main() {
...
@@ -827,7 +827,7 @@ void main() {
testWidgets
(
'TapGesture recognizers contribute link semantics'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'TapGesture recognizers contribute link semantics'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
const
TextStyle
textStyle
=
TextStyle
(
fontFamily:
'Ahem'
);
const
TextStyle
textStyle
=
TextStyle
();
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
Text
.
rich
(
Text
.
rich
(
TextSpan
(
TextSpan
(
...
@@ -867,7 +867,7 @@ void main() {
...
@@ -867,7 +867,7 @@ void main() {
testWidgets
(
'inline widgets generate semantic nodes'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'inline widgets generate semantic nodes'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
const
TextStyle
textStyle
=
TextStyle
(
fontFamily:
'Ahem'
);
const
TextStyle
textStyle
=
TextStyle
();
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
Text
.
rich
(
Text
.
rich
(
TextSpan
(
TextSpan
(
...
@@ -941,7 +941,7 @@ void main() {
...
@@ -941,7 +941,7 @@ void main() {
testWidgets
(
'inline widgets semantic nodes scale'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'inline widgets semantic nodes scale'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
const
TextStyle
textStyle
=
TextStyle
(
fontFamily:
'Ahem'
);
const
TextStyle
textStyle
=
TextStyle
();
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
Text
.
rich
(
Text
.
rich
(
TextSpan
(
TextSpan
(
...
...
packages/flutter/test/widgets/wrap_test.dart
View file @
9f69a367
...
@@ -793,11 +793,11 @@ void main() {
...
@@ -793,11 +793,11 @@ void main() {
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
const
Center
(
const
Center
(
child:
Baseline
(
child:
Baseline
(
baseline:
1
80
.0
,
baseline:
1
75
.0
,
baselineType:
TextBaseline
.
alphabetic
,
baselineType:
TextBaseline
.
alphabetic
,
child:
DefaultTextStyle
(
child:
DefaultTextStyle
(
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
'
Ahem
'
,
fontFamily:
'
FlutterTest
'
,
fontSize:
100.0
,
fontSize:
100.0
,
),
),
child:
Wrap
(
child:
Wrap
(
...
@@ -813,7 +813,7 @@ void main() {
...
@@ -813,7 +813,7 @@ void main() {
expect
(
tester
.
renderObject
<
RenderBox
>(
find
.
text
(
'X'
)).
size
,
const
Size
(
100.0
,
100.0
));
expect
(
tester
.
renderObject
<
RenderBox
>(
find
.
text
(
'X'
)).
size
,
const
Size
(
100.0
,
100.0
));
expect
(
expect
(
tester
.
renderObject
<
RenderBox
>(
find
.
byType
(
Baseline
)).
size
,
tester
.
renderObject
<
RenderBox
>(
find
.
byType
(
Baseline
)).
size
,
within
<
Size
>(
from:
const
Size
(
100.0
,
200.0
),
distance:
0.001
),
const
Size
(
100.0
,
200.0
),
);
);
});
});
...
...
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