Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(908)

Unified Diff: athena/home/home_card_unittest.cc

Issue 496793004: Add test of mouse-click to invoke home card. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698