Skip to content

Commit 5208082

Browse files
committed
Load the FlutterTest font in the paragraph builder test
The default test environment does not load FlutterTest, so the font fell back to Roboto and the pinned hyphen widths did not match. Force the test fonts, as line_metrics_test does.
1 parent 05b5873 commit 5208082

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎engine/src/flutter/lib/web_ui/test/ui/paragraph_builder_test.dart‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import 'package:test/bootstrap/browser.dart';
66
import 'package:test/test.dart';
77
import 'package:ui/ui.dart';
8+
import 'package:ui/ui_web/src/ui_web.dart' as ui_web;
89

910
import '../common/test_initialization.dart';
1011
import 'utils.dart';
@@ -14,7 +15,11 @@ void main() {
1415
}
1516

1617
Future<void> testMain() async {
17-
setUpUnitTests(withImplicitView: true, setUpTestViewDimensions: false);
18+
setUpUnitTests(
19+
withImplicitView: true,
20+
setUpTestViewDimensions: false,
21+
testEnvironment: const ui_web.TestEnvironment(forceTestFonts: true),
22+
);
1823

1924
test('Should be able to build and layout a paragraph', () {
2025
final builder = ParagraphBuilder(ParagraphStyle());

0 commit comments

Comments
 (0)