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

Unified Diff: athena/home/home_card_unittest.cc

Issue 601333002: ESC accelerator and consistent overview mode for Athena homecard (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 6 years, 2 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 | « athena/home/home_card_impl.cc ('k') | athena/input/accelerator_manager_impl.h » ('j') | 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 e7b6d5e98eaaf5f15f02a9fac99f35df9955bf0f..fb31f7ce707c3c8ded8785eb0a673562036d928f 100644
--- a/athena/home/home_card_unittest.cc
+++ b/athena/home/home_card_unittest.cc
@@ -115,23 +115,44 @@ TEST_F(HomeCardTest, Accelerators) {
EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState());
ui::test::EventGenerator generator(root_window());
+
+ // CTRL+L toggles centered home card, check that overview mode follows
generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN);
EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState());
+ EXPECT_TRUE(WindowManager::Get()->IsOverviewModeActive());
+ generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN);
+ EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState());
+ EXPECT_FALSE(WindowManager::Get()->IsOverviewModeActive());
+ // ESC key hides centered home card
generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN);
+ EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState());
+ EXPECT_TRUE(WindowManager::Get()->IsOverviewModeActive());
+ generator.PressKey(ui::VKEY_ESCAPE, ui::EF_NONE);
EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState());
+ EXPECT_FALSE(WindowManager::Get()->IsOverviewModeActive());
- // Do nothing for BOTTOM
+ // Do nothing with bottom home card with CTRL+L, hide with ESC key
WindowManager::Get()->EnterOverview();
EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState());
+ EXPECT_TRUE(WindowManager::Get()->IsOverviewModeActive());
generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN);
EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState());
+ EXPECT_TRUE(WindowManager::Get()->IsOverviewModeActive());
+ generator.PressKey(ui::VKEY_ESCAPE, ui::EF_NONE);
+ EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState());
+ EXPECT_FALSE(WindowManager::Get()->IsOverviewModeActive());
// Do nothing if the centered state is a temporary state.
+ WindowManager::Get()->EnterOverview();
+ EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState());
+ EXPECT_TRUE(WindowManager::Get()->IsOverviewModeActive());
HomeCard::Get()->UpdateVirtualKeyboardBounds(gfx::Rect(0, 0, 100, 100));
EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState());
+ EXPECT_TRUE(WindowManager::Get()->IsOverviewModeActive());
generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN);
EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState());
+ EXPECT_TRUE(WindowManager::Get()->IsOverviewModeActive());
}
TEST_F(HomeCardTest, MouseClick) {
« no previous file with comments | « athena/home/home_card_impl.cc ('k') | athena/input/accelerator_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698