Closed Bug 2011351 Opened 5 months ago Closed 5 months ago

TextInputDelegateTest doesn't play well with nsPresContext::UserInputEventsAllowed

Categories

(GeckoView :: General, defect)

All
Android
defect

Tracking

(firefox147 wontfix, firefox148 wontfix, firefox149 fixed)

RESOLVED FIXED
149 Branch
Tracking Status
firefox147 --- wontfix
firefox148 --- wontfix
firefox149 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

The UserInputEventsAllowed check in the DOM doesn't play well with our test cases and seems to be one source of flakiness. On desktop, we mark such keyboard events during tests as synthetic, but that is a bit clumsy with out tests that use InputConnection.
As a simple fix, I'll just change the pref while the TextInputDelegateTests run.

Synthetic tests can be flaky if they run faster than the input check so disable it
for the test. Note that on desktop we mark such inputs as synthetic to bypass the
check, but that is more awkward in our Android tests that are using InputConnection.

Keywords: leave-open
Pushed by tcampbell@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8ede01d01d0c https://hg.mozilla.org/integration/autoland/rev/eade32239c65 Disable dom_input_events_security during TextInputDelegateTest. r=m_kato,geckoview-reviewers
Attachment #9538686 - Attachment description: WIP: Bug 2011351 - Re-enable some TextInputDelegateTest tests → Bug 2011351 - Re-enable some TextInputDelegateTest tests r?m_kato

The remaining inputConnection_setSelection test is still flaky due to race condition here. If I remove the guard and always send the message then the test reliably works for me. The problem is that check was added to fix Bug 1563640. I tried to reproduce on Fennec68/Pixel3/SwiftKey7.7 but was not able to (probably because my OS is updated). Without more insight into that old bug I'm slightly cautious about changing things even though the current code is itself race-y.

Makoto, do you have any thoughts about if we should try to fix this, or keep the test disabled for now?

Flags: needinfo?(m_kato)

At that time, mobile twitter used another library to input tweet. Currently they use something contenteditable library (draft.js or Lexical) on mobile site.
So please keep setSelection is disabled. I can reproduce original issue on simply <textarea> with the latest version of SwiftKey EN keyboard when backed out original fix.

Also I should add more test case to emulate IME...

Flags: needinfo?(m_kato)

I added SwiftKey emulation by bug 2012938

Status: NEW → RESOLVED
Closed: 5 months ago
Keywords: leave-open
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: