Commit 55e0765f authored by Matthew Mourgos's avatar Matthew Mourgos Committed by Commit Bot

Add keyboard foldering and reordering app list spoken feedback tests.

This change adds two new app list spoken feedback tests. These tests
ensure that app item reordering and folder creation are announced
correctly in the app list.

Also in this change, the incomplete NavigateAppLauncher test has been
removed as its purpose it no longer required. In its place, the tests
PeekingLauncherFocusTraversal and FullscreenLauncherFocusTraversal
already exist which cover the same relevant test case for app list
focus traversal.

Bug: 784942
Change-Id: I02120a6eff8ba1dad698a86bf1977aa9895988d7
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2242917
Commit-Queue: Matthew Mourgos <mmourgos@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781604}
parent 021df0b5
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chromeos/constants/chromeos_switches.h" #include "chromeos/constants/chromeos_switches.h"
#include "components/user_manager/user_names.h" #include "components/user_manager/user_names.h"
#include "content/public/test/browser_test.h" #include "content/public/test/browser_test.h"
...@@ -28,6 +29,15 @@ ...@@ -28,6 +29,15 @@
namespace chromeos { namespace chromeos {
namespace {
void SendKeyPressWithShiftAndControl(ui::KeyboardCode key) {
ASSERT_NO_FATAL_FAILURE(ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync(
nullptr, key, true, true, false, false)));
}
} // namespace
enum SpokenFeedbackAppListTestVariant { kTestAsNormalUser, kTestAsGuestUser }; enum SpokenFeedbackAppListTestVariant { kTestAsNormalUser, kTestAsGuestUser };
class TestSuggestionChipResult : public ash::TestSearchResult { class TestSuggestionChipResult : public ash::TestSearchResult {
...@@ -353,49 +363,123 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListTest, ...@@ -353,49 +363,123 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListTest,
sm_.Replay(); sm_.Replay();
} }
IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListTest, NavigateAppLauncher) { // Checks that app list keyboard foldering is announced.
IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListTest, AppListFoldering) {
// Add 3 apps.
PopulateApps(3);
EnableChromeVox(); EnableChromeVox();
sm_.Call([this]() { sm_.Call(
// Add one app to the applist. [this]() { EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); });
PopulateApps(1); sm_.ExpectSpeech("Shelf");
// Press space on the launcher button in shelf, this opens peeking
// launcher.
sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_SPACE); });
sm_.ExpectSpeech("Launcher, partial view");
// Send a key press to enable keyboard traversal
sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_UP); });
// Move focus to expand all apps button.
sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_UP); });
sm_.ExpectSpeech("Expand to all apps");
// Press space on expand arrow to go to fullscreen launcher.
sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_SPACE); });
sm_.ExpectSpeech("Launcher, all apps");
EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); // Move focus to 1st app;
}); sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_RIGHT); });
sm_.ExpectSpeech("Item 0");
sm_.ExpectSpeech("Button");
// Wait for it to say "Launcher", "Button", "Shelf", "Tool bar". // Combine items and create a new folder.
sm_.ExpectSpeechPattern("Launcher"); sm_.Call([]() { SendKeyPressWithShiftAndControl(ui::VKEY_RIGHT); });
sm_.ExpectSpeech("Folder Unnamed");
sm_.ExpectSpeech("Button"); sm_.ExpectSpeech("Button");
sm_.ExpectSpeech("Shelf"); sm_.ExpectSpeech("Alert");
sm_.ExpectSpeech("Tool bar"); sm_.ExpectSpeech("Item 0 combined with Item 1 to create new folder.");
// Click on the launcher, it brings up the app list UI. // Open the folder and move focus to the first item of the folder.
sm_.Call([this]() { SendKeyPress(ui::VKEY_SPACE); }); sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_SPACE); });
sm_.ExpectSpeech( sm_.ExpectSpeech("Item 1");
"Search your device, apps, settings, and web. Use the arrow keys to " sm_.ExpectSpeech("Button");
"navigate your apps.");
sm_.ExpectSpeech("Edit text"); // Remove the first item from the folder back to the top level app list.
sm_.Call([]() { SendKeyPressWithShiftAndControl(ui::VKEY_LEFT); });
sm_.ExpectSpeech("Item 1");
sm_.ExpectSpeech("Button");
sm_.ExpectSpeech("Alert");
sm_.ExpectSpeech("Moved to Page 1, row 1, column 1.");
sm_.Replay();
}
// Close it and open it again. // Checks that app list keyboard reordering is announced.
sm_.Call([this]() { SendKeyPress(ui::VKEY_ESCAPE); }); // TODO(mmourgos): The current method of accessibility announcements for item
sm_.ExpectSpeechPattern("*window*"); // reordering uses alerts, this works for spoken feedback but does not work as
// well for braille users. The preferred way to handle this is to actually
// change focus as the user navigates, and to have each object's
// accessible name describe its position. (See crbug.com/1098495)
IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListTest, AppListReordering) {
// Add 7 apps.
PopulateApps(22);
EnableChromeVox();
sm_.Call( sm_.Call(
[this]() { EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); }); [this]() { EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); });
sm_.ExpectSpeechPattern("Launcher"); sm_.ExpectSpeech("Shelf");
sm_.ExpectSpeech("Button"); // Press space on the launcher button in shelf, this opens peeking
// launcher.
sm_.Call([this]() { SendKeyPress(ui::VKEY_SPACE); }); sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_SPACE); });
sm_.ExpectSpeech( sm_.ExpectSpeech("Launcher, partial view");
"Search your device, apps, settings, and web. Use the arrow keys to " // Send a key press to enable keyboard traversal
"navigate your apps."); sm_.Call([this]() { SendKeyPressWithSearchAndShift(ui::VKEY_TAB); });
// Move focus to expand all apps button.
sm_.Call([this]() { SendKeyPressWithSearchAndShift(ui::VKEY_TAB); });
sm_.ExpectSpeech("Expand to all apps");
// Press space on expand arrow to go to fullscreen launcher.
sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_SPACE); });
sm_.ExpectSpeech("Launcher, all apps");
// Now press the right arrow and we should be focused on an app button // Move focus to first app;
// in a dialog. sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_RIGHT); });
// THis doesn't work though (to be done below). sm_.ExpectSpeech("Item 0");
sm_.ExpectSpeech("Button");
// TODO(newcomer): reimplement this test once the AppListFocus changes are // Move the first item to the right.
// complete (http://crbug.com/784942). sm_.Call([this]() { SendKeyPressWithControl(ui::VKEY_RIGHT); });
sm_.ExpectSpeech("Alert");
sm_.ExpectSpeech("Moved to Page 1, row 1, column 2.");
// Move the focused item down.
sm_.Call([this]() { SendKeyPressWithControl(ui::VKEY_DOWN); });
sm_.ExpectSpeech("Alert");
sm_.ExpectSpeech("Moved to Page 1, row 2, column 2.");
// Move the focused item down.
sm_.Call([this]() { SendKeyPressWithControl(ui::VKEY_DOWN); });
sm_.ExpectSpeech("Alert");
sm_.ExpectSpeech("Moved to Page 1, row 3, column 2.");
// Move the focused item down.
sm_.Call([this]() { SendKeyPressWithControl(ui::VKEY_DOWN); });
sm_.ExpectSpeech("Alert");
sm_.ExpectSpeech("Moved to Page 1, row 4, column 2.");
// Move the focused item down to page 2.
sm_.Call([this]() { SendKeyPressWithControl(ui::VKEY_DOWN); });
sm_.ExpectSpeech("Alert");
sm_.ExpectSpeech("Moved to Page 2, row 1, column 2.");
// Move the focused item to the left.
sm_.Call([this]() { SendKeyPressWithControl(ui::VKEY_LEFT); });
sm_.ExpectSpeech("Alert");
sm_.ExpectSpeech("Moved to Page 2, row 1, column 1.");
// Move the focused item back up to page 1..
sm_.Call([this]() { SendKeyPressWithControl(ui::VKEY_UP); });
sm_.ExpectSpeech("Alert");
sm_.ExpectSpeech("Moved to Page 1, row 4, column 1.");
sm_.Replay(); sm_.Replay();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment