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

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: fixed 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.cc » ('j') | ash/shelf/shelf_layout_manager.cc » ('J')
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/side shelf
237 // alignment.
238 TEST_F(AppListPresenterDelegateTest,
239 ShelfBackgroundRespondsToAppListBeingShown) {
240 EnableFullscreenAppList();
241 Shelf* shelf =
James Cook 2017/06/21 23:57:32 nit: You can just do GetPrimaryShelf(). It's a me
newcomer 2017/06/22 00:16:09 Wow Awesome. Thanks!
242 Shelf::ForWindow(Shell::GetRootWindowForDisplayId(GetPrimaryDisplayId()));
243 shelf->SetAlignment(SHELF_ALIGNMENT_BOTTOM);
244
245 // Show the app list, the shelf background should be hidden.
James Cook 2017/06/21 23:57:32 super-nit: "hidden" sounds like shelf autohide. I
newcomer 2017/06/22 00:16:08 Done.
246 app_list_presenter_impl()->Show(GetPrimaryDisplayId());
247 ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager();
248 EXPECT_EQ(shelf_layout_manager->GetShelfBackgroundType(),
249 SHELF_BACKGROUND_DEFAULT);
250 app_list_presenter_impl()->Dismiss();
251 // Set the alignment to the side and show the app list. The background should
vadimt 2017/06/21 23:45:32 nit: empty line before
newcomer 2017/06/22 00:16:08 Done.
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 }
233 } // namespace ash 258 } // namespace ash
James Cook 2017/06/21 23:57:32 nit: blank line above
newcomer 2017/06/22 00:16:08 Done.
OLDNEW
« no previous file with comments | « no previous file | ash/shelf/shelf_layout_manager.cc » ('j') | ash/shelf/shelf_layout_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698