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/shelf_types.h" |
9 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| 11 #include "ash/shelf/shelf.h" |
| 12 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shell.h" | 13 #include "ash/shell.h" |
11 #include "ash/test/ash_test_base.h" | 14 #include "ash/test/ash_test_base.h" |
12 #include "ash/test/test_app_list_view_presenter_impl.h" | 15 #include "ash/test/test_app_list_view_presenter_impl.h" |
13 #include "ash/wm/window_util.h" | 16 #include "ash/wm/window_util.h" |
14 #include "base/command_line.h" | 17 #include "base/command_line.h" |
15 #include "base/macros.h" | 18 #include "base/macros.h" |
16 #include "base/test/scoped_feature_list.h" | 19 #include "base/test/scoped_feature_list.h" |
17 #include "ui/app_list/app_list_features.h" | 20 #include "ui/app_list/app_list_features.h" |
18 #include "ui/app_list/app_list_switches.h" | 21 #include "ui/app_list/app_list_switches.h" |
19 #include "ui/app_list/views/app_list_main_view.h" | 22 #include "ui/app_list/views/app_list_main_view.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 226 |
224 app_list_presenter_impl()->Show(GetPrimaryDisplayId()); | 227 app_list_presenter_impl()->Show(GetPrimaryDisplayId()); |
225 EXPECT_TRUE(app_list_presenter_impl()->GetTargetVisibility()); | 228 EXPECT_TRUE(app_list_presenter_impl()->GetTargetVisibility()); |
226 | 229 |
227 // Clicking outside the bounds closes the app list. | 230 // Clicking outside the bounds closes the app list. |
228 generator.MoveMouseTo(tap_point); | 231 generator.MoveMouseTo(tap_point); |
229 generator.ClickLeftButton(); | 232 generator.ClickLeftButton(); |
230 EXPECT_FALSE(app_list_presenter_impl()->GetTargetVisibility()); | 233 EXPECT_FALSE(app_list_presenter_impl()->GetTargetVisibility()); |
231 } | 234 } |
232 | 235 |
| 236 // Tests that the shelf background displays/hides with bottom/side shelf |
| 237 // alignment. |
| 238 TEST_F(AppListPresenterDelegateTest, |
| 239 ShelfBackgroundRespondsToAppListBeingShown) { |
| 240 EnableFullscreenAppList(); |
| 241 Shelf* shelf = GetPrimaryShelf(); |
| 242 shelf->SetAlignment(SHELF_ALIGNMENT_BOTTOM); |
| 243 |
| 244 // Show the app list, the shelf background should be transparent. |
| 245 app_list_presenter_impl()->Show(GetPrimaryDisplayId()); |
| 246 ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); |
| 247 EXPECT_EQ(shelf_layout_manager->GetShelfBackgroundType(), |
| 248 SHELF_BACKGROUND_DEFAULT); |
| 249 app_list_presenter_impl()->Dismiss(); |
| 250 |
| 251 // Set the alignment to the side and show the app list. The background should |
| 252 // show. |
| 253 shelf->SetAlignment(ShelfAlignment::SHELF_ALIGNMENT_LEFT); |
| 254 app_list_presenter_impl()->Show(GetPrimaryDisplayId()); |
| 255 EXPECT_EQ(shelf_layout_manager->GetShelfBackgroundType(), |
| 256 SHELF_BACKGROUND_OVERLAP); |
| 257 } |
| 258 |
233 } // namespace ash | 259 } // namespace ash |
OLD | NEW |