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 d554816c4b30abc599c2ef45436ad97f7e2baf9f..00525dcaed7b49ef7da84c268332dc6c93942fa9 100644 |
--- a/ash/app_list/app_list_presenter_delegate_unittest.cc |
+++ b/ash/app_list/app_list_presenter_delegate_unittest.cc |
@@ -4,6 +4,7 @@ |
#include <memory> |
+#include "ash/ash_switches.h" |
#include "ash/public/cpp/shell_window_ids.h" |
#include "ash/shell.h" |
#include "ash/shell_port.h" |
@@ -11,7 +12,9 @@ |
#include "ash/test/test_app_list_view_presenter_impl.h" |
#include "ash/wm/window_util.h" |
#include "ash/wm_window.h" |
+#include "base/command_line.h" |
#include "base/macros.h" |
+#include "ui/app_list/app_list_switches.h" |
#include "ui/app_list/views/app_list_view.h" |
#include "ui/aura/test/test_windows.h" |
#include "ui/aura/window.h" |
@@ -26,9 +29,15 @@ int64_t GetPrimaryDisplayId() { |
return display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
} |
+void SetFullscreenAppListSwitch() { |
+ base::CommandLine::ForCurrentProcess()->AppendSwitch( |
+ app_list::switches::kEnableFullscreenAppList); |
+} |
+ |
} // namespace |
-class AppListPresenterDelegateTest : public test::AshTestBase { |
+class AppListPresenterDelegateTest : public test::AshTestBase, |
+ public testing::WithParamInterface<bool> { |
public: |
AppListPresenterDelegateTest() {} |
~AppListPresenterDelegateTest() override {} |
@@ -41,18 +50,29 @@ class AppListPresenterDelegateTest : public test::AshTestBase { |
void SetUp() override { |
AshTestBase::SetUp(); |
+ // If the current test is parameterized. |
+ if (testing::UnitTest::GetInstance()->current_test_info()->value_param()) { |
+ test_with_fullscreen_ = GetParam(); |
+ if (test_with_fullscreen_) |
+ SetFullscreenAppListSwitch(); |
+ } |
// Make the display big enough to hold the app list. |
UpdateDisplay("1024x768"); |
} |
private: |
test::TestAppListViewPresenterImpl app_list_presenter_impl_; |
+ bool test_with_fullscreen_; |
DISALLOW_COPY_AND_ASSIGN(AppListPresenterDelegateTest); |
}; |
+// Instantiate the Boolean which is used to toggle the Fullscreen app list in |
+// the parameterized tests. |
+INSTANTIATE_TEST_CASE_P(, AppListPresenterDelegateTest, testing::Bool()); |
+ |
// Tests that app launcher hides when focus moves to a normal window. |
-TEST_F(AppListPresenterDelegateTest, HideOnFocusOut) { |
+TEST_P(AppListPresenterDelegateTest, HideOnFocusOut) { |
app_list_presenter_impl()->Show(GetPrimaryDisplayId()); |
EXPECT_TRUE(app_list_presenter_impl()->GetTargetVisibility()); |
@@ -64,7 +84,7 @@ TEST_F(AppListPresenterDelegateTest, HideOnFocusOut) { |
// Tests that app launcher remains visible when focus is moved to a different |
// window in kShellWindowId_AppListContainer. |
-TEST_F(AppListPresenterDelegateTest, |
+TEST_P(AppListPresenterDelegateTest, |
RemainVisibleWhenFocusingToApplistContainer) { |
app_list_presenter_impl()->Show(GetPrimaryDisplayId()); |
EXPECT_TRUE(app_list_presenter_impl()->GetTargetVisibility()); |
@@ -122,7 +142,7 @@ TEST_F(AppListPresenterDelegateTest, TapOutsideBubbleClosesBubble) { |
// Tests opening the app launcher on a non-primary display, then deleting the |
// display. |
-TEST_F(AppListPresenterDelegateTest, NonPrimaryDisplay) { |
+TEST_P(AppListPresenterDelegateTest, NonPrimaryDisplay) { |
// Set up a screen with two displays (horizontally adjacent). |
UpdateDisplay("1024x768,1024x768"); |
@@ -156,10 +176,12 @@ TEST_F(AppListPresenterDelegateTest, TinyDisplay) { |
// from the anchor (center) and height. There isn't a bounds rect that gives |
// the actual app list position (the widget bounds include the bubble border |
// which is much bigger than the actual app list size). |
+ |
app_list::AppListView* app_list = app_list_presenter_impl()->GetView(); |
int app_list_view_top = |
app_list->anchor_rect().y() - app_list->bounds().height() / 2; |
const int kMinimalAppListMargin = 10; |
+ |
EXPECT_GE(app_list_view_top, kMinimalAppListMargin); |
} |