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

Conversation

@mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Jul 20, 2023

At some point, we started setting useColorEmoji to true in our tests, but we were doing it in a way that resets all other configurations to their defaults. This caused the canvasKitVariant config to be lost and always set to the default auto.

This PR fixes the issue and adds tests to:

  1. Make sure that the CanvasKit suite always runs with a specific variant (not auto).
  2. Make sure the given CanvasKit variant makes it all the way through to the tests.

The test harness uses a backdoor (a global JS property on window) to communicate which canvaskit variant it's using. The test then compares that with configuration.canvasKitVariant to make sure they match. If they don't match, then the configuration was lost somewhere on the way.

Fixes flutter/flutter#130993

@github-actions github-actions bot added the platform-web Code specifically for the web engine label Jul 20, 2023
Copy link
Contributor

@harryterkelsen harryterkelsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 20, 2023
@auto-submit auto-submit bot merged commit 6c224e8 into flutter:main Jul 20, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 20, 2023
}) as engine.JsFlutterConfiguration);
final engine.FlutterConfiguration config = engine.configuration.merge(
js_util.jsify(<String, Object?>{
'useColorEmoji': true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd been much easier to pass useColorEmoji: true on the window.flutterConfiguration JS object of the test_platform.dart?

That way the value would be read as part of the default egine configuration (since it seems that it's being applied to all tests anyway?)

I can try a PR later if you want!

auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jul 20, 2023
…131010)

flutter/engine@a3fc185...062079b

2023-07-20 [email protected] More validation logs for CommandEncoderVK submission (flutter/engine#43859)
2023-07-20 [email protected] Roll Dart SDK from 857c9a2ae14a to 1df95f328d0c (1 revision) (flutter/engine#43858)
2023-07-20 [email protected] [web] Preserve correct CanvasKit Variant during test initialization (flutter/engine#43854)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
ditman added a commit to ditman/flutter-engine that referenced this pull request Jul 20, 2023
harryterkelsen pushed a commit to harryterkelsen/engine that referenced this pull request Jul 20, 2023
…lutter#43854)

At some point, we started setting `useColorEmoji` to true in our tests, but we were doing it in a way that resets all other configurations to their defaults. This caused the `canvasKitVariant` config to be lost and always set to the default `auto`.

This PR fixes the issue and adds tests to:

1. Make sure that the CanvasKit suite always runs with a specific variant (not `auto`).
2. Make sure the given CanvasKit variant makes it all the way through to the tests.

The test harness uses a backdoor (a global JS property on `window`) to communicate which canvaskit variant it's using. The test then compares that with `configuration.canvasKitVariant` to make sure they match. If they don't match, then the configuration was lost somewhere on the way.

Fixes flutter/flutter#130993
auto-submit bot pushed a commit that referenced this pull request Jul 26, 2023
A ~~simpler~~ very similar version of #43854

* Makes it harder for users to accidentally remove default configuration values, while still allowing them to do so if needed (configuration is now overridden with a subset of values, rather than passing a full configuration object).
  * Moves `merge` from the configuration object and into the override method.
* Removes a test-only configuration option:
  * `window._flutter_canvaskit_variant_for_test_only`

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Jul 31, 2023
…lutter#131010)

flutter/engine@a3fc185...062079b

2023-07-20 [email protected] More validation logs for CommandEncoderVK submission (flutter/engine#43859)
2023-07-20 [email protected] Roll Dart SDK from 857c9a2ae14a to 1df95f328d0c (1 revision) (flutter/engine#43858)
2023-07-20 [email protected] [web] Preserve correct CanvasKit Variant during test initialization (flutter/engine#43854)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@mdebbar mdebbar deleted the correct_ck_variant branch August 8, 2023 16:13
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
A ~~simpler~~ very similar version of flutter#43854

* Makes it harder for users to accidentally remove default configuration values, while still allowing them to do so if needed (configuration is now overridden with a subset of values, rather than passing a full configuration object).
  * Moves `merge` from the configuration object and into the override method.
* Removes a test-only configuration option:
  * `window._flutter_canvaskit_variant_for_test_only`

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web] Tests using the wrong CanvasKit Variant

3 participants