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
f6eb1295
Unverified
Commit
f6eb1295
authored
Nov 05, 2019
by
Yegor
Committed by
GitHub
Nov 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix text tests on the web (#44021)
parent
7d033716
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
test.dart
dev/bots/test.dart
+1
-1
text_test.dart
packages/flutter/test/widgets/text_test.dart
+17
-7
No files found.
dev/bots/test.dart
View file @
f6eb1295
...
...
@@ -61,8 +61,8 @@ const int kWebBatchSize = 20;
//
// TODO(yjbanov): we're getting rid of this blacklist as part of https://github.com/flutter/flutter/projects/60
const
List
<
String
>
kWebTestFileBlacklist
=
<
String
>[
// This test doesn't compile because it depends on code outside the flutter package.
'test/examples/sector_layout_test.dart'
,
'test/widgets/text_test.dart'
,
'test/widgets/selectable_text_test.dart'
,
'test/widgets/color_filter_test.dart'
,
'test/widgets/editable_text_cursor_test.dart'
,
...
...
packages/flutter/test/widgets/text_test.dart
View file @
f6eb1295
...
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/gestures.dart'
;
...
...
@@ -59,7 +61,7 @@ void main() {
final
Size
largeSize
=
tester
.
getSize
(
find
.
byType
(
RichText
));
expect
(
largeSize
.
width
,
105.0
);
expect
(
largeSize
.
height
,
equals
(
21.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Text respects textScaleFactor with explicit font size'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
Center
(
...
...
@@ -87,7 +89,7 @@ void main() {
final
Size
largeSize
=
tester
.
getSize
(
find
.
byType
(
RichText
));
expect
(
largeSize
.
width
,
anyOf
(
131.0
,
130.0
));
expect
(
largeSize
.
height
,
equals
(
26.0
));
}
,
skip:
isBrowser
);
});
testWidgets
(
'Text throws a nice error message if there
\'
s no Directionality'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
Text
(
'Hello'
));
...
...
@@ -157,7 +159,7 @@ void main() {
),
);
expect
(
tester
.
takeException
(),
null
);
}
);
}
,
skip:
isBrowser
);
// TODO(yjbanov): https://github.com/flutter/flutter/issues/42086
testWidgets
(
'semanticsLabel can override text label'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
...
...
@@ -411,7 +413,7 @@ void main() {
),
);
semantics
.
dispose
();
}
,
skip:
isBrowser
);
});
testWidgets
(
'recognizers split semantic node - bidi'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -602,7 +604,7 @@ void main() {
),
);
semantics
.
dispose
();
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// TODO(yjbanov): https://github.com/flutter/flutter/issues/42086
testWidgets
(
'inline widgets semantic nodes scale'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
...
...
@@ -682,7 +684,7 @@ void main() {
),
);
semantics
.
dispose
();
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// TODO(yjbanov): https://github.com/flutter/flutter/issues/42086
testWidgets
(
'Overflow is clipping correctly - short text with overflow: clip'
,
(
WidgetTester
tester
)
async
{
await
_pumpTextWidget
(
...
...
@@ -797,7 +799,15 @@ void main() {
final
Size
textSizeLongestLine
=
tester
.
getSize
(
find
.
byType
(
Text
));
expect
(
textSizeLongestLine
.
width
,
equals
(
630.0
));
expect
(
textSizeLongestLine
.
height
,
equals
(
fontHeight
*
2
));
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// TODO(yjbanov): https://github.com/flutter/flutter/issues/44020
testWidgets
(
'Paragraph.getBoxesForRange returns nothing when selection range is zero length'
,
(
WidgetTester
tester
)
async
{
final
ui
.
ParagraphBuilder
builder
=
ui
.
ParagraphBuilder
(
ui
.
ParagraphStyle
());
builder
.
addText
(
'hello'
);
final
ui
.
Paragraph
paragraph
=
builder
.
build
();
paragraph
.
layout
(
const
ui
.
ParagraphConstraints
(
width:
1000
));
expect
(
paragraph
.
getBoxesForRange
(
2
,
2
),
isEmpty
);
});
}
Future
<
void
>
_pumpTextWidget
({
WidgetTester
tester
,
String
text
,
TextOverflow
overflow
})
{
...
...
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