diff --git a/lib/web_ui/dev/README.md b/lib/web_ui/dev/README.md index 309ca9a28c80c..ef6d0986eb6da 100644 --- a/lib/web_ui/dev/README.md +++ b/lib/web_ui/dev/README.md @@ -49,6 +49,8 @@ To run unit tests only: felt test --unit-tests-only ``` +Most of the unit tests are run using the html rendering backends. The unit tests under `test/cancaskit` directory use `canvaskit` backend. + To run integration tests only. For now these tests are only available on Chrome Desktop browsers. These tests will fetch the flutter repository for using `flutter drive` and `flutter pub get` commands. The repository will be synced to the youngest commit older than the engine commit. ``` @@ -61,6 +63,12 @@ To skip cloning the flutter repository use the following flag. This flag can sav felt test --integration-tests-only --use-system-flutter ``` +We can use different rendering backends for running the integrations tests. If one wants to use html backend use the following command. `web-renderer` flag accepts 3 different options: `html`, `canvaskit`, `auto`. + +``` +felt test --integration-tests-only --web-renderer=html +``` + To run tests on Firefox (this will work only on a Linux device): ``` diff --git a/lib/web_ui/dev/test_runner.dart b/lib/web_ui/dev/test_runner.dart index 9a67335cf0905..a9e9397ae81d6 100644 --- a/lib/web_ui/dev/test_runner.dart +++ b/lib/web_ui/dev/test_runner.dart @@ -619,6 +619,8 @@ class TestCommand extends Command with ArgUtils { '--enable-experiment=non-nullable', '--no-sound-null-safety', if (input.forCanvasKit) '-DFLUTTER_WEB_USE_SKIA=true', + if (!input.forCanvasKit) '-DFLUTTER_WEB_AUTO_DETECT=false', + if (!input.forCanvasKit) '-DFLUTTER_WEB_USE_SKIA=false', '-O2', '-o', targetFileName, // target path. diff --git a/lib/web_ui/lib/src/engine/canvaskit/initialization.dart b/lib/web_ui/lib/src/engine/canvaskit/initialization.dart index 20a9ecd952c2e..61fe5fefa9917 100644 --- a/lib/web_ui/lib/src/engine/canvaskit/initialization.dart +++ b/lib/web_ui/lib/src/engine/canvaskit/initialization.dart @@ -31,7 +31,7 @@ bool _detectRenderer() { /// Using flutter tools option "--web-render=auto" would set the value to true. /// Otherwise, it would be false. const bool _autoDetect = - bool.fromEnvironment('FLUTTER_WEB_AUTO_DETECT', defaultValue: false); + bool.fromEnvironment('FLUTTER_WEB_AUTO_DETECT', defaultValue: true); /// Enable the Skia-based rendering backend. ///