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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/shelf/shelf_layout_manager.cc » ('j') | ash/shelf/shelf_layout_manager.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/app_list/app_list_presenter_delegate_unittest.cc
diff --git a/ash/app_list/app_list_presenter_delegate_unittest.cc b/ash/app_list/app_list_presenter_delegate_unittest.cc
index 42eaa1309f31e61eaa4f1b3f6c3277d04d1b6c8e..0b60cb45dfccbe34cf472dfd6bb31d012a186856 100644
--- a/ash/app_list/app_list_presenter_delegate_unittest.cc
+++ b/ash/app_list/app_list_presenter_delegate_unittest.cc
@@ -6,7 +6,10 @@
#include "ash/ash_switches.h"
#include "ash/public/cpp/config.h"
+#include "ash/public/cpp/shelf_types.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/shelf/shelf.h"
+#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/test_app_list_view_presenter_impl.h"
@@ -230,4 +233,26 @@ TEST_F(AppListPresenterDelegateTest, TapAndClickOutsideClosesPeekingAppList) {
EXPECT_FALSE(app_list_presenter_impl()->GetTargetVisibility());
}
+// Tests that the shelf background displays/hides with bottom/side shelf
+// alignment.
+TEST_F(AppListPresenterDelegateTest,
+ ShelfBackgroundRespondsToAppListBeingShown) {
+ EnableFullscreenAppList();
+ 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!
+ Shelf::ForWindow(Shell::GetRootWindowForDisplayId(GetPrimaryDisplayId()));
+ shelf->SetAlignment(SHELF_ALIGNMENT_BOTTOM);
+
+ // 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.
+ app_list_presenter_impl()->Show(GetPrimaryDisplayId());
+ ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager();
+ EXPECT_EQ(shelf_layout_manager->GetShelfBackgroundType(),
+ SHELF_BACKGROUND_DEFAULT);
+ app_list_presenter_impl()->Dismiss();
+ // 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.
+ // show.
+ shelf->SetAlignment(ShelfAlignment::SHELF_ALIGNMENT_LEFT);
+ app_list_presenter_impl()->Show(GetPrimaryDisplayId());
+ EXPECT_EQ(shelf_layout_manager->GetShelfBackgroundType(),
+ SHELF_BACKGROUND_OVERLAP);
+}
} // namespace ash
James Cook 2017/06/21 23:57:32 nit: blank line above
newcomer 2017/06/22 00:16:08 Done.
« 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