mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1801193 - Focus panel buttons when screenshots UI is opened. r=sfoster,cmkm
Differential Revision: https://phabricator.services.mozilla.com/D162333
This commit is contained in:
parent
970de34535
commit
9ceb71fc14
@ -162,7 +162,6 @@
|
||||
<panel id="screenshotsPagePanel"
|
||||
type="arrow"
|
||||
orient="vertical"
|
||||
noautofocus="true"
|
||||
norolluponanchor="true"
|
||||
consumeoutsideclicks="never"
|
||||
level="parent"
|
||||
|
@ -10,6 +10,7 @@ prefs =
|
||||
|
||||
[browser_screenshots_drag_scroll_test.js]
|
||||
[browser_screenshots_drag_test.js]
|
||||
[browser_screenshots_focus_test.js]
|
||||
[browser_screenshots_overlay_panel_sync.js]
|
||||
[browser_screenshots_page_unload.js]
|
||||
[browser_screenshots_short_page_test.js]
|
||||
|
@ -0,0 +1,34 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
add_task(async function testPanelFocused() {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{
|
||||
gBrowser,
|
||||
url: TEST_PAGE,
|
||||
},
|
||||
async browser => {
|
||||
let helper = new ScreenshotsHelper(browser);
|
||||
|
||||
helper.triggerUIFromToolbar();
|
||||
|
||||
await helper.waitForOverlay();
|
||||
|
||||
EventUtils.synthesizeKey("KEY_Tab");
|
||||
|
||||
let screenshotsButtons = gBrowser.selectedBrowser.ownerDocument
|
||||
.querySelector("#screenshotsPagePanel")
|
||||
.querySelector("screenshots-buttons").shadowRoot;
|
||||
|
||||
let focusedElement = screenshotsButtons.querySelector(".visible-page");
|
||||
|
||||
is(
|
||||
focusedElement,
|
||||
screenshotsButtons.activeElement,
|
||||
"Visible button is focused"
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
Loading…
Reference in New Issue
Block a user