Support flutter run --wasm and flutter drive --wasm. (#146231)

This adds support for adding the `--wasm` flag to `flutter run` and `flutter drive`
* Emits errors if you attempt to use the skwasm renderer without the `--wasm` flag
* Emits errors if you try to use `--wasm` when not using a web device
* Uses the skwasm renderer by default if you pass `--wasm` and no `--web-renderer`
This commit is contained in:
Jackson Gardner
2024-04-12 12:27:26 -07:00
committed by GitHub
parent e2c812155c
commit 9973673752
29 changed files with 337 additions and 64 deletions

View File

@@ -12,5 +12,7 @@ void main() {
testWidgets('isCanvasKit returns true in CanvasKit mode', (WidgetTester tester) async {
await tester.pumpAndSettle();
expect(isCanvasKit, true);
expect(isSkwasm, false);
expect(isSkiaWeb, true);
});
}

View File

@@ -8,8 +8,10 @@ import 'package:integration_test/integration_test.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
testWidgets('isCanvasKit returns false in HTML mode', (WidgetTester tester) async {
testWidgets('capabilities are set properly in HTML mode', (WidgetTester tester) async {
await tester.pumpAndSettle();
expect(isCanvasKit, false);
expect(isSkwasm, false);
expect(isSkiaWeb, false);
});
}

View File

@@ -0,0 +1,18 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/foundation.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
testWidgets('capabilities are set properly in Skwasm mode', (WidgetTester tester) async {
await tester.pumpAndSettle();
expect(isCanvasKit, false);
expect(isSkwasm, true);
expect(isSkiaWeb, true);
});
}

View File

@@ -0,0 +1,7 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:integration_test/integration_test_driver.dart' as test;
Future<void> main() async => test.integrationDriver();