OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/public/cpp/config.h" | 8 #include "ash/public/cpp/config.h" |
9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // which is much bigger than the actual app list size). | 182 // which is much bigger than the actual app list size). |
183 | 183 |
184 app_list::AppListView* app_list = app_list_presenter_impl()->GetView(); | 184 app_list::AppListView* app_list = app_list_presenter_impl()->GetView(); |
185 int app_list_view_top = | 185 int app_list_view_top = |
186 app_list->anchor_rect().y() - app_list->bounds().height() / 2; | 186 app_list->anchor_rect().y() - app_list->bounds().height() / 2; |
187 const int kMinimalAppListMargin = 10; | 187 const int kMinimalAppListMargin = 10; |
188 | 188 |
189 EXPECT_GE(app_list_view_top, kMinimalAppListMargin); | 189 EXPECT_GE(app_list_view_top, kMinimalAppListMargin); |
190 } | 190 } |
191 | 191 |
| 192 // Tests that the peeking app list is enlarged to fullscreen after the user |
| 193 // types in the search box. |
| 194 TEST_F(AppListPresenterDelegateTest, SnapToFullscreenAfterSearchboxInput) { |
| 195 // TODO(newcomer): investigate failure in mash. http://crbug.com/726838. |
| 196 if (Shell::GetAshConfig() == Config::MASH) |
| 197 return; |
| 198 |
| 199 EnableFullscreenAppList(); |
| 200 UpdateDisplay("1024x768"); |
| 201 EXPECT_TRUE(app_list::features::IsFullscreenAppListEnabled()); |
| 202 app_list_presenter_impl()->Show(GetPrimaryDisplayId()); |
| 203 app_list::AppListView* app_list = app_list_presenter_impl()->GetView(); |
| 204 // Check that it is in peeking mode. |
| 205 EXPECT_FALSE(app_list->is_fullscreen()); |
| 206 |
| 207 // Dummy key event to search box. |
| 208 ui::test::EventGenerator& generator = GetEventGenerator(); |
| 209 generator.PressKey(ui::KeyboardCode::VKEY_0, 0); |
| 210 // Check that it is in fullscreen mode. |
| 211 EXPECT_TRUE(app_list->is_fullscreen()); |
| 212 } |
| 213 |
192 // Tests that the peeking app list closes if the user taps outside its | 214 // Tests that the peeking app list closes if the user taps outside its |
193 // bounds. | 215 // bounds. |
194 TEST_F(AppListPresenterDelegateTest, TapAndClickOutsideClosesPeekingAppList) { | 216 TEST_F(AppListPresenterDelegateTest, TapAndClickOutsideClosesPeekingAppList) { |
195 EnableFullscreenAppList(); | 217 EnableFullscreenAppList(); |
196 | 218 |
197 app_list_presenter_impl()->Show(GetPrimaryDisplayId()); | 219 app_list_presenter_impl()->Show(GetPrimaryDisplayId()); |
198 EXPECT_TRUE(app_list_presenter_impl()->GetTargetVisibility()); | 220 EXPECT_TRUE(app_list_presenter_impl()->GetTargetVisibility()); |
199 ui::test::EventGenerator& generator = GetEventGenerator(); | 221 ui::test::EventGenerator& generator = GetEventGenerator(); |
200 | 222 |
201 // Grab the bounds of the search box, | 223 // Grab the bounds of the search box, |
(...skipping 22 matching lines...) Expand all Loading... |
224 app_list_presenter_impl()->Show(GetPrimaryDisplayId()); | 246 app_list_presenter_impl()->Show(GetPrimaryDisplayId()); |
225 EXPECT_TRUE(app_list_presenter_impl()->GetTargetVisibility()); | 247 EXPECT_TRUE(app_list_presenter_impl()->GetTargetVisibility()); |
226 | 248 |
227 // Clicking outside the bounds closes the app list. | 249 // Clicking outside the bounds closes the app list. |
228 generator.MoveMouseTo(tap_point); | 250 generator.MoveMouseTo(tap_point); |
229 generator.ClickLeftButton(); | 251 generator.ClickLeftButton(); |
230 EXPECT_FALSE(app_list_presenter_impl()->GetTargetVisibility()); | 252 EXPECT_FALSE(app_list_presenter_impl()->GetTargetVisibility()); |
231 } | 253 } |
232 | 254 |
233 } // namespace ash | 255 } // namespace ash |
OLD | NEW |