Commit 3892fa44 authored by mukai@chromium.org's avatar mukai@chromium.org

Add test of mouse-click to invoke home card.

BUG=403813
TEST=athena_unittests
R=oshima@chromium.org

Review URL: https://codereview.chromium.org/496793004

Cr-Commit-Position: refs/heads/master@{#291311}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291311 0039d316-1c4b-4281-b951-d872f2087c98
parent 699245a8
......@@ -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
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