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.
|