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

Unified Diff: ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc

Issue 309793005: Fixing problem with edge swipe exiting immersive mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test removed Created 6 years, 7 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 | « ash/wm/maximize_mode/maximize_mode_window_manager.cc ('k') | ash/wm/window_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
diff --git a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
index 5a7c9b17bd7aa784c80dd13038641d4074d95b22..9c59aa629973ca9bc1a262279c2b3bd6ca4ea745 100644
--- a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
+++ b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
@@ -1155,6 +1155,71 @@ TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtBottom) {
DestroyMaximizeModeWindowManager();
}
+// Test that an edge swipe from the top on an immersive mode window will not end
+// full screen mode.
+TEST_F(MaximizeModeWindowManagerTest, NoExitImmersiveModeWithEdgeSwipeFromTop) {
+ scoped_ptr<aura::Window> window(CreateWindow(ui::wm::WINDOW_TYPE_NORMAL,
+ gfx::Rect(10, 10, 200, 50)));
+ wm::WindowState* window_state = wm::GetWindowState(window.get());
+ wm::ActivateWindow(window.get());
+ CreateMaximizeModeWindowManager();
+
+ // Fullscreen the window.
+ wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN);
+ window_state->OnWMEvent(&event);
+ EXPECT_TRUE(window_state->IsFullscreen());
+ EXPECT_FALSE(window_state->in_immersive_fullscreen());
+ EXPECT_EQ(window.get(), wm::GetActiveWindow());
+
+ window_state->set_in_immersive_fullscreen(true);
+
+ // Do an edge swipe top into screen.
+ aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
+ generator.GestureScrollSequence(gfx::Point(50, 0),
+ gfx::Point(50, 100),
+ base::TimeDelta::FromMilliseconds(20),
+ 10);
+
+ // It should have not exited full screen or immersive mode.
+ EXPECT_TRUE(window_state->IsFullscreen());
+ EXPECT_TRUE(window_state->in_immersive_fullscreen());
+
+ DestroyMaximizeModeWindowManager();
+}
+
+// Test that an edge swipe from the bottom will not end immersive mode.
+TEST_F(MaximizeModeWindowManagerTest,
+ NoExitImmersiveModeWithEdgeSwipeFromBottom) {
+ scoped_ptr<aura::Window> window(CreateWindow(ui::wm::WINDOW_TYPE_NORMAL,
+ gfx::Rect(10, 10, 200, 50)));
+ wm::WindowState* window_state = wm::GetWindowState(window.get());
+ wm::ActivateWindow(window.get());
+ CreateMaximizeModeWindowManager();
+
+ // Fullscreen the window.
+ wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN);
+ window_state->OnWMEvent(&event);
+ EXPECT_TRUE(window_state->IsFullscreen());
+ EXPECT_FALSE(window_state->in_immersive_fullscreen());
+ EXPECT_EQ(window.get(), wm::GetActiveWindow());
+ window_state->set_in_immersive_fullscreen(true);
+ EXPECT_TRUE(window_state->in_immersive_fullscreen());
+
+ // Do an edge swipe bottom into screen.
+ aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
+ int y = Shell::GetPrimaryRootWindow()->bounds().bottom();
+ generator.GestureScrollSequence(gfx::Point(50, y),
+ gfx::Point(50, y - 100),
+ base::TimeDelta::FromMilliseconds(20),
+ 10);
+
+ // The window should still be full screen and immersive.
+ EXPECT_TRUE(window_state->IsFullscreen());
+ EXPECT_TRUE(window_state->in_immersive_fullscreen());
+
+ DestroyMaximizeModeWindowManager();
+}
+
#endif // OS_WIN
} // namespace ash
« no previous file with comments | « ash/wm/maximize_mode/maximize_mode_window_manager.cc ('k') | ash/wm/window_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698