Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
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
8 changes: 4 additions & 4 deletions lib/web_ui/test/golden_tests/engine/scuba.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ typedef CanvasTest = FutureOr<void> Function(EngineCanvas canvas);

/// Runs the given test [body] with each type of canvas.
void testEachCanvas(String description, CanvasTest body,
{double maxDiffRate}) {
{double maxDiffRate, bool skip = false}) {
const ui.Rect bounds = ui.Rect.fromLTWH(0, 0, 600, 800);
test('$description (bitmap)', () {
try {
Expand All @@ -106,7 +106,7 @@ void testEachCanvas(String description, CanvasTest body,
WebExperiments.instance.useCanvasText = null;
TextMeasurementService.clearCache();
}
});
}, skip: skip);
test('$description (bitmap + canvas measurement)', () async {
try {
TextMeasurementService.initialize(rulerCacheCapacity: 2);
Expand All @@ -116,7 +116,7 @@ void testEachCanvas(String description, CanvasTest body,
WebExperiments.instance.useCanvasText = null;
TextMeasurementService.clearCache();
}
});
}, skip: skip);
test('$description (dom)', () {
try {
TextMeasurementService.initialize(rulerCacheCapacity: 2);
Expand All @@ -126,7 +126,7 @@ void testEachCanvas(String description, CanvasTest body,
WebExperiments.instance.useCanvasText = null;
TextMeasurementService.clearCache();
}
});
}, skip: skip);
}

final ui.TextStyle _defaultTextStyle = ui.TextStyle(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ void testMain() async {
recordingCanvas.endRecording();
recordingCanvas.apply(canvas, screenRect);
return scuba.diffCanvasScreenshot(canvas, 'text_with_placeholders');
});
}, // https://github.com/flutter/flutter/issues/66129
skip: operatingSystem == OperatingSystem.iOs &&
browserEngine == BrowserEngine.webkit);

testEachCanvas('text alignment and placeholders', (EngineCanvas canvas) {
final Rect screenRect = const Rect.fromLTWH(0, 0, 600, 600);
Expand Down Expand Up @@ -75,7 +77,9 @@ void testMain() async {
recordingCanvas.endRecording();
recordingCanvas.apply(canvas, screenRect);
return scuba.diffCanvasScreenshot(canvas, 'text_align_with_placeholders');
});
}, // https://github.com/flutter/flutter/issues/66129
skip: operatingSystem == OperatingSystem.iOs &&
browserEngine == BrowserEngine.webkit);
}

const Color black = Color(0xFF000000);
Expand Down