Fix skwasm tests (#145570)

Skwasm tests are now running as `bringup: true` in postsubmit, but failing. Let's get them fixed.
This commit is contained in:
Jackson Gardner
2024-04-09 12:35:07 -07:00
committed by GitHub
parent 6f9fff1f7c
commit 51e70fa16b
48 changed files with 230 additions and 177 deletions

View File

@@ -62,8 +62,8 @@ class MatchesGoldenFile extends AsyncMatcher {
final ui.FlutterView view = binding.platformDispatcher.implicitView!;
final RenderView renderView = binding.renderViews.firstWhere((RenderView r) => r.flutterView == view);
if (isCanvasKit) {
// In CanvasKit, use Layer.toImage to generate the screenshot.
if (isSkiaWeb) {
// In CanvasKit and Skwasm, use Layer.toImage to generate the screenshot.
final TestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.instance;
return binding.runAsync<String?>(() async {
assert(element.renderObject != null);

View File

@@ -4,12 +4,12 @@
import 'dart:io';
/// Whether the test is running in a web browser compiled to JavaScript.
/// Whether the test is running in a web browser compiled to JavaScript or WebAssembly.
///
/// See also:
///
/// * [kIsWeb], the equivalent constant in the `foundation` library.
const bool isBrowser = identical(0, 0.0);
const bool isBrowser = bool.fromEnvironment('dart.library.js_interop');
/// Whether the test is running on the Windows operating system.
///