Skip to content

Migrates flutter windows test to impeller#188188

Merged
auto-submit[bot] merged 18 commits into
flutter:masterfrom
gaaclarke:windows-test-swiftshader
Jun 24, 2026
Merged

Migrates flutter windows test to impeller#188188
auto-submit[bot] merged 18 commits into
flutter:masterfrom
gaaclarke:windows-test-swiftshader

Conversation

@gaaclarke

@gaaclarke gaaclarke commented Jun 18, 2026

Copy link
Copy Markdown
Member

fixes #188173

This works by mocking out the egl manager so a real renderer is not required. I don't think these tests were intended to be integration tests, they are in a file called _unittests.cc.

In the history of this pr I did move them over to use SwiftShader, which is possible. I instead opted them to use a mocked egl manager which is 100x faster.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 18, 2026
@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) platform-windows Building on or for Windows specifically a: desktop Running on desktop team-windows Owned by the Windows platform team and removed CICD Run CI/CD labels Jun 18, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 18, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 18, 2026
@gaaclarke gaaclarke force-pushed the windows-test-swiftshader branch from 97e7fe8 to a8a8f54 Compare June 18, 2026 22:05
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 18, 2026
@gaaclarke gaaclarke force-pushed the windows-test-swiftshader branch from a8a8f54 to 790e4cc Compare June 18, 2026 22:24
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 18, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 18, 2026
@gaaclarke gaaclarke marked this pull request as ready for review June 18, 2026 22:41
@gaaclarke gaaclarke requested a review from a team as a code owner June 18, 2026 22:41

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates several Windows platform unit tests to use DefaultImpeller instead of DisabledImpeller, adds an egl_config() getter to the EGL Manager class, and introduces a mock EGL manager (ViewTestEGLManager) with mocked embedder API functions in the view unit tests. Feedback recommends removing unused parameter names in the mock lambdas to prevent compiler warnings, and removing a redundant semicolon after the egl_config() definition to align with the C++ style guide.

Comment on lines +114 to +141
modifier.embedder_api().Run = MOCK_ENGINE_PROC(
Run, ([](size_t version, const FlutterRendererConfig* config,
const FlutterProjectArgs* args, void* user_data,
FLUTTER_API_SYMBOL(FlutterEngine) * engine) {
*engine =
reinterpret_cast<FLUTTER_API_SYMBOL(FlutterEngine)>(0x12345678);
return kSuccess;
}));

modifier.embedder_api().Shutdown = MOCK_ENGINE_PROC(
Shutdown,
([](FLUTTER_API_SYMBOL(FlutterEngine) engine) { return kSuccess; }));

modifier.embedder_api().UpdateLocales = MOCK_ENGINE_PROC(
UpdateLocales, ([](FLUTTER_API_SYMBOL(FlutterEngine) engine,
const FlutterLocale** locales,
size_t locales_count) { return kSuccess; }));

modifier.embedder_api().UpdateAccessibilityFeatures = MOCK_ENGINE_PROC(
UpdateAccessibilityFeatures,
([](FLUTTER_API_SYMBOL(FlutterEngine) engine,
FlutterAccessibilityFeature flags) { return kSuccess; }));

modifier.embedder_api().PostRenderThreadTask = MOCK_ENGINE_PROC(
PostRenderThreadTask, ([](auto engine, auto callback, auto context) {
callback(context);
return kSuccess;
}));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Several parameters in these mock lambdas are unused (e.g., version, config, args, user_data, engine, locales, locales_count, flags). In strict compilation environments (such as Flutter's CI with -Werror and -Wunused-parameter), this can trigger compiler warnings or errors. Omitting the parameter names for unused arguments avoids these warnings.

  modifier.embedder_api().Run = MOCK_ENGINE_PROC(
      Run, ([](size_t,
               const FlutterRendererConfig*,
               const FlutterProjectArgs*,
               void*,
               FLUTTER_API_SYMBOL(FlutterEngine)* engine) {
        *engine =
            reinterpret_cast<FLUTTER_API_SYMBOL(FlutterEngine)>(0x12345678);
        return kSuccess;
      }));

  modifier.embedder_api().Shutdown = MOCK_ENGINE_PROC(
      Shutdown,
      ([](FLUTTER_API_SYMBOL(FlutterEngine)) { return kSuccess; }));

  modifier.embedder_api().UpdateLocales = MOCK_ENGINE_PROC(
      UpdateLocales, ([](FLUTTER_API_SYMBOL(FlutterEngine),
                         const FlutterLocale**,
                         size_t) { return kSuccess; }));

  modifier.embedder_api().UpdateAccessibilityFeatures = MOCK_ENGINE_PROC(
      UpdateAccessibilityFeatures,
      ([](FLUTTER_API_SYMBOL(FlutterEngine),
          FlutterAccessibilityFeature) { return kSuccess; }));

  modifier.embedder_api().PostRenderThreadTask = MOCK_ENGINE_PROC(
      PostRenderThreadTask, ([](auto, auto callback, auto context) {
        callback(context);
        return kSuccess;
      }));

EGLDisplay egl_display() const { return display_; };

// Gets the |EGLConfig|.
EGLConfig egl_config() const { return config_; };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The semicolon after the member function definition is redundant and can be removed to adhere to standard C++ and style guidelines.

Suggested change
EGLConfig egl_config() const { return config_; };
EGLConfig egl_config() const { return config_; }
References
  1. C++ code should follow the Google C++ Style Guide, which discourages redundant semicolons after function definitions. (link)

@loic-sharma loic-sharma requested a review from mattkae June 23, 2026 22:38

@loic-sharma loic-sharma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 23, 2026
@gaaclarke gaaclarke added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Jun 23, 2026
@auto-submit

auto-submit Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/188188, because - The status or check suite Linux linux_web_engine_tests has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 24, 2026
@gaaclarke gaaclarke added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 24, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Jun 24, 2026
Merged via the queue into flutter:master with commit cfa19f0 Jun 24, 2026
213 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 24, 2026
via-guy pushed a commit to via-guy/flutter that referenced this pull request Jun 26, 2026
fixes flutter#188173

This works by mocking out the egl manager so a real renderer is not
required. I don't think these tests were intended to be integration
tests, they are in a file called _unittests.cc.

In the history of this pr I did move them over to use SwiftShader, which
is possible. I instead opted them to use a mocked egl manager which is
100x faster.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

If this change needs to override an active code freeze, provide a
comment explaining why. The code freeze workflow can be overridden by
code reviewers. See pinned issues for any active code freezes with
guidance.

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: desktop Running on desktop CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-windows Building on or for Windows specifically team-windows Owned by the Windows platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[windows]: some flutter_windows_unittests need skia's software renderer

3 participants