Closed Bug 2091464 Opened 15 days ago Closed 9 days ago

Focus left on a tab by a browser-chrome test leaks into the next test

Categories

(Testing :: Mochitest, defect)

defect

Tracking

(firefox162 fixed)

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: florian, Assigned: florian)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

Between browser-chrome tests, nextTest in testing/mochitest/browser-test.js replaces the selected tab with about:blank, but it doesn't reset focus. When a test leaves focus on a tab in the tab strip, the new tab inherits that focus and becomes the tab strip's keyboard-focused item (tablist-keyboard-focus). The next test then starts with the page unfocused.

This makes these tests fail when they run twice in a row (--repeat, and the upcoming mochitest-repeat jobs):

Tests start with gBrowser.selectedBrowser focused. The fix focuses it again before the harness replaces the tab between tests.

Tests start with the selected browser focused, but replacing the tab between tests does not reset focus. A test that leaves focus on a tab in the tab strip hands it to the next test's tab, which then starts with the page unfocused and the tab strip keyboard-focused. This also applies to --repeat runs.

Blocks: 2092566
Pushed by fqueze@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/00c403bcb6a4 https://hg.mozilla.org/integration/autoland/rev/b8a1eb3262da Focus the selected browser before replacing the tab between browser-chrome tests, r=firefox-desktop-core-reviewers ,Gijs.
Status: ASSIGNED → RESOLVED
Closed: 9 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: