Skip to content

[CP-beta][web] Text editing test accepts both behaviors in Firefox#173053

Merged
auto-submit[bot] merged 1 commit into
flutter:flutter-3.35-candidate.0from
flutteractionsbot:cp-beta-5b78ecca51f0f37ce2ac2deec77cb8473b8a9e58
Jul 31, 2025
Merged

[CP-beta][web] Text editing test accepts both behaviors in Firefox#173053
auto-submit[bot] merged 1 commit into
flutter:flutter-3.35-candidate.0from
flutteractionsbot:cp-beta-5b78ecca51f0f37ce2ac2deec77cb8473b8a9e58

Conversation

@flutteractionsbot

@flutteractionsbot flutteractionsbot commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

This pull request is created by automatic cherry pick workflow

Issue Link:

#172713

Changelog Description:

Fix web engine unit tests to work on multiple versions of Firefox.

Impact Description:

Without this fix, some unit tests fail fairly regularly on Firefox.

Workaround:

This does not affect end-users, so no workaround necessary.

Risk:

Low

Test Coverage:

Are you confident that your fix is well-tested by automated tests?

Yes

Validation Steps:

Run CI.

@flutteractionsbot flutteractionsbot added the cp: review Cherry-picks in the review queue label Jul 31, 2025
@flutteractionsbot

Copy link
Copy Markdown
Contributor Author

@eyebrowsoffire please fill out the PR description above, afterwards the release team will review this request.

@flutter-dashboard

Copy link
Copy Markdown

This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter.

Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed.

@github-actions github-actions Bot added a: text input Entering text in a text field or keyboard related problems engine flutter/engine related. See also e: labels. platform-web Web applications specifically labels Jul 31, 2025

@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 addresses a flaky test in Firefox by making the test accept two different behaviors for focus handling. This is a pragmatic solution for dealing with environment-dependent test failures. My review focuses on improving the clarity and maintainability of the code comment that explains this workaround.

Comment on lines +697 to +704
//
// We've seen cases in LUCI where Firefox behaves like Chrome (sets focus on the input
// element). But when running locally, we are seeing the wrong behavior explained in the
// comment above. To work around this, the test will accept both behaviors for now.
expect(
domDocument.activeElement,
anyOf(textEditing.strategy.domElement, flutterView.dom.rootElement),
);

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 comment explaining this workaround can be made more concise and self-contained for better readability and future maintenance. Adding a TODO to track the underlying flaky behavior would also be beneficial.

          // We've seen cases in LUCI where Firefox behaves like Chrome (sets focus on the input
          // element), but when running locally it does not. To work around this
          // test flakiness, we accept both behaviors for now.
          // TODO(flutter/flutter#<issue_number_if_any>): Track Firefox focus issue.
          expect(
            domDocument.activeElement,
            anyOf(textEditing.strategy.domElement, flutterView.dom.rootElement),
          );

@eyebrowsoffire eyebrowsoffire added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 31, 2025
@auto-submit auto-submit Bot merged commit 52cc75c into flutter:flutter-3.35-candidate.0 Jul 31, 2025
163 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: text input Entering text in a text field or keyboard related problems autosubmit Merge PR when tree becomes green via auto submit App cp: review Cherry-picks in the review queue engine flutter/engine related. See also e: labels. platform-web Web applications specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants