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

Side by Side 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, 6 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" 5 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/screen_util.h" 8 #include "ash/screen_util.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 1148
1149 // Try the same again and see that nothing changes. 1149 // Try the same again and see that nothing changes.
1150 generator.GestureTapAt( 1150 generator.GestureTapAt(
1151 gfx::Point(100, Shell::GetPrimaryRootWindow()->bounds().bottom() - 1)); 1151 gfx::Point(100, Shell::GetPrimaryRootWindow()->bounds().bottom() - 1));
1152 EXPECT_FALSE(foreground_window_state->IsFullscreen()); 1152 EXPECT_FALSE(foreground_window_state->IsFullscreen());
1153 EXPECT_TRUE(background_window_state->IsFullscreen()); 1153 EXPECT_TRUE(background_window_state->IsFullscreen());
1154 1154
1155 DestroyMaximizeModeWindowManager(); 1155 DestroyMaximizeModeWindowManager();
1156 } 1156 }
1157 1157
1158 // Test that an edge swipe from the top on an immersive mode window will not end
1159 // full screen mode.
1160 TEST_F(MaximizeModeWindowManagerTest, NoExitImmersiveModeWithEdgeSwipeFromTop) {
1161 scoped_ptr<aura::Window> window(CreateWindow(ui::wm::WINDOW_TYPE_NORMAL,
1162 gfx::Rect(10, 10, 200, 50)));
1163 wm::WindowState* window_state = wm::GetWindowState(window.get());
1164 wm::ActivateWindow(window.get());
1165 CreateMaximizeModeWindowManager();
1166
1167 // Fullscreen the window.
1168 wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN);
1169 window_state->OnWMEvent(&event);
1170 EXPECT_TRUE(window_state->IsFullscreen());
1171 EXPECT_FALSE(window_state->in_immersive_fullscreen());
1172 EXPECT_EQ(window.get(), wm::GetActiveWindow());
1173
1174 window_state->set_in_immersive_fullscreen(true);
1175
1176 // Do an edge swipe top into screen.
1177 aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
1178 generator.GestureScrollSequence(gfx::Point(50, 0),
1179 gfx::Point(50, 100),
1180 base::TimeDelta::FromMilliseconds(20),
1181 10);
1182
1183 // It should have not exited full screen or immersive mode.
1184 EXPECT_TRUE(window_state->IsFullscreen());
1185 EXPECT_TRUE(window_state->in_immersive_fullscreen());
1186
1187 DestroyMaximizeModeWindowManager();
1188 }
1189
1190 // Test that an edge swipe from the bottom will not end immersive mode.
1191 TEST_F(MaximizeModeWindowManagerTest,
1192 NoExitImmersiveModeWithEdgeSwipeFromBottom) {
1193 scoped_ptr<aura::Window> window(CreateWindow(ui::wm::WINDOW_TYPE_NORMAL,
1194 gfx::Rect(10, 10, 200, 50)));
1195 wm::WindowState* window_state = wm::GetWindowState(window.get());
1196 wm::ActivateWindow(window.get());
1197 CreateMaximizeModeWindowManager();
1198
1199 // Fullscreen the window.
1200 wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN);
1201 window_state->OnWMEvent(&event);
1202 EXPECT_TRUE(window_state->IsFullscreen());
1203 EXPECT_FALSE(window_state->in_immersive_fullscreen());
1204 EXPECT_EQ(window.get(), wm::GetActiveWindow());
1205 window_state->set_in_immersive_fullscreen(true);
1206 EXPECT_TRUE(window_state->in_immersive_fullscreen());
1207
1208 // Do an edge swipe bottom into screen.
1209 aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
1210 int y = Shell::GetPrimaryRootWindow()->bounds().bottom();
1211 generator.GestureScrollSequence(gfx::Point(50, y),
1212 gfx::Point(50, y - 100),
1213 base::TimeDelta::FromMilliseconds(20),
1214 10);
1215
1216 // The window should still be full screen and immersive.
1217 EXPECT_TRUE(window_state->IsFullscreen());
1218 EXPECT_TRUE(window_state->in_immersive_fullscreen());
1219
1220 DestroyMaximizeModeWindowManager();
1221 }
1222
1158 #endif // OS_WIN 1223 #endif // OS_WIN
1159 1224
1160 } // namespace ash 1225 } // namespace ash
OLDNEW
« 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