@@ -428,10 +428,7 @@ void main() {
428
428
pumpFrame (phase: EnginePhase .compositingBits);
429
429
430
430
expect (editable, paintsExactlyCountTimes (#drawRRect, 0 ));
431
-
432
- // TODO(yjbanov): ahem.ttf doesn't have Chinese glyphs, making this test
433
- // sensitive to browser/OS when running in web mode:
434
- }, skip: kIsWeb); // https://github.com/flutter/flutter/issues/83129
431
+ });
435
432
436
433
test ('text is painted above selection' , () {
437
434
final TextSelectionDelegate delegate = _FakeEditableTextState ();
@@ -810,51 +807,44 @@ void main() {
810
807
expect (editable.hasFocus, false );
811
808
});
812
809
813
- test (
814
- 'has correct maxScrollExtent' ,
815
- () {
816
- final TextSelectionDelegate delegate = _FakeEditableTextState ();
817
- EditableText .debugDeterministicCursor = true ;
810
+ test ('has correct maxScrollExtent' , () {
811
+ final TextSelectionDelegate delegate = _FakeEditableTextState ();
812
+ EditableText .debugDeterministicCursor = true ;
818
813
819
- final RenderEditable editable = RenderEditable (
820
- maxLines: 2 ,
821
- backgroundCursorColor: Colors .grey,
822
- textDirection: TextDirection .ltr,
823
- cursorColor: const Color .fromARGB (0xFF , 0xFF , 0x00 , 0x00 ),
824
- offset: ViewportOffset .zero (),
825
- textSelectionDelegate: delegate,
826
- text: const TextSpan (
827
- text:
828
- '撒地方加咖啡哈金凤凰卡号方式剪坏算法发挥福建垃\n asfjafjajfjaslfjaskjflasjfksajf撒分开建安路口附近拉设\n 计费可使肌肤撒附近埃里克圾房卡设计费"' ,
829
- style: TextStyle (height: 1.0 , fontSize: 10.0 , fontFamily: 'Roboto' ),
830
- ),
831
- startHandleLayerLink: LayerLink (),
832
- endHandleLayerLink: LayerLink (),
833
- selection: const TextSelection .collapsed (offset: 4 , affinity: TextAffinity .upstream),
834
- );
814
+ final RenderEditable editable = RenderEditable (
815
+ maxLines: 2 ,
816
+ backgroundCursorColor: Colors .grey,
817
+ textDirection: TextDirection .ltr,
818
+ cursorColor: const Color .fromARGB (0xFF , 0xFF , 0x00 , 0x00 ),
819
+ offset: ViewportOffset .zero (),
820
+ textSelectionDelegate: delegate,
821
+ text: const TextSpan (
822
+ text:
823
+ '撒地方加咖啡哈金凤凰卡号方式剪坏算法发挥福建垃\n asfjafjajfjaslfjaskjflasjfksajf撒分开建安路口附近拉设\n 计费可使肌肤撒附近埃里克圾房卡设计费"' ,
824
+ style: TextStyle (height: 1.0 , fontSize: 10.0 , fontFamily: 'Roboto' ),
825
+ ),
826
+ startHandleLayerLink: LayerLink (),
827
+ endHandleLayerLink: LayerLink (),
828
+ selection: const TextSelection .collapsed (offset: 4 , affinity: TextAffinity .upstream),
829
+ );
835
830
836
- editable.layout (BoxConstraints .loose (const Size (100.0 , 1000.0 )));
837
- expect (editable.size, equals (const Size (100 , 20 )));
838
- expect (editable.maxLines, equals (2 ));
839
- expect (editable.maxScrollExtent, equals (90 ));
831
+ editable.layout (BoxConstraints .loose (const Size (100.0 , 1000.0 )));
832
+ expect (editable.size, equals (const Size (100 , 20 )));
833
+ expect (editable.maxLines, equals (2 ));
834
+ expect (editable.maxScrollExtent, equals (90 ));
840
835
841
- editable.layout (BoxConstraints .loose (const Size (150.0 , 1000.0 )));
842
- expect (editable.maxScrollExtent, equals (50 ));
836
+ editable.layout (BoxConstraints .loose (const Size (150.0 , 1000.0 )));
837
+ expect (editable.maxScrollExtent, equals (50 ));
843
838
844
- editable.layout (BoxConstraints .loose (const Size (200.0 , 1000.0 )));
845
- expect (editable.maxScrollExtent, equals (40 ));
839
+ editable.layout (BoxConstraints .loose (const Size (200.0 , 1000.0 )));
840
+ expect (editable.maxScrollExtent, equals (40 ));
846
841
847
- editable.layout (BoxConstraints .loose (const Size (500.0 , 1000.0 )));
848
- expect (editable.maxScrollExtent, equals (10 ));
842
+ editable.layout (BoxConstraints .loose (const Size (500.0 , 1000.0 )));
843
+ expect (editable.maxScrollExtent, equals (10 ));
849
844
850
- editable.layout (BoxConstraints .loose (const Size (1000.0 , 1000.0 )));
851
- expect (editable.maxScrollExtent, equals (10 ));
852
- // TODO(yjbanov): This test is failing in the Dart HHH-web bot and
853
- // needs additional investigation before it can be reenabled.
854
- },
855
- // https://github.com/flutter/flutter/issues/93691
856
- skip: const bool .fromEnvironment ('DART_HHH_BOT' ),
857
- );
845
+ editable.layout (BoxConstraints .loose (const Size (1000.0 , 1000.0 )));
846
+ expect (editable.maxScrollExtent, equals (10 ));
847
+ });
858
848
859
849
test ('getEndpointsForSelection handles empty characters' , () {
860
850
final TextSelectionDelegate delegate = _FakeEditableTextState ();
@@ -1505,7 +1495,7 @@ void main() {
1505
1495
final Rect composingRect =
1506
1496
editable.getRectForComposingRange (const TextRange (start: 4 , end: 5 ))! ;
1507
1497
expect (composingRect, const Rect .fromLTRB (40.0 , 0.0 , 54.0 , 14.0 ));
1508
- }, skip : isBrowser); // https://github.com/flutter/flutter/issues/61021
1498
+ });
1509
1499
1510
1500
test ('able to render multiple WidgetSpans' , () async {
1511
1501
final TextSelectionDelegate delegate =
@@ -1550,7 +1540,7 @@ void main() {
1550
1540
final Rect composingRect =
1551
1541
editable.getRectForComposingRange (const TextRange (start: 4 , end: 7 ))! ;
1552
1542
expect (composingRect, const Rect .fromLTRB (40.0 , 0.0 , 82.0 , 14.0 ));
1553
- }, skip : isBrowser); // https://github.com/flutter/flutter/issues/61021
1543
+ });
1554
1544
1555
1545
test ('able to render WidgetSpans with line wrap' , () async {
1556
1546
final TextSelectionDelegate delegate =
@@ -1599,7 +1589,7 @@ void main() {
1599
1589
expect (composingRect, const Rect .fromLTRB (40.0 , 0.0 , 68.0 , 14.0 ));
1600
1590
composingRect = editable.getRectForComposingRange (const TextRange (start: 6 , end: 7 ))! ;
1601
1591
expect (composingRect, const Rect .fromLTRB (0.0 , 14.0 , 14.0 , 28.0 ));
1602
- }, skip : isBrowser); // https://github.com/flutter/flutter/issues/61021
1592
+ });
1603
1593
1604
1594
test ('able to render WidgetSpans with line wrap alternating spans' , () async {
1605
1595
final TextSelectionDelegate delegate =
@@ -1657,7 +1647,7 @@ void main() {
1657
1647
expect (composingRect, const Rect .fromLTRB (24.0 , 18.0 , 34.0 , 28.0 ));
1658
1648
composingRect = editable.getRectForComposingRange (const TextRange (start: 9 , end: 10 ))! ;
1659
1649
expect (composingRect, const Rect .fromLTRB (34.0 , 14.0 , 48.0 , 28.0 ));
1660
- }, skip : isBrowser); // https://github.com/flutter/flutter/issues/61021
1650
+ });
1661
1651
1662
1652
test ('able to render WidgetSpans nested spans' , () async {
1663
1653
final TextSelectionDelegate delegate =
@@ -1711,7 +1701,7 @@ void main() {
1711
1701
expect (composingRect, const Rect .fromLTRB (0.0 , 14.0 , 14.0 , 28.0 ));
1712
1702
composingRect = editable.getRectForComposingRange (const TextRange (start: 7 , end: 8 ));
1713
1703
expect (composingRect, null );
1714
- }, skip : isBrowser); // https://github.com/flutter/flutter/issues/61021
1704
+ });
1715
1705
1716
1706
test ('WidgetSpan render box is painted at correct offset when scrolled' , () async {
1717
1707
final TextSelectionDelegate delegate =
@@ -1752,7 +1742,7 @@ void main() {
1752
1742
final Rect composingRect =
1753
1743
editable.getRectForComposingRange (const TextRange (start: 4 , end: 5 ))! ;
1754
1744
expect (composingRect, const Rect .fromLTRB (40.0 , - 100.0 , 54.0 , - 86.0 ));
1755
- }, skip : isBrowser); // https://github.com/flutter/flutter/issues/61021
1745
+ });
1756
1746
1757
1747
test ('can compute IntrinsicWidth for WidgetSpans' , () {
1758
1748
// Regression test for https://github.com/flutter/flutter/issues/59316
@@ -1893,7 +1883,7 @@ void main() {
1893
1883
result = BoxHitTestResult ();
1894
1884
editable.hitTest (result, position: const Offset (5.0 , 15.0 ));
1895
1885
expect (result.path, hasLength (0 ));
1896
- }, skip : isBrowser); // https://github.com/flutter/flutter/issues/61020
1886
+ });
1897
1887
1898
1888
test ('hits correct WidgetSpan when scrolled' , () {
1899
1889
final String text = '${"\n " * 10 }test' ;
@@ -1975,7 +1965,7 @@ void main() {
1975
1965
result = BoxHitTestResult ();
1976
1966
editable.hitTest (result, position: const Offset (5.0 , 15.0 ));
1977
1967
expect (result.path, hasLength (1 )); // Only the RenderEditable.
1978
- }, skip : isBrowser); // https://github.com/flutter/flutter/issues/61020
1968
+ });
1979
1969
});
1980
1970
1981
1971
test ('does not skip TextPainter.layout because of invalid cache' , () {
0 commit comments