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

Unified Diff: athena/wm/window_manager_unittest.cc

Issue 481843002: athena: Fix window-layout in split-view mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge 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 | « athena/wm/window_manager_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/wm/window_manager_unittest.cc
diff --git a/athena/wm/window_manager_unittest.cc b/athena/wm/window_manager_unittest.cc
index 183e8cc10954539cd07d8e79e3ac16771a9bfd76..705e730eae46e2547081aec86d96ba6cfee9d45b 100644
--- a/athena/wm/window_manager_unittest.cc
+++ b/athena/wm/window_manager_unittest.cc
@@ -244,4 +244,42 @@ TEST_F(WindowManagerTest, TitleDragSwitchBetweenWindowsInSplitViewMode) {
EXPECT_EQ(third.get(), wm_api.split_view_controller()->right_window());
}
+TEST_F(WindowManagerTest, NewWindowBounds) {
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> first(CreateWindow(&delegate));
+
+ WindowManagerImplTestApi wm_api;
+ aura::client::ParentWindowWithContext(
+ first.get(), ScreenManager::Get()->GetContext(), gfx::Rect());
+ // The window should have the same size as the container.
+ const gfx::Size work_area =
+ gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area().size();
+ EXPECT_EQ(work_area.ToString(),
+ first->bounds().size().ToString());
+ EXPECT_TRUE(first->bounds().origin().IsOrigin());
+
+ // A second window should have the same bounds as the first one.
+ scoped_ptr<aura::Window> second(CreateWindow(&delegate));
+ aura::client::ParentWindowWithContext(
+ second.get(), ScreenManager::Get()->GetContext(), gfx::Rect());
+ EXPECT_EQ(first->bounds().ToString(), second->bounds().ToString());
+
+ // Get into split view.
+ wm_api.split_view_controller()->ActivateSplitMode(NULL, NULL);
+ const gfx::Rect left_bounds =
+ wm_api.split_view_controller()->left_window()->bounds();
+ EXPECT_NE(work_area.ToString(),
+ left_bounds.size().ToString());
+
+ scoped_ptr<aura::Window> third(CreateWindow(&delegate));
+ aura::client::ParentWindowWithContext(
+ third.get(), ScreenManager::Get()->GetContext(), gfx::Rect());
+ EXPECT_NE(wm_api.split_view_controller()->left_window(), third.get());
+ EXPECT_EQ(left_bounds.ToString(), third->bounds().ToString());
+
+ third->Hide();
+ EXPECT_EQ(left_bounds.ToString(),
+ wm_api.split_view_controller()->left_window()->bounds().ToString());
+}
+
} // namespace athena
« no previous file with comments | « athena/wm/window_manager_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698