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

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Oct 28, 2021

This test was previously marked flaky due to a test harness crash flutter/flutter#55778. Xcode has since been updated, but this test is still failing when unskipped. Delete, since it's been off for awhile.

Fixes flutter/flutter#55778

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the [CLA].
  • All existing and new tests are passing.

@jmagman jmagman self-assigned this Oct 28, 2021
@google-cla google-cla bot added the cla: yes label Oct 28, 2021
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1300"
Copy link
Member Author

Choose a reason for hiding this comment

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

Let Xcode update this.

@chinmaygarde
Copy link
Contributor

chinmaygarde commented Nov 11, 2021

Let's see if test is still flaky.

Looks like the test is failing still. Should we close this?

Also, clean up the XCUITest element queries a bit.

Perhaps just the cleanups can be isolated for a patch?

@jmagman
Copy link
Member Author

jmagman commented Nov 11, 2021

Let's see if test is still flaky.

Looks like the test is failing still. Should we close this?

Also, clean up the XCUITest element queries a bit.

Perhaps just the cleanups can be isolated for a patch?

This was supposed to be a draft, I added a bunch of logging to see why it's failing but I haven't had a chance to look at it.

@jmagman jmagman marked this pull request as draft November 11, 2021 23:16
@CaseyHillers CaseyHillers changed the base branch from master to main November 15, 2021 18:13
@godofredoc godofredoc changed the base branch from master to main November 24, 2021 07:11
/// Constructor for `SendTextFocusScemantics`.
SendTextFocusSemantics(PlatformDispatcher dispatcher) : super(dispatcher);

bool _firstFrameDrawn = false;
Copy link
Member Author

Choose a reason for hiding this comment

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

From flutter/flutter#55778 (comment)

It looks like the first frame of the test is supposed to fake a text field in onBeginFrame

// On the first frame, also pretend that it drew a text field. Send the
// corresponding semantics tree comprised of 1 node for the text field.
window.updateSemantics((SemanticsUpdateBuilder()

Then the test taps somewhere:

// The tap location doesn't matter. The mock framework just sends a focused text field on tap.
[textInputSemanticsObject tap];
Which triggers onPointerDataPacket, which "focuses" the fake text field:
// SemanticsFlag.isTextField and SemanticsFlag.isFocused.
flags: 48,

When I attach, I right after the tap I can see node 0 correctly being updated with flutter::SemanticsFlags::kIsFocused.

But then onBeginFrame is immediately called again (maybe because of the keyboard animating in?) and it resets node 0 back to an unfocused text field.

The test passes when I make this change to only call the onBeginFrame logic to create the fake text input only once, the first time it's called.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jmagman jmagman changed the title Unskip scenario test TextSemanticsFocusTest Delete scenario test TextSemanticsFocusTest Feb 17, 2022
@jmagman jmagman marked this pull request as ready for review February 17, 2022 20:00
@jmagman jmagman requested review from chunhtai and cyanglaz February 17, 2022 20:00
Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

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

LGTM

@jmagman jmagman added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Feb 17, 2022
@fluttergithubbot fluttergithubbot merged commit c5e89cb into flutter:main Feb 17, 2022
@jmagman jmagman deleted the unskip-semantics branch February 17, 2022 23:34
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

affects: tests cla: yes platform-ios waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

testAccessibilityFocusOnTextSemanticsProducesCorrectIosViews flakey

5 participants