0

Move keyboard test util methods into test namespace

Bug: None
Change-Id: I2d15352112d12d3e680df11436ddce32e90400de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5659439
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Commit-Queue: Jaewon Jung <jw.jung@navercorp.com>
Reviewed-by: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1321245}
This commit is contained in:
Jaewon Jung
2024-06-28 23:13:43 +00:00
committed by Chromium LUCI CQ
parent addaa509ca
commit c740009cd9
28 changed files with 77 additions and 77 deletions

@ -343,7 +343,7 @@ TEST_P(AppListControllerImplTest, VirtualKeyboardNotShownWhenUserStartsTyping) {
// The keyboard should get shown if the user taps on the search box.
GestureTapOn(GetAppListView()->search_box_view());
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
DismissAppListNow();
base::RunLoop().RunUntilIdle();
@ -440,11 +440,11 @@ TEST_P(AppListControllerImplTest,
// Tap at the textfield in |window1|. The virtual keyboard should be visible.
GestureTapOn(text_field_p);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
// Tap at the center of |window2| to hide the virtual keyboard.
GetEventGenerator()->GestureTapAt(window2->GetBoundsInScreen().CenterPoint());
ASSERT_TRUE(keyboard::WaitUntilHidden());
ASSERT_TRUE(keyboard::test::WaitUntilHidden());
// Press the home button to show the launcher. Wait for the animation of
// launcher to finish. Note that the launcher does not exist before toggling

@ -2276,7 +2276,7 @@ TEST_P(AppListBubbleAndTabletTest,
auto* const keyboard_ui_controller = keyboard::KeyboardUIController::Get();
keyboard_ui_controller->ShowKeyboard(false /* locked */);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
// Show remove suggestion dialog.
result_view->GetWidget()->LayoutRootViewIfNecessary();
@ -3360,7 +3360,7 @@ TEST_P(PopulatedAppListWithVKEnabledTest,
// Manually show the virtual keyboard.
auto* const keyboard_controller = keyboard::KeyboardUIController::Get();
keyboard_controller->ShowKeyboard(true /* locked */);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
// Touch the apps_grid outside of any apps. Expect that the keyboard is
// closed.
@ -3369,7 +3369,7 @@ TEST_P(PopulatedAppListWithVKEnabledTest,
// Reshow the VKeyboard
keyboard_controller->ShowKeyboard(true);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
// Touch the apps_grid between two apps. Expect that the keyboard is closed.
GetEventGenerator()->GestureTapAt(between_apps);
@ -4604,7 +4604,7 @@ TEST_P(AppListPresenterVirtualKeyboardTest,
// Manually show the virtual keyboard.
auto* const keyboard_controller = keyboard::KeyboardUIController::Get();
keyboard_controller->ShowKeyboard(true);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
// Tap or click outside the searchbox, the virtual keyboard should hide.
ClickOrTap(GetPointOutsideSearchbox());
@ -4638,7 +4638,7 @@ TEST_P(AppListPresenterVirtualKeyboardTest,
// Manually show the virtual keyboard.
auto* const keyboard_controller = keyboard::KeyboardUIController::Get();
keyboard_controller->ShowKeyboard(true);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
// Tap or click outside the searchbox, the virtual keyboard should hide and
// the searchbox should be inactive when there is no text in the searchbox.

@ -6504,7 +6504,7 @@ TEST_P(AppsGridViewTabletTest, ChangeFolderNameShouldUpdateShadows) {
// and shadow bounds.
auto* keyboard_controller = keyboard::KeyboardUIController::Get();
keyboard_controller->ShowKeyboard(false);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
gfx::Rect folder_bounds_with_keyboard =
folder_apps_grid_view()->GetBoundsInScreen();

@ -345,7 +345,8 @@ void AssistantAshTestBase::DismissKeyboard() {
bool AssistantAshTestBase::IsKeyboardShowing() const {
auto* keyboard_controller = keyboard::KeyboardUIController::Get();
return keyboard_controller->IsEnabled() && keyboard::IsKeyboardShowing();
return keyboard_controller->IsEnabled() &&
keyboard::test::IsKeyboardShowing();
}
TestAssistantService* AssistantAshTestBase::assistant_service() {

@ -515,7 +515,7 @@ TEST_F(KeyboardControllerImplTest, VisualBoundsInMultipleDisplays) {
keyboard_ui_controller()->ShowKeyboardInDisplay(
display::test::DisplayManagerTestApi(Shell::Get()->display_manager())
.GetSecondaryDisplay());
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
gfx::Rect root_bounds = keyboard_ui_controller()->visual_bounds_in_root();
EXPECT_EQ(0, root_bounds.x());
@ -533,7 +533,7 @@ TEST_F(KeyboardControllerImplTest, OccludedBoundsInMultipleDisplays) {
keyboard_ui_controller()->ShowKeyboardInDisplay(
display::test::DisplayManagerTestApi(Shell::Get()->display_manager())
.GetSecondaryDisplay());
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
gfx::Rect screen_bounds =
keyboard_ui_controller()->GetWorkspaceOccludedBoundsInScreen();
@ -690,7 +690,7 @@ TEST_F(KeyboardControllerImplTest, ShowKeyboardInSecondaryDisplay) {
keyboard_ui_controller()->ShowKeyboardInDisplay(GetSecondaryDisplay());
EXPECT_EQ(GetSecondaryRootWindow(),
keyboard_ui_controller()->GetRootWindow());
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
EXPECT_TRUE(
!keyboard_ui_controller()->GetKeyboardWindow()->bounds().IsEmpty());
}
@ -705,7 +705,7 @@ TEST_F(KeyboardControllerImplTest, SwipeUpToShowHotSeat) {
keyboard_controller()->SetEnableFlag(KeyboardEnableFlag::kExtensionEnabled);
keyboard_ui_controller()->ShowKeyboard(/* lock */ false);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
gfx::Rect display_bounds =
display::Screen::GetScreen()->GetPrimaryDisplay().bounds();
@ -717,7 +717,7 @@ TEST_F(KeyboardControllerImplTest, SwipeUpToShowHotSeat) {
num_scroll_steps);
// Keyboard should hide and gesture should forward to the shelf.
ASSERT_TRUE(keyboard::WaitUntilHidden());
ASSERT_TRUE(keyboard::test::WaitUntilHidden());
EXPECT_EQ(HotseatState::kExtended, GetShelfLayoutManager()->hotseat_state());
}
@ -731,7 +731,7 @@ TEST_F(KeyboardControllerImplTest, FlingUpToShowOverviewMode) {
keyboard_controller()->SetEnableFlag(KeyboardEnableFlag::kExtensionEnabled);
keyboard_ui_controller()->ShowKeyboard(/* lock */ false);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
gfx::Rect display_bounds =
display::Screen::GetScreen()->GetPrimaryDisplay().bounds();
@ -747,7 +747,7 @@ TEST_F(KeyboardControllerImplTest, FlingUpToShowOverviewMode) {
scroll_steps);
// Keyboard should hide and gesture should forward to the shelf.
ASSERT_TRUE(keyboard::WaitUntilHidden());
ASSERT_TRUE(keyboard::test::WaitUntilHidden());
EXPECT_EQ(HotseatState::kShownHomeLauncher,
GetShelfLayoutManager()->hotseat_state());
}
@ -760,7 +760,7 @@ TEST_F(KeyboardControllerImplTest, SwipeUpDoesntHideKeyboardInClamshellMode) {
keyboard_controller()->SetEnableFlag(KeyboardEnableFlag::kExtensionEnabled);
keyboard_ui_controller()->ShowKeyboard(/* lock */ false);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
gfx::Rect display_bounds =
display::Screen::GetScreen()->GetPrimaryDisplay().bounds();
@ -771,7 +771,7 @@ TEST_F(KeyboardControllerImplTest, SwipeUpDoesntHideKeyboardInClamshellMode) {
GetEventGenerator()->GestureScrollSequence(start, end, time_delta,
num_scroll_steps);
EXPECT_FALSE(keyboard::IsKeyboardHiding());
EXPECT_FALSE(keyboard::test::IsKeyboardHiding());
}
TEST_F(KeyboardControllerImplTest, RecordsKeyRepeatSettings) {

@ -25,7 +25,7 @@ aura::Window* TestKeyboardUI::LoadKeyboardWindow(LoadCallback callback) {
// Set a default size for the keyboard.
display::Screen* screen = display::Screen::GetScreen();
keyboard_window_->SetBounds(keyboard::KeyboardBoundsFromRootBounds(
keyboard_window_->SetBounds(keyboard::test::KeyboardBoundsFromRootBounds(
screen->GetPrimaryDisplay().bounds()));
// Simulate an asynchronous load.

@ -239,7 +239,7 @@ class KeyboardUIControllerTest : public aura::test::AuraTestBase,
if (client && client->GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE &&
client->GetTextInputMode() != ui::TEXT_INPUT_MODE_NONE) {
input_method->SetVirtualKeyboardVisibilityIfEnabled(true);
ASSERT_TRUE(WaitUntilShown());
ASSERT_TRUE(test::WaitUntilShown());
}
}

@ -65,8 +65,6 @@ bool WaitUntilLoaded() {
return true;
}
} // namespace test
bool WaitUntilShown() {
// KeyboardController send a visibility update once the show animation
// finishes.
@ -103,4 +101,6 @@ gfx::Rect KeyboardBoundsFromRootBounds(const gfx::Rect& root_bounds,
root_bounds.width(), keyboard_height);
}
} // namespace test
} // namespace keyboard

@ -13,14 +13,11 @@ class Rect;
namespace keyboard {
// TODO(shend): Move other methods into test namespace.
namespace test {
// Waits until the keyboard window finishes loading.
bool WaitUntilLoaded();
} // namespace test
// Waits until the keyboard is fully shown, with no pending animations.
bool WaitUntilShown();
@ -38,6 +35,8 @@ bool IsKeyboardHiding();
gfx::Rect KeyboardBoundsFromRootBounds(const gfx::Rect& root_bounds,
int keyboard_height = 100);
} // namespace test
} // namespace keyboard
#endif // ASH_KEYBOARD_UI_TEST_KEYBOARD_TEST_UTIL_H_

@ -43,7 +43,7 @@ aura::Window* TestKeyboardUIFactory::TestKeyboardUI::LoadKeyboardWindow(
// Set a default size for the keyboard.
display::Screen* screen = display::Screen::GetScreen();
window_->SetBounds(
KeyboardBoundsFromRootBounds(screen->GetPrimaryDisplay().bounds()));
test::KeyboardBoundsFromRootBounds(screen->GetPrimaryDisplay().bounds()));
// Simulate an asynchronous load.
base::SequencedTaskRunner::GetCurrentDefault()->PostTask(FROM_HERE,

@ -44,7 +44,7 @@ TEST_F(VirtualKeyboardTest, EventsAreHandledBasedOnHitTestBounds) {
auto* keyboard_controller = keyboard::KeyboardUIController::Get();
keyboard_controller->ShowKeyboard(false);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
// Add two hit test bounds (coordinates relative to keyboard window).
// Both are 10x10 squares, but placed in different locations.
@ -94,7 +94,7 @@ TEST_F(VirtualKeyboardTest, HitTestBoundsAreResetWhenContainerTypeChanges) {
auto* keyboard_controller = keyboard::KeyboardUIController::Get();
keyboard_controller->ShowKeyboard(false);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
// Set empty hit test bounds, so all events pass through to the background.
keyboard_controller->SetHitTestBounds(std::vector<gfx::Rect>());

@ -37,9 +37,9 @@ void LoginKeyboardTestBase::ShowKeyboard() {
// lock/login layout.
int height = Shell::GetPrimaryRootWindow()->bounds().height() / 2;
keyboard_controller->GetKeyboardWindow()->SetBounds(
keyboard::KeyboardBoundsFromRootBounds(
keyboard::test::KeyboardBoundsFromRootBounds(
Shell::GetPrimaryRootWindow()->bounds(), height));
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
}
void LoginKeyboardTestBase::HideKeyboard() {

@ -822,7 +822,7 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, RestoreWorkspaceAfterLogin) {
auto* controller = keyboard::KeyboardUIController::Get();
aura::Window* contents_window = controller->GetKeyboardWindow();
contents_window->SetBounds(
keyboard::KeyboardBoundsFromRootBounds(root_window->bounds(), 100));
keyboard::test::KeyboardBoundsFromRootBounds(root_window->bounds(), 100));
contents_window->Show();
gfx::Rect before =
@ -850,7 +850,7 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, ClickWithActiveModalDialog) {
ASSERT_EQ(root_window, controller->GetRootWindow());
controller->ShowKeyboard(false /* locked */);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
ui::test::TestEventHandler handler;
root_window->AddPreTargetHandler(&handler);
@ -891,7 +891,7 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, EnsureCaretInWorkArea) {
const int keyboard_height = 100;
aura::Window* contents_window = keyboard_controller->GetKeyboardWindow();
contents_window->SetBounds(keyboard::KeyboardBoundsFromRootBounds(
contents_window->SetBounds(keyboard::test::KeyboardBoundsFromRootBounds(
root_window->bounds(), keyboard_height));
contents_window->Show();
@ -927,7 +927,7 @@ TEST_F(VirtualKeyboardRootWindowControllerTest,
// Check that the keyboard on the primary screen doesn't cover the window on
// the secondary screen.
aura::Window* contents_window = keyboard_controller->GetKeyboardWindow();
contents_window->SetBounds(keyboard::KeyboardBoundsFromRootBounds(
contents_window->SetBounds(keyboard::test::KeyboardBoundsFromRootBounds(
primary_root_window->bounds(), keyboard_height));
contents_window->Show();
@ -942,7 +942,7 @@ TEST_F(VirtualKeyboardRootWindowControllerTest,
// Move the keyboard into the secondary display and check that the keyboard
// doesn't cover the window on the primary screen.
keyboard_controller->ShowKeyboardInDisplay(GetSecondaryDisplay());
contents_window->SetBounds(keyboard::KeyboardBoundsFromRootBounds(
contents_window->SetBounds(keyboard::test::KeyboardBoundsFromRootBounds(
secondary_root_window->bounds(), keyboard_height));
EnsureCaretInWorkArea(contents_window->GetBoundsInScreen());
@ -967,7 +967,7 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, ZOrderTest) {
const int keyboard_height = 200;
aura::Window* contents_window = keyboard_controller->GetKeyboardWindow();
gfx::Rect keyboard_bounds = keyboard::KeyboardBoundsFromRootBounds(
gfx::Rect keyboard_bounds = keyboard::test::KeyboardBoundsFromRootBounds(
root_window->bounds(), keyboard_height);
contents_window->SetBounds(keyboard_bounds);
contents_window->Show();
@ -1085,7 +1085,7 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, ClickDoesNotFocusKeyboard) {
auto* keyboard_controller = keyboard::KeyboardUIController::Get();
keyboard_controller->ShowKeyboard(false);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
aura::Window* keyboard_window = keyboard_controller->GetKeyboardWindow();
EXPECT_FALSE(keyboard_window->HasFocus());

@ -1188,7 +1188,7 @@ class ShelfWidgetVirtualKeyboardTest : public AshTestBase {
TEST_F(ShelfWidgetVirtualKeyboardTest, ClickingHidesVirtualKeyboard) {
keyboard_ui_controller()->ShowKeyboard(false /* locked */);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
ui::test::EventGenerator* generator = GetEventGenerator();
generator->set_current_screen_location(
@ -1196,12 +1196,12 @@ TEST_F(ShelfWidgetVirtualKeyboardTest, ClickingHidesVirtualKeyboard) {
generator->ClickLeftButton();
// Times out if test fails.
ASSERT_TRUE(keyboard::WaitUntilHidden());
ASSERT_TRUE(keyboard::test::WaitUntilHidden());
}
TEST_F(ShelfWidgetVirtualKeyboardTest, TappingHidesVirtualKeyboard) {
keyboard_ui_controller()->ShowKeyboard(false /* locked */);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
ui::test::EventGenerator* generator = GetEventGenerator();
generator->set_current_screen_location(
@ -1209,22 +1209,22 @@ TEST_F(ShelfWidgetVirtualKeyboardTest, TappingHidesVirtualKeyboard) {
generator->PressTouch();
// Times out if test fails.
ASSERT_TRUE(keyboard::WaitUntilHidden());
ASSERT_TRUE(keyboard::test::WaitUntilHidden());
}
TEST_F(ShelfWidgetVirtualKeyboardTest, DoesNotHideLockedVirtualKeyboard) {
keyboard_ui_controller()->ShowKeyboard(true /* locked */);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
ui::test::EventGenerator* generator = GetEventGenerator();
generator->set_current_screen_location(
GetShelfWidget()->GetWindowBoundsInScreen().CenterPoint());
generator->ClickLeftButton();
EXPECT_FALSE(keyboard::IsKeyboardHiding());
EXPECT_FALSE(keyboard::test::IsKeyboardHiding());
generator->PressTouch();
EXPECT_FALSE(keyboard::IsKeyboardHiding());
EXPECT_FALSE(keyboard::test::IsKeyboardHiding());
}
} // namespace

@ -545,7 +545,7 @@ TEST_F(EcheTrayTest, EcheTrayKeyboardShowHideUpdateBubbleBounds) {
// Place a keyboard window.
auto* keyboard_controller = keyboard::KeyboardUIController::Get();
keyboard_controller->ShowKeyboard(/*lock=*/true);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
EXPECT_EQ(expected_eche_size.width(),
eche_tray()->get_bubble_wrapper_for_test()->bubble_view()->width());

@ -447,7 +447,7 @@ TEST_F(StatusAreaWidgetVirtualKeyboardTest,
status->ime_menu_tray()->SetVisiblePreferred(true);
keyboard_ui_controller()->ShowKeyboard(false /* locked */);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
// The keyboard should hide when clicked.
ui::test::EventGenerator* generator = GetEventGenerator();
@ -456,7 +456,7 @@ TEST_F(StatusAreaWidgetVirtualKeyboardTest,
->GetBoundsInScreen()
.CenterPoint());
generator->ClickLeftButton();
ASSERT_TRUE(keyboard::WaitUntilHidden());
ASSERT_TRUE(keyboard::test::WaitUntilHidden());
}
// See https://crbug.com/897672.
@ -468,14 +468,14 @@ TEST_F(StatusAreaWidgetVirtualKeyboardTest,
status->ime_menu_tray()->SetVisiblePreferred(true);
keyboard_ui_controller()->ShowKeyboard(false /* locked */);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
// The keyboard should hide when tapped.
ui::test::EventGenerator* generator = GetEventGenerator();
generator->GestureTapAt(status->virtual_keyboard_tray_for_testing()
->GetBoundsInScreen()
.CenterPoint());
ASSERT_TRUE(keyboard::WaitUntilHidden());
ASSERT_TRUE(keyboard::test::WaitUntilHidden());
}
TEST_F(StatusAreaWidgetVirtualKeyboardTest, ClickingHidesVirtualKeyboard) {
@ -490,12 +490,12 @@ TEST_F(StatusAreaWidgetVirtualKeyboardTest, ClickingHidesVirtualKeyboard) {
generator->ClickLeftButton();
// Times out if test fails.
ASSERT_TRUE(keyboard::WaitUntilHidden());
ASSERT_TRUE(keyboard::test::WaitUntilHidden());
}
TEST_F(StatusAreaWidgetVirtualKeyboardTest, TappingHidesVirtualKeyboard) {
keyboard_ui_controller()->ShowKeyboard(false /* locked */);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
ui::test::EventGenerator* generator = GetEventGenerator();
generator->set_current_screen_location(
@ -505,12 +505,12 @@ TEST_F(StatusAreaWidgetVirtualKeyboardTest, TappingHidesVirtualKeyboard) {
generator->PressTouch();
// Times out if test fails.
ASSERT_TRUE(keyboard::WaitUntilHidden());
ASSERT_TRUE(keyboard::test::WaitUntilHidden());
}
TEST_F(StatusAreaWidgetVirtualKeyboardTest, DoesNotHideLockedVirtualKeyboard) {
keyboard_ui_controller()->ShowKeyboard(true /* locked */);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
ui::test::EventGenerator* generator = GetEventGenerator();
generator->set_current_screen_location(
@ -519,10 +519,10 @@ TEST_F(StatusAreaWidgetVirtualKeyboardTest, DoesNotHideLockedVirtualKeyboard) {
.CenterPoint());
generator->ClickLeftButton();
EXPECT_FALSE(keyboard::IsKeyboardHiding());
EXPECT_FALSE(keyboard::test::IsKeyboardHiding());
generator->PressTouch();
EXPECT_FALSE(keyboard::IsKeyboardHiding());
EXPECT_FALSE(keyboard::test::IsKeyboardHiding());
}
class StatusAreaWidgetCollapseStateTest : public AshTestBase {

@ -47,12 +47,12 @@ TEST_F(VirtualKeyboardTrayTest, PerformActionTogglesVirtualKeyboard) {
// First tap should show the virtual keyboard.
GestureTapOn(tray);
EXPECT_TRUE(tray->is_active());
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
// Second tap should hide the virtual keyboard.
GestureTapOn(tray);
EXPECT_FALSE(tray->is_active());
ASSERT_TRUE(keyboard::WaitUntilHidden());
ASSERT_TRUE(keyboard::test::WaitUntilHidden());
}
} // namespace ash

@ -83,7 +83,7 @@ TEST_F(AlwaysOnTopControllerTest, NotifyKeyboardBoundsChanging) {
EXPECT_FALSE(manager->keyboard_displacing_bounds_changed());
keyboard_controller->ShowKeyboard(true /* locked */);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
// Verify that test manager was notified of bounds change.
EXPECT_TRUE(manager->keyboard_displacing_bounds_changed());

@ -209,7 +209,7 @@ TEST_P(CollisionDetectionUtilsDisplayTest,
MovementAreaIncludesKeyboardIfKeyboardIsShown) {
auto* keyboard_controller = keyboard::KeyboardUIController::Get();
keyboard_controller->ShowKeyboardInDisplay(GetDisplay());
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
aura::Window* keyboard_window = keyboard_controller->GetKeyboardWindow();
constexpr int keyboard_height = 100;
@ -304,7 +304,7 @@ TEST_P(CollisionDetectionUtilsDisplayTest,
keyboard_controller->SetContainerType(keyboard::ContainerType::kFloating,
gfx::Rect(), base::DoNothing());
keyboard_controller->ShowKeyboardInDisplay(display);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
aura::Window* keyboard_window = keyboard_controller->GetKeyboardWindow();
keyboard_window->SetBounds(gfx::Rect(0, 0, 100, 100));
@ -406,7 +406,7 @@ TEST_P(CollisionDetectionUtilsDisplayTest, GetRestingPositionAvoidsKeyboard) {
auto* keyboard_controller = keyboard::KeyboardUIController::Get();
keyboard_controller->ShowKeyboardInDisplay(display);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
aura::Window* keyboard_window = keyboard_controller->GetKeyboardWindow();
constexpr int keyboard_height = 100;

@ -7798,7 +7798,7 @@ TEST_P(DesksTest, NameNudgesTabletMode) {
// created and the virtual keyboard should be shown.
ui::DeviceDataManagerTestApi().SetKeyboardDevices({});
GestureTapOnView(desks_bar_view->new_desk_button(), event_generator);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
EXPECT_TRUE(keyboard::KeyboardUIController::Get()->IsKeyboardVisible());
EXPECT_EQ(4u, desks_bar_view->mini_views().size());
desk_name_view = desks_bar_view->mini_views()[3]->desk_name_view();

@ -136,7 +136,7 @@ class LockActionHandlerLayoutManagerTest : public AshTestBase {
if (show) {
keyboard->ShowKeyboard(true);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
} else {
keyboard->HideKeyboardByUser();
}

@ -90,7 +90,7 @@ class LockLayoutManagerTest : public AshTestBase {
if (show) {
keyboard->ShowKeyboard(false);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
} else {
keyboard->HideKeyboardByUser();
}

@ -769,7 +769,7 @@ class OverviewVirtualKeyboardTest : public OverviewControllerTest {
keyboard::test::WaitUntilLoaded();
keyboard_ui_controller()->GetKeyboardWindow()->SetBounds(
keyboard::KeyboardBoundsFromRootBounds(
keyboard::test::KeyboardBoundsFromRootBounds(
Shell::GetPrimaryRootWindow()->bounds(), 100));
// Wait for keyboard window to load.
base::RunLoop().RunUntilIdle();
@ -782,21 +782,21 @@ class OverviewVirtualKeyboardTest : public OverviewControllerTest {
TEST_F(OverviewVirtualKeyboardTest, ToggleOverviewModeHidesVirtualKeyboard) {
keyboard_ui_controller()->ShowKeyboard(false /* locked */);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
EnterOverview();
// Timeout failure here if the keyboard does not hide.
keyboard::WaitUntilHidden();
keyboard::test::WaitUntilHidden();
}
TEST_F(OverviewVirtualKeyboardTest,
ToggleOverviewModeDoesNotHideLockedVirtualKeyboard) {
keyboard_ui_controller()->ShowKeyboard(true /* locked */);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
EnterOverview();
EXPECT_FALSE(keyboard::IsKeyboardHiding());
EXPECT_FALSE(keyboard::test::IsKeyboardHiding());
}
// Tests that frame throttling starts and ends accordingly when overview starts

@ -159,7 +159,7 @@ TEST_F(PipTest, PipInitialPositionAvoidsObstacles) {
auto* keyboard_controller = keyboard::KeyboardUIController::Get();
keyboard_controller->ShowKeyboard(/*lock=*/true);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
aura::Window* keyboard_window = keyboard_controller->GetKeyboardWindow();
keyboard_window->SetBounds(gfx::Rect(0, 300, 400, 100));
@ -175,7 +175,7 @@ TEST_F(PipTest, TargetBoundsAffectedByWorkAreaChange) {
// Place a keyboard window at the initial position of a PIP window.
auto* keyboard_controller = keyboard::KeyboardUIController::Get();
keyboard_controller->ShowKeyboard(/*lock=*/true);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
aura::Window* keyboard_window = keyboard_controller->GetKeyboardWindow();
keyboard_window->SetBounds(gfx::Rect(0, 300, 400, 100));
@ -308,7 +308,7 @@ TEST_F(PipTest, PipSnappedToEdgeWhenSavingSnapFraction) {
// edges.
auto* keyboard_controller = keyboard::KeyboardUIController::Get();
keyboard_controller->ShowKeyboardInDisplay(window_state->GetDisplay());
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
aura::Window* keyboard_window = keyboard_controller->GetKeyboardWindow();
keyboard_window->SetBounds(gfx::Rect(0, 300, 400, 100));

@ -605,7 +605,7 @@ TEST_P(PipWindowResizerTest, PipWindowFlungAvoidsFloatingKeyboard) {
base::DoNothing());
const display::Display display = WindowState::Get(window())->GetDisplay();
keyboard_controller->ShowKeyboardInDisplay(display);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
aura::Window* keyboard_window = keyboard_controller->GetKeyboardWindow();
keyboard_window->SetBounds(gfx::Rect(8, 150, 100, 100));

@ -171,7 +171,7 @@ class TestTextInputClient : public ui::DummyTextInputClient {
}
ime->SetVirtualKeyboardVisibilityIfEnabled(true);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
}
// When the text client is unfocused, hide the virtual keyboard.

@ -173,7 +173,7 @@ class SystemModalContainerLayoutManagerTest : public AshTestBase {
if (show) {
keyboard->ShowKeyboard(true /* lock */);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
} else {
keyboard->HideKeyboardByUser();
}

@ -2249,7 +2249,7 @@ TEST_F(WorkspaceLayoutManagerKeyboardTest,
// Open keyboard in sticky mode.
kb_controller->ShowKeyboard(true);
ASSERT_TRUE(keyboard::WaitUntilShown());
ASSERT_TRUE(keyboard::test::WaitUntilShown());
int shift =
work_area.height() - kb_controller->GetKeyboardWindow()->bounds().y();