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

Side by Side Diff: ash/app_list/app_list_presenter_delegate_unittest.cc

Issue 2946363002: Added 1 liner to fix shelf background hiding on side shelf alignment. (Closed)
Patch Set: Added 1 liner to fix shelf background hiding on side shelf alignment. Created 3 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
« no previous file with comments | « no previous file | ash/shelf/shelf_layout_manager.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 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
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 shelf
237 // alignment.
238 TEST_F(AppListPresenterDelegateTest,
239 ShelfBackgroundRespondsToAppListBeingShown) {
240 // TODO(newcomer): Investigate mash failures crbug.com/726838
241 if (Shell::GetAshConfig() == Config::MASH)
242 return;
243 EnableFullscreenAppList();
244 GetPrimaryShelf()->SetAlignment(SHELF_ALIGNMENT_BOTTOM);
245
246 // Show the app list, the shelf background should be transparent.
247 app_list_presenter_impl()->Show(GetPrimaryDisplayId());
248 ShelfLayoutManager* shelf_layout_manager =
249 GetPrimaryShelf()->shelf_layout_manager();
250 EXPECT_EQ(shelf_layout_manager->GetShelfBackgroundType(),
251 SHELF_BACKGROUND_DEFAULT);
252 app_list_presenter_impl()->Dismiss();
253
254 // Set the alignment to the side and show the app list. The background should
255 // show.
256 GetPrimaryShelf()->SetAlignment(ShelfAlignment::SHELF_ALIGNMENT_LEFT);
257 app_list_presenter_impl()->Show(GetPrimaryDisplayId());
258 EXPECT_TRUE(app_list::features::IsFullscreenAppListEnabled());
259 EXPECT_FALSE(GetPrimaryShelf()->IsHorizontalAlignment());
260 EXPECT_EQ(GetPrimaryShelf()->shelf_layout_manager()->
261 GetShelfBackgroundType(),
262 SHELF_BACKGROUND_DEFAULT);
263 }
264
233 } // namespace ash 265 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/shelf/shelf_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698