Commit 535aad60 authored by Andrew Xu's avatar Andrew Xu Committed by Commit Bot

Prepare to enable Hotseat flag in M-81 - Part 4

(1) In shelf_view_unittest.cc, the test waits until the shelf app
removal animation finishes.

(2) In power_button_controller_unittest.cc, tap location is changed to
fix the test.

TBR=xiyuan@chromium.org

Bug: 1032702
Change-Id: Iab90a15618dcf7c014770f24b25e69c7530e1f7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1981132Reviewed-by: default avatarAndrew Xu <andrewxu@chromium.org>
Commit-Queue: Andrew Xu <andrewxu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#727283}
parent de571429
...@@ -1068,6 +1068,9 @@ TEST_F(ShelfViewTest, ModelChangesWhileDragging) { ...@@ -1068,6 +1068,9 @@ TEST_F(ShelfViewTest, ModelChangesWhileDragging) {
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
shelf_view_->PointerReleasedOnButton(dragged_button, ShelfView::MOUSE, false); shelf_view_->PointerReleasedOnButton(dragged_button, ShelfView::MOUSE, false);
// Waits until app removal animation finishes.
test_api_->RunMessageLoopUntilAnimationsDone();
// Adding a shelf item cancels the drag and respects the order. // Adding a shelf item cancels the drag and respects the order.
dragged_button = SimulateDrag(ShelfView::MOUSE, 0, 2, false); dragged_button = SimulateDrag(ShelfView::MOUSE, 0, 2, false);
ShelfID new_id = AddAppShortcut(); ShelfID new_id = AddAppShortcut();
......
...@@ -131,8 +131,10 @@ class PowerButtonControllerTest : public PowerButtonTestBase { ...@@ -131,8 +131,10 @@ class PowerButtonControllerTest : public PowerButtonTestBase {
// Tap outside of the menu view to dismiss the menu. // Tap outside of the menu view to dismiss the menu.
void TapToDismissPowerButtonMenu() { void TapToDismissPowerButtonMenu() {
gfx::Rect menu_bounds = power_button_test_api_->GetMenuBoundsInScreen(); gfx::Rect menu_bounds = power_button_test_api_->GetMenuBoundsInScreen();
GetEventGenerator()->GestureTapAt( gfx::Point point = menu_bounds.bottom_right();
gfx::Point(menu_bounds.x() - 5, menu_bounds.y() - 5)); point.Offset(5, 5);
GetEventGenerator()->GestureTapAt(point);
EXPECT_FALSE(power_button_test_api_->IsMenuOpened()); EXPECT_FALSE(power_button_test_api_->IsMenuOpened());
} }
......
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