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

Unified Diff: athena/wm/window_manager_unittest.cc

Issue 465983002: Add shoftcut (ctrl-f6) to toggle split view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 705e730eae46e2547081aec86d96ba6cfee9d45b..41d949c628ecdf7b947b74f6df7cb7476420565a 100644
--- a/athena/wm/window_manager_unittest.cc
+++ b/athena/wm/window_manager_unittest.cc
@@ -282,4 +282,39 @@ TEST_F(WindowManagerTest, NewWindowBounds) {
wm_api.split_view_controller()->left_window()->bounds().ToString());
}
+TEST_F(WindowManagerTest, SplitModeActivationByShortcut) {
+ WindowManagerImplTestApi wm_api;
+
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> w1(CreateTestWindow(&delegate, gfx::Rect()));
+ w1->Show();
+
+ ui::test::EventGenerator generator(root_window());
+
+ // Splitview mode needs at least two windows.
+ generator.PressKey(ui::VKEY_F6, ui::EF_CONTROL_DOWN);
+ generator.ReleaseKey(ui::VKEY_F6, ui::EF_CONTROL_DOWN);
+ EXPECT_FALSE(wm_api.split_view_controller()->IsSplitViewModeActive());
+
+ scoped_ptr<aura::Window> w2(CreateTestWindow(&delegate, gfx::Rect()));
+ w2->Show();
+
+ generator.PressKey(ui::VKEY_F6, ui::EF_CONTROL_DOWN);
+ generator.ReleaseKey(ui::VKEY_F6, ui::EF_CONTROL_DOWN);
+ EXPECT_TRUE(wm_api.split_view_controller()->IsSplitViewModeActive());
+ int width =
+ gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area().width();
+
+ EXPECT_EQ(width / 2, w1->bounds().width());
+ EXPECT_EQ(width / 2, w2->bounds().width());
+
+ // Toggle back to normal mode.
+ generator.PressKey(ui::VKEY_F6, ui::EF_CONTROL_DOWN);
+ generator.ReleaseKey(ui::VKEY_F6, ui::EF_CONTROL_DOWN);
+ EXPECT_FALSE(wm_api.split_view_controller()->IsSplitViewModeActive());
+
+ EXPECT_EQ(width, w1->bounds().width());
+ EXPECT_EQ(width, w2->bounds().width());
+}
+
} // 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