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

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: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/shelf/shelf_layout_manager.h » ('j') | no next file with comments »
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..948fb78a34b369d9443e4b2f166ac6fa707a1c81 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,33 @@ TEST_F(AppListPresenterDelegateTest, TapAndClickOutsideClosesPeekingAppList) {
EXPECT_FALSE(app_list_presenter_impl()->GetTargetVisibility());
}
+// Tests that the shelf background displays/hides with bottom shelf
+// alignment.
+TEST_F(AppListPresenterDelegateTest,
+ ShelfBackgroundRespondsToAppListBeingShown) {
+ // TODO(newcomer): Investigate mash failures crbug.com/726838
+ if (Shell::GetAshConfig() == Config::MASH)
+ return;
+ EnableFullscreenAppList();
+ GetPrimaryShelf()->SetAlignment(SHELF_ALIGNMENT_BOTTOM);
+
+ // Show the app list, the shelf background should be transparent.
+ app_list_presenter_impl()->Show(GetPrimaryDisplayId());
+ ShelfLayoutManager* shelf_layout_manager =
+ GetPrimaryShelf()->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
+ // show.
+ GetPrimaryShelf()->SetAlignment(ShelfAlignment::SHELF_ALIGNMENT_LEFT);
+ app_list_presenter_impl()->Show(GetPrimaryDisplayId());
+ EXPECT_TRUE(app_list::features::IsFullscreenAppListEnabled());
+ EXPECT_FALSE(GetPrimaryShelf()->IsHorizontalAlignment());
+ EXPECT_EQ(GetPrimaryShelf()->shelf_layout_manager()->
+ GetShelfBackgroundType(),
+ SHELF_BACKGROUND_DEFAULT);
+}
+
} // namespace ash
« 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