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

Unified Diff: athena/wm/window_manager_unittest.cc

Issue 546123002: Ensure that an activity is activated when overview mode is exited (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
Index: athena/wm/window_manager_unittest.cc
diff --git a/athena/wm/window_manager_unittest.cc b/athena/wm/window_manager_unittest.cc
index 0f03ae12ce2229b7ae13b6349965fb06353452b6..af2bec1d282b3c762d5cc2e41dc74d54d0a725c1 100644
--- a/athena/wm/window_manager_unittest.cc
+++ b/athena/wm/window_manager_unittest.cc
@@ -60,9 +60,16 @@ TEST_F(WindowManagerTest, OverviewModeBasics) {
first->bounds().size().ToString());
EXPECT_FALSE(WindowManager::GetInstance()->IsOverviewModeActive());
- // Tests that going into overview mode does not change the window bounds.
WindowManager::GetInstance()->ToggleOverview();
ASSERT_TRUE(WindowManager::GetInstance()->IsOverviewModeActive());
+
+ // |second| should no longer be active. If |second| were to stay active, it
+ // would be possible to type text into a text field in |second| and to stay
+ // in overview mode.
+ EXPECT_FALSE(wm::IsActiveWindow(first.get()));
+ EXPECT_FALSE(wm::IsActiveWindow(second.get()));
+
+ // Entering overview mode should not have changed the window bounds.
EXPECT_EQ(first->bounds().ToString(), second->bounds().ToString());
EXPECT_EQ(gfx::Screen::GetNativeScreen()
->GetPrimaryDisplay()
@@ -79,6 +86,7 @@ TEST_F(WindowManagerTest, OverviewModeBasics) {
ASSERT_FALSE(WindowManager::GetInstance()->IsOverviewModeActive());
EXPECT_FALSE(first->IsVisible());
EXPECT_TRUE(second->IsVisible());
+ EXPECT_TRUE(wm::IsActiveWindow(second.get()));
}
TEST_F(WindowManagerTest, OverviewToSplitViewMode) {
@@ -97,10 +105,12 @@ TEST_F(WindowManagerTest, OverviewToSplitViewMode) {
// Go into split-view mode.
WindowOverviewModeDelegate* overview_delegate = wm_api.wm();
- overview_delegate->OnSplitViewMode(NULL, w2.get());
+ overview_delegate->OnSelectWindow(w2.get(),
+ WindowOverviewModeDelegate::SPLIT_LEFT);
EXPECT_TRUE(w3->IsVisible());
EXPECT_TRUE(w2->IsVisible());
EXPECT_FALSE(w1->IsVisible());
+ EXPECT_TRUE(wm::IsActiveWindow(w2.get()));
}
TEST_F(WindowManagerTest, BezelGestureToSplitViewMode) {
@@ -364,9 +374,11 @@ TEST_F(WindowManagerTest, OverviewModeFromSplitMode) {
EXPECT_EQ(w2.get(), wm_api.GetSplitViewController()->right_window());
WindowOverviewModeDelegate* overview_delegate = wm_api.wm();
- overview_delegate->OnSelectWindow(w1.get());
+ overview_delegate->OnSelectWindow(w1.get(),
+ WindowOverviewModeDelegate::SPLIT_NONE);
EXPECT_FALSE(wm_api.GetSplitViewController()->IsSplitViewModeActive());
EXPECT_TRUE(w1->IsVisible());
+ EXPECT_TRUE(wm::IsActiveWindow(w1.get()));
// Make sure the windows that were in split-view mode are hidden.
EXPECT_FALSE(w2->IsVisible());
EXPECT_FALSE(w3->IsVisible());

Powered by Google App Engine
This is Rietveld 408576698