Repository navigation
Reset flutter engine internal state in framework test postTest - #193842
Merged
Merged
Conversation
andywolff
force-pushed
the
test_randomization_2
branch
from
October 6, 2026 18:48
e06b3f3 to
e6faed0
Compare
andywolff
marked this pull request as ready for review
October 6, 2026 20:35
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates TestWidgetsFlutterBinding to call platformDispatcher.resetInternalState() during state reset. It also implements resetInternalState in TestPlatformDispatcher to delegate to the underlying PlatformDispatcher, and adds corresponding unit tests to verify this delegation. There are no review comments, and I have no additional feedback to provide.
loic-sharma
approved these changes
Oct 6, 2026
Contributor
|
autosubmit label was removed for flutter/flutter/193842, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
This was referenced Oct 8, 2026
suryaKommana2662
pushed a commit
to suryaKommana2662/flutter
that referenced
this pull request
Oct 29, 2026
…er#193842) Part of flutter#192992 Follow-up to flutter#193497. In flutter#193497, I introduced `PlatformDispatcher.resetInternalState()` to allow test harnesses to purge internal engine caches (such as Impeller's offscreen `RenderTargetCache`) between test cases to ensure test isolation. Now that the engine changes have rolled into the framework, this PR connects the framework test harness: 1. Implements `TestPlatformDispatcher.resetInternalState()` in `packages/flutter_test/lib/src/window.dart` to delegate to the underlying `PlatformDispatcher`. 2. Invokes `platformDispatcher.resetInternalState()` in `TestWidgetsFlutterBinding.postTest` alongside `ServicesBinding.instance.resetInternalState()`. 3. Adds a unit test in `packages/flutter_test/test/platform_dispatcher_test.dart` to verify delegation. ## 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 in-code documentation (doc comments with `///`). - [x] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [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. <!-- 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 [flutter/website]: https://github.com/flutter/website [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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #192992
Follow-up to #193497.
In #193497, I introduced
PlatformDispatcher.resetInternalState()to allow test harnesses to purge internal engine caches (such as Impeller's offscreenRenderTargetCache) between test cases to ensure test isolation.Now that the engine changes have rolled into the framework, this PR connects the framework test harness:
TestPlatformDispatcher.resetInternalState()inpackages/flutter_test/lib/src/window.dartto delegate to the underlyingPlatformDispatcher.platformDispatcher.resetInternalState()inTestWidgetsFlutterBinding.postTestalongsideServicesBinding.instance.resetInternalState().packages/flutter_test/test/platform_dispatcher_test.dartto verify delegation.Pre-launch Checklist
///).