Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions lib/web_ui/test/paragraph_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ void main() async {
closeTo(paragraph.alphabeticBaseline * kAhemBaselineRatio, 3.0),
);
}
},
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
skip: browserEngine == BrowserEngine.webkit);
});

testEachMeasurement('predictably lays out a multi-line paragraph', () {
for (double fontSize in <double>[10.0, 20.0, 30.0, 40.0]) {
Expand All @@ -85,9 +83,7 @@ void main() async {
closeTo(paragraph.alphabeticBaseline * kAhemBaselineRatio, 3.0),
);
}
},
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
skip: browserEngine == BrowserEngine.webkit);
});

testEachMeasurement('predictably lays out a single-line rich paragraph', () {
for (double fontSize in <double>[10.0, 20.0, 30.0, 40.0]) {
Expand Down Expand Up @@ -305,9 +301,7 @@ void main() async {
TextDirection.rtl,
),
);
},
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
skip: browserEngine == BrowserEngine.webkit);
});

testEachMeasurement(
'getBoxesForRange return empty list for zero-length range', () {
Expand Down Expand Up @@ -427,7 +421,5 @@ void main() async {

expect(paragraph.width, 30);
expect(paragraph.height, 10);
},
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
skip: browserEngine == BrowserEngine.webkit);
});
}
11 changes: 8 additions & 3 deletions lib/web_ui/test/text/measurement_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

@TestOn('chrome || firefox')

import 'package:ui/ui.dart' as ui;
import 'package:ui/src/engine.dart';

Expand Down Expand Up @@ -31,14 +29,19 @@ typedef MeasurementTestBody = void Function(TextMeasurementService instance);

/// Runs the same test twice - once with dom measurement and once with canvas
/// measurement.
void testMeasurements(String description, MeasurementTestBody body) {
void testMeasurements(String description, MeasurementTestBody body, {
bool skipDom,
bool skipCanvas,
}) {
test(
'$description (dom)',
() => body(TextMeasurementService.domInstance),
skip: skipDom,
);
test(
'$description (canvas)',
() => body(TextMeasurementService.canvasInstance),
skip: skipCanvas,
);
}

Expand Down Expand Up @@ -383,6 +386,7 @@ void main() async {
expect(result.lines, isNull);
}
},
skipDom: browserEngine == BrowserEngine.webkit,
);

testMeasurements(
Expand Down Expand Up @@ -797,6 +801,7 @@ void main() async {
expect(result.lines, isNull);
}
},
skipDom: browserEngine == BrowserEngine.webkit,
);

testMeasurements('respects max lines', (TextMeasurementService instance) {
Expand Down
8 changes: 2 additions & 6 deletions lib/web_ui/test/text_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ void main() async {
from: paragraph.alphabeticBaseline * baselineRatio),
);
}
},
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
skip: browserEngine == BrowserEngine.webkit);
});

test('predictably lays out a multi-line paragraph', () {
for (double fontSize in <double>[10.0, 20.0, 30.0, 40.0]) {
Expand Down Expand Up @@ -72,9 +70,7 @@ void main() async {
from: paragraph.alphabeticBaseline * baselineRatio),
);
}
},
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
skip: browserEngine == BrowserEngine.webkit);
});

test('lay out unattached paragraph', () {
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
Expand Down