| Index: athena/home/home_card_unittest.cc
|
| diff --git a/athena/home/home_card_unittest.cc b/athena/home/home_card_unittest.cc
|
| index 31d0de1203c7fca93c893b486162169f767ac7a3..86b9cd115b28058103f7038ec5a1a125c17136fe 100644
|
| --- a/athena/home/home_card_unittest.cc
|
| +++ b/athena/home/home_card_unittest.cc
|
| @@ -8,6 +8,7 @@
|
| #include "athena/activity/public/activity_manager.h"
|
| #include "athena/test/athena_test_base.h"
|
| #include "athena/wm/public/window_manager.h"
|
| +#include "ui/aura/window.h"
|
| #include "ui/events/test/event_generator.h"
|
|
|
| namespace athena {
|
| @@ -82,4 +83,24 @@ TEST_F(HomeCardTest, Accelerators) {
|
| EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState());
|
| }
|
|
|
| +TEST_F(HomeCardTest, MouseClick) {
|
| + ASSERT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState());
|
| +
|
| + // Mouse click at the bottom of the screen should invokes overview mode and
|
| + // changes the state to BOTTOM.
|
| + ui::test::EventGenerator generator(root_window());
|
| + gfx::Rect screen_rect(root_window()->bounds());
|
| + generator.MoveMouseTo(gfx::Point(
|
| + screen_rect.x() + screen_rect.width() / 2, screen_rect.bottom() - 1));
|
| + generator.ClickLeftButton();
|
| +
|
| + EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState());
|
| + EXPECT_TRUE(WindowManager::GetInstance()->IsOverviewModeActive());
|
| +
|
| + // Further clicks are simply ignored.
|
| + generator.ClickLeftButton();
|
| + EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState());
|
| + EXPECT_TRUE(WindowManager::GetInstance()->IsOverviewModeActive());
|
| +}
|
| +
|
| } // namespace athena
|
|
|