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
2 changes: 1 addition & 1 deletion lib/web_ui/dev/goldens_lock.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
repository: https://github.com/flutter/goldens.git
revision: 76ee6c69bf493b4b860e6685d0145ec8ac734f2c
revision: 8df047cbfb1edb34569f3170a26e718fef22ffa7
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/canvaskit/initialization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const bool canvasKitForceCpuOnly = bool.fromEnvironment(
/// NPM, update this URL to `https://unpkg.com/canvaskit-wasm@0.34.0/bin/`.
const String canvasKitBaseUrl = String.fromEnvironment(
'FLUTTER_WEB_CANVASKIT_URL',
defaultValue: 'https://unpkg.com/canvaskit-wasm@0.28.0/bin/',
defaultValue: 'https://unpkg.com/canvaskit-wasm@0.28.1/bin/',
);
final String canvasKitBuildUrl =
canvasKitBaseUrl + (kProfileMode ? 'profiling/' : '');
Expand Down
15 changes: 15 additions & 0 deletions lib/web_ui/test/canvaskit/canvas_golden_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,17 @@ void testMain() {
);
});

test('sample Bengali text', () async {
await testSampleText(
'bengali',
'ঈদের জামাত মসজিদে, মানতে হবে স্বাস্থ্যবিধি: ধর্ম মন্ত্রণালয়',
);
});

test('hindi svayan test', () async {
await testSampleText('hindi_svayan', 'स्वयं');
});

// We've seen text break when we load many fonts simultaneously. This test
// combines text in multiple languages into one long paragraph to make sure
// we can handle it.
Expand All @@ -782,6 +793,10 @@ void testMain() {
);
});

test('emoji text with skin tone', () async {
await testSampleText('emoji_with_skin_tone', '👋🏿 👋🏾 👋🏽 👋🏼 👋🏻');
});

// Make sure we clear the canvas in between frames.
test('empty frame after contentful frame', () async {
// First draw a frame with a red rectangle
Expand Down
7 changes: 4 additions & 3 deletions lib/web_ui/test/canvaskit/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import 'package:test/test.dart';
import 'package:ui/src/engine.dart';
import 'package:ui/ui.dart' as ui;

/// Whether the current browser is Safari.
bool get isSafari => browserEngine == BrowserEngine.webkit;

/// Whether the current browser is Safari on iOS.
// TODO: https://github.com/flutter/flutter/issues/60040
bool get isIosSafari =>
browserEngine == BrowserEngine.webkit &&
operatingSystem == OperatingSystem.iOs;
bool get isIosSafari => isSafari && operatingSystem == OperatingSystem.iOs;

/// Whether the current browser is Firefox.
bool get isFirefox => browserEngine == BrowserEngine.firefox;
Expand Down
3 changes: 2 additions & 1 deletion lib/web_ui/test/canvaskit/surface_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ void testMain() {
final html.CanvasElement canvas =
surface.htmlElement.children.single as html.CanvasElement;
final dynamic ctx = canvas.getContext('webgl2');
expect(ctx, isNotNull);
final dynamic loseContextExtension =
ctx.getExtension('WEBGL_lose_context');
loseContextExtension.loseContext();
Expand All @@ -112,7 +113,7 @@ void testMain() {
expect(afterContextLost, isNot(same(before)));
},
// Firefox doesn't have the WEBGL_lose_context extension.
skip: isFirefox || isIosSafari,
skip: isFirefox || isSafari,
);

// Regression test for https://github.com/flutter/flutter/issues/75286
Expand Down