0

Update the power button a11y label

screenshot:
go/strpic/1890874d97aa09910fc502c190a7e82f926054b8

Bug: b/266995941
Change-Id: I5caa7f8e30d4dd3f120e09c3610e762100b8a41e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4343100
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Alex Newcomer <newcomer@chromium.org>
Commit-Queue: Jiaming Cheng <jiamingc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1119583}
This commit is contained in:
Jiaming Cheng
2023-03-20 20:56:13 +00:00
committed by Chromium LUCI CQ
parent 37fc3fa839
commit 7f0f915cc2
5 changed files with 23 additions and 5 deletions

@ -1278,6 +1278,9 @@ Style notes:
<message name="IDS_ASH_STATUS_TRAY_SHUTDOWN" desc="The accessible text for the shutdown button.">
Shut down
</message>
<message name="IDS_ASH_STATUS_TRAY_POWER_MENU" desc="The accessible text for the power button.">
Power menu
</message>
<message name="IDS_ASH_STATUS_TRAY_COLLAPSE" desc="The accessible text for the button to collapse system menu.">
Collapse menu
</message>

@ -0,0 +1 @@
1890874d97aa09910fc502c190a7e82f926054b8

@ -240,7 +240,7 @@ PowerButton::PowerButton()
base::Unretained(this)),
IconButton::Type::kMediumFloating,
&kUnifiedMenuPowerIcon,
IDS_ASH_STATUS_TRAY_SHUTDOWN,
IDS_ASH_STATUS_TRAY_POWER_MENU,
/*is_togglable=*/true,
/*has_border=*/false))),
context_menu_(std::make_unique<MenuController>(/*button=*/this)) {

@ -973,7 +973,11 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, NavigateSystemTray) {
// Shutdown button.
sm_.Call([this]() { SendKeyPressWithShift(ui::VKEY_TAB); });
sm_.ExpectSpeech("Shut down");
if (base::FeatureList::IsEnabled(features::kQsRevamp)) {
sm_.ExpectSpeech("Power menu");
} else {
sm_.ExpectSpeech("Shut down");
}
sm_.ExpectSpeech("Button");
sm_.Replay();
@ -992,7 +996,11 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, NavigateSystemTray) {
// Shutdown button.
sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_B); });
sm_.ExpectSpeech("Shut down");
if (base::FeatureList::IsEnabled(features::kQsRevamp)) {
sm_.ExpectSpeech("Power menu");
} else {
sm_.ExpectSpeech("Shut down");
}
sm_.ExpectSpeech("Button");
sm_.Replay();

@ -133,10 +133,16 @@ class ShutdownPolicyInSessionTest : public ShutdownPolicyBaseTest {
}
};
// Tests that by default the shutdown button tooltip is "Shut down".
// Tests that by default the shutdown button tooltip is "Shut down" in the old
// view or "Power menu" in the revamped view.
IN_PROC_BROWSER_TEST_F(ShutdownPolicyInSessionTest, TestBasic) {
OpenSystemTrayMenu();
EXPECT_TRUE(HasShutdownButtonTooltip("Shut down"));
if (base::FeatureList::IsEnabled(ash::features::kQsRevamp)) {
EXPECT_TRUE(HasShutdownButtonTooltip("Power menu"));
} else {
EXPECT_TRUE(HasShutdownButtonTooltip("Shut down"));
}
CloseSystemTrayMenu();
}