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) { |