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

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 f3876ec5f2d7348f9363e70007c60723fdd98d75..b6a11dd9dcaab28ae3e221b41e11286f7717a0ac 100644
--- a/athena/wm/window_manager_unittest.cc
+++ b/athena/wm/window_manager_unittest.cc
@@ -94,12 +94,50 @@ TEST_F(WindowManagerTest, OverviewToSplitViewMode) {
// Go into split-view mode.
WindowOverviewModeDelegate* overview_delegate = wm_api.wm();
- overview_delegate->OnSplitViewMode(w3.get(), NULL);
+ overview_delegate->OnSelectSplitViewWindow(w3.get(), NULL, w3.get());
EXPECT_TRUE(w3->IsVisible());
EXPECT_TRUE(w2->IsVisible());
EXPECT_FALSE(w1->IsVisible());
}
+TEST_F(WindowManagerTest, NewWindowFromOverview) {
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> w1(CreateAndActivateWindow(&delegate));
+ scoped_ptr<aura::Window> w2(CreateAndActivateWindow(&delegate));
+
+ WindowManager::GetInstance()->ToggleOverview();
+ EXPECT_TRUE(w1->IsVisible());
+ EXPECT_TRUE(w2->IsVisible());
+
+ // Test that opening a new window exits overview mode. The new window could
+ // have been opened by JavaScript or by the home card.
+ scoped_ptr<aura::Window> w3(CreateAndActivateWindow(&delegate));
+
+ ASSERT_FALSE(WindowManager::GetInstance()->IsOverviewModeActive());
+ EXPECT_TRUE(w3->IsVisible());
+ EXPECT_TRUE(wm::IsActiveWindow(w3.get()));
+ EXPECT_FALSE(w1->IsVisible());
+ EXPECT_FALSE(w2->IsVisible());
+}
+
+TEST_F(WindowManagerTest, OverviewZeroWindows) {
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> w(CreateAndActivateWindow(&delegate));
+
+ WindowManager* wm = WindowManager::GetInstance();
+ wm->ToggleOverview();
+ ASSERT_TRUE(wm->IsOverviewModeActive());
+ EXPECT_TRUE(w->IsVisible());
+
+ w.reset();
+ EXPECT_TRUE(wm->IsOverviewModeActive());
+
+ // It should not be possible to exit overview mode if there are no windows
+ // open.
+ wm->ToggleOverview();
+ EXPECT_TRUE(wm->IsOverviewModeActive());
+}
+
TEST_F(WindowManagerTest, BezelGestureToSplitViewMode) {
aura::test::TestWindowDelegate delegate;
scoped_ptr<aura::Window> first(CreateAndActivateWindow(&delegate));

Powered by Google App Engine
This is Rietveld 408576698