Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Re-merge Switch web-render option default to auto. Add documentation #23187

Merged
merged 1 commit into from
Dec 21, 2020
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
8 changes: 8 additions & 0 deletions lib/web_ui/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

```
Expand All @@ -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):

```
Expand Down
2 changes: 2 additions & 0 deletions lib/web_ui/dev/test_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ class TestCommand extends Command<bool> 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.
Expand Down
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 @@ -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.
///
Expand Down