Commit 425ce839 authored by Andrew Xu's avatar Andrew Xu Committed by Commit Bot

Disable overflow tests

Disable tests about overflow when scrollable shelf is enabled.

Bug: 1002576
Change-Id: I248cc1261dc571eddcb4ef93982436f641f7d8bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1797043Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Andrew Xu <andrewxu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696057}
parent f8bf020b
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "ash/test/ash_test_base.h" #include "ash/test/ash_test_base.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "chromeos/constants/chromeos_switches.h"
#include "components/session_manager/session_manager_types.h" #include "components/session_manager/session_manager_types.h"
#include "mojo/public/cpp/bindings/associated_binding.h" #include "mojo/public/cpp/bindings/associated_binding.h"
...@@ -103,6 +104,11 @@ TEST_F(ShelfTest, CheckHoverAfterMenu) { ...@@ -103,6 +104,11 @@ TEST_F(ShelfTest, CheckHoverAfterMenu) {
} }
TEST_F(ShelfTest, ShowOverflowBubble) { TEST_F(ShelfTest, ShowOverflowBubble) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
ShelfWidget* shelf_widget = GetPrimaryShelf()->shelf_widget(); ShelfWidget* shelf_widget = GetPrimaryShelf()->shelf_widget();
// Add app buttons until overflow occurs. // Add app buttons until overflow occurs.
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#include "base/test/scoped_feature_list.h" #include "base/test/scoped_feature_list.h"
#include "base/test/scoped_mock_time_message_loop_task_runner.h" #include "base/test/scoped_mock_time_message_loop_task_runner.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "chromeos/constants/chromeos_switches.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -258,6 +259,13 @@ TEST_F(ShelfObserverIconTest, AddRemoveWithMultipleDisplays) { ...@@ -258,6 +259,13 @@ TEST_F(ShelfObserverIconTest, AddRemoveWithMultipleDisplays) {
} }
TEST_F(ShelfObserverIconTest, BoundsChanged) { TEST_F(ShelfObserverIconTest, BoundsChanged) {
// When scrollable shelf enabled, the shelf view's bounds are calculated in
// scrollable shelf and may remain unchanged when shelf widget's bounds are
// changed.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
views::Widget* widget = views::Widget* widget =
GetPrimaryShelf()->GetShelfViewForTesting()->GetWidget(); GetPrimaryShelf()->GetShelfViewForTesting()->GetWidget();
gfx::Rect shelf_bounds = widget->GetWindowBoundsInScreen(); gfx::Rect shelf_bounds = widget->GetWindowBoundsInScreen();
...@@ -294,7 +302,12 @@ class ShelfViewTest : public AshTestBase { ...@@ -294,7 +302,12 @@ class ShelfViewTest : public AshTestBase {
->GetContentsView(); ->GetContentsView();
// The bounds should be big enough for 4 buttons + overflow button. // The bounds should be big enough for 4 buttons + overflow button.
ASSERT_GE(shelf_view_->width(), 500); ASSERT_GE(GetPrimaryShelf()
->shelf_widget()
->hotseat_widget()
->GetWindowBoundsInScreen()
.width(),
500);
test_api_.reset(new ShelfViewTestAPI(shelf_view_)); test_api_.reset(new ShelfViewTestAPI(shelf_view_));
test_api_->SetAnimationDuration(1); // Speeds up animation for test. test_api_->SetAnimationDuration(1); // Speeds up animation for test.
...@@ -722,17 +735,21 @@ class ShelfViewTextDirectionTest : public ShelfViewTest, ...@@ -722,17 +735,21 @@ class ShelfViewTextDirectionTest : public ShelfViewTest,
// Check the ideal bounds of several items in LTR and RTL UI. // Check the ideal bounds of several items in LTR and RTL UI.
TEST_P(ShelfViewTextDirectionTest, GetIdealBoundsOfItemIcon) { TEST_P(ShelfViewTextDirectionTest, GetIdealBoundsOfItemIcon) {
ShelfID id_1 = AddAppShortcut(); ShelfID id_1 = AddAppShortcut();
const gfx::Rect bounds_1 = shelf_view_->GetIdealBoundsOfItemIcon(id_1);
EXPECT_TRUE(GetButtonByID(id_1)->GetMirroredBounds().Contains(bounds_1));
if (chromeos::switches::ShouldShowScrollableShelf())
return;
AddAppShortcutsUntilOverflow(); AddAppShortcutsUntilOverflow();
ShelfID id_2 = AddAppShortcut(); ShelfID id_2 = AddAppShortcut();
ShelfID id_3 = AddAppShortcut(); ShelfID id_3 = AddAppShortcut();
const gfx::Rect bounds_1 = shelf_view_->GetIdealBoundsOfItemIcon(id_1);
const gfx::Rect bounds_2 = shelf_view_->GetIdealBoundsOfItemIcon(id_2); const gfx::Rect bounds_2 = shelf_view_->GetIdealBoundsOfItemIcon(id_2);
const gfx::Rect bounds_3 = shelf_view_->GetIdealBoundsOfItemIcon(id_3); const gfx::Rect bounds_3 = shelf_view_->GetIdealBoundsOfItemIcon(id_3);
// Just items in the overflow area return the overflow button's ideal bounds. // Just items in the overflow area return the overflow button's ideal bounds.
EXPECT_NE(bounds_1, shelf_view_->GetOverflowButton()->GetMirroredBounds()); EXPECT_NE(bounds_1, shelf_view_->GetOverflowButton()->GetMirroredBounds());
EXPECT_TRUE(GetButtonByID(id_1)->GetMirroredBounds().Contains(bounds_1));
EXPECT_EQ(bounds_2, shelf_view_->GetOverflowButton()->GetMirroredBounds()); EXPECT_EQ(bounds_2, shelf_view_->GetOverflowButton()->GetMirroredBounds());
EXPECT_EQ(bounds_3, shelf_view_->GetOverflowButton()->GetMirroredBounds()); EXPECT_EQ(bounds_3, shelf_view_->GetOverflowButton()->GetMirroredBounds());
} }
...@@ -753,6 +770,11 @@ TEST_F(ShelfViewTest, EnforceDragType) { ...@@ -753,6 +770,11 @@ TEST_F(ShelfViewTest, EnforceDragType) {
// Adds platform app button until overflow and verifies that the last added // Adds platform app button until overflow and verifies that the last added
// platform app button is hidden. // platform app button is hidden.
TEST_F(ShelfViewTest, AddBrowserUntilOverflow) { TEST_F(ShelfViewTest, AddBrowserUntilOverflow) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
// All buttons should be visible. // All buttons should be visible.
ASSERT_EQ(test_api_->GetButtonCount(), shelf_view_->last_visible_index() + 1); ASSERT_EQ(test_api_->GetButtonCount(), shelf_view_->last_visible_index() + 1);
...@@ -773,6 +795,11 @@ TEST_F(ShelfViewTest, AddBrowserUntilOverflow) { ...@@ -773,6 +795,11 @@ TEST_F(ShelfViewTest, AddBrowserUntilOverflow) {
} }
TEST_F(ShelfViewTest, OverflowVisibleIndex) { TEST_F(ShelfViewTest, OverflowVisibleIndex) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
AddAppShortcutsUntilOverflow(); AddAppShortcutsUntilOverflow();
ASSERT_TRUE(shelf_view_->GetOverflowButton()->GetVisible()); ASSERT_TRUE(shelf_view_->GetOverflowButton()->GetVisible());
const int last_visible_index = shelf_view_->last_visible_index(); const int last_visible_index = shelf_view_->last_visible_index();
...@@ -801,6 +828,11 @@ TEST_F(ShelfViewTest, OverflowVisibleIndex) { ...@@ -801,6 +828,11 @@ TEST_F(ShelfViewTest, OverflowVisibleIndex) {
// that the browser button gets hidden on overflow and last added app shortcut // that the browser button gets hidden on overflow and last added app shortcut
// is still visible. // is still visible.
TEST_F(ShelfViewTest, AddAppShortcutWithBrowserButtonUntilOverflow) { TEST_F(ShelfViewTest, AddAppShortcutWithBrowserButtonUntilOverflow) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
// All buttons should be visible. // All buttons should be visible.
ASSERT_EQ(test_api_->GetButtonCount(), shelf_view_->last_visible_index() + 1); ASSERT_EQ(test_api_->GetButtonCount(), shelf_view_->last_visible_index() + 1);
...@@ -825,6 +857,11 @@ TEST_F(ShelfViewTest, AddAppShortcutWithBrowserButtonUntilOverflow) { ...@@ -825,6 +857,11 @@ TEST_F(ShelfViewTest, AddAppShortcutWithBrowserButtonUntilOverflow) {
// Making sure that no buttons on the shelf will ever overlap after adding many // Making sure that no buttons on the shelf will ever overlap after adding many
// of them. // of them.
TEST_F(ShelfViewTest, AssertNoButtonsOverlap) { TEST_F(ShelfViewTest, AssertNoButtonsOverlap) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
std::vector<ShelfID> button_ids; std::vector<ShelfID> button_ids;
// Add app icons until the overflow button is visible. // Add app icons until the overflow button is visible.
while (!shelf_view_->GetOverflowButton()->GetVisible()) { while (!shelf_view_->GetOverflowButton()->GetVisible()) {
...@@ -879,6 +916,11 @@ TEST_F(ShelfViewTest, AssertNoButtonsOverlap) { ...@@ -879,6 +916,11 @@ TEST_F(ShelfViewTest, AssertNoButtonsOverlap) {
// the last added one changes from invisible to visible and overflow // the last added one changes from invisible to visible and overflow
// chevron is gone. // chevron is gone.
TEST_F(ShelfViewTest, RemoveButtonRevealsOverflowed) { TEST_F(ShelfViewTest, RemoveButtonRevealsOverflowed) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
// All buttons should be visible. // All buttons should be visible.
ASSERT_EQ(test_api_->GetButtonCount(), shelf_view_->last_visible_index() + 1); ASSERT_EQ(test_api_->GetButtonCount(), shelf_view_->last_visible_index() + 1);
...@@ -908,6 +950,11 @@ TEST_F(ShelfViewTest, RemoveButtonRevealsOverflowed) { ...@@ -908,6 +950,11 @@ TEST_F(ShelfViewTest, RemoveButtonRevealsOverflowed) {
// Verifies that remove last overflowed button should hide overflow chevron. // Verifies that remove last overflowed button should hide overflow chevron.
TEST_F(ShelfViewTest, RemoveLastOverflowed) { TEST_F(ShelfViewTest, RemoveLastOverflowed) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
// All buttons should be visible. // All buttons should be visible.
ASSERT_EQ(test_api_->GetButtonCount(), shelf_view_->last_visible_index() + 1); ASSERT_EQ(test_api_->GetButtonCount(), shelf_view_->last_visible_index() + 1);
...@@ -927,6 +974,11 @@ TEST_F(ShelfViewTest, RemoveLastOverflowed) { ...@@ -927,6 +974,11 @@ TEST_F(ShelfViewTest, RemoveLastOverflowed) {
// Tests the visiblity of certain shelf items when the overflow bubble is open // Tests the visiblity of certain shelf items when the overflow bubble is open
// and entering or exiting tablet mode. // and entering or exiting tablet mode.
TEST_F(ShelfViewTest, OverflowVisibleItemsInTabletMode) { TEST_F(ShelfViewTest, OverflowVisibleItemsInTabletMode) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
// Helper to check whether the item with index |index| is visible on the shelf // Helper to check whether the item with index |index| is visible on the shelf
// associated with |shelf_test_api|. // associated with |shelf_test_api|.
auto is_visible_on_shelf = [](int index, ShelfViewTestAPI* shelf_test_api) { auto is_visible_on_shelf = [](int index, ShelfViewTestAPI* shelf_test_api) {
...@@ -971,6 +1023,11 @@ TEST_F(ShelfViewTest, OverflowVisibleItemsInTabletMode) { ...@@ -971,6 +1023,11 @@ TEST_F(ShelfViewTest, OverflowVisibleItemsInTabletMode) {
// Adds platform app button without waiting for animation to finish and verifies // Adds platform app button without waiting for animation to finish and verifies
// that all added buttons are visible. // that all added buttons are visible.
TEST_F(ShelfViewTest, AddButtonQuickly) { TEST_F(ShelfViewTest, AddButtonQuickly) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
// All buttons should be visible. // All buttons should be visible.
ASSERT_EQ(test_api_->GetButtonCount(), shelf_view_->last_visible_index() + 1); ASSERT_EQ(test_api_->GetButtonCount(), shelf_view_->last_visible_index() + 1);
...@@ -1183,8 +1240,6 @@ TEST_F(ShelfViewTest, ShelfRipOff) { ...@@ -1183,8 +1240,6 @@ TEST_F(ShelfViewTest, ShelfRipOff) {
// overflow. Add one more app (which is on the overflow shelf). // overflow. Add one more app (which is on the overflow shelf).
ShelfID first_app_id = AddAppShortcut(); ShelfID first_app_id = AddAppShortcut();
ShelfID second_app_id = AddAppShortcut(); ShelfID second_app_id = AddAppShortcut();
AddAppShortcutsUntilOverflow();
ShelfID overflow_app_id = AddAppShortcut();
// Verify that dragging an app off the shelf will trigger the app getting // Verify that dragging an app off the shelf will trigger the app getting
// ripped off, unless the distance is less than |kRipOffDistance|. // ripped off, unless the distance is less than |kRipOffDistance|.
...@@ -1203,6 +1258,14 @@ TEST_F(ShelfViewTest, ShelfRipOff) { ...@@ -1203,6 +1258,14 @@ TEST_F(ShelfViewTest, ShelfRipOff) {
generator->ReleaseLeftButton(); generator->ReleaseLeftButton();
EXPECT_FALSE(test_api_->IsRippedOffFromShelf()); EXPECT_FALSE(test_api_->IsRippedOffFromShelf());
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
AddAppShortcutsUntilOverflow();
ShelfID overflow_app_id = AddAppShortcut();
// Open overflow shelf and test api for it. // Open overflow shelf and test api for it.
test_api_->ShowOverflowBubble(); test_api_->ShowOverflowBubble();
ASSERT_TRUE(shelf_view_->IsShowingOverflowBubble()); ASSERT_TRUE(shelf_view_->IsShowingOverflowBubble());
...@@ -1340,6 +1403,11 @@ TEST_F(ShelfViewTest, ShelfTooltipTest) { ...@@ -1340,6 +1403,11 @@ TEST_F(ShelfViewTest, ShelfTooltipTest) {
} }
TEST_F(ShelfViewTest, ButtonTitlesTest) { TEST_F(ShelfViewTest, ButtonTitlesTest) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
AddAppShortcutsUntilOverflow(); AddAppShortcutsUntilOverflow();
EXPECT_EQ(base::UTF8ToUTF16("Launcher"), EXPECT_EQ(base::UTF8ToUTF16("Launcher"),
shelf_view_->shelf_widget()->GetHomeButton()->GetAccessibleName()); shelf_view_->shelf_widget()->GetHomeButton()->GetAccessibleName());
...@@ -1537,6 +1605,11 @@ TEST_F(ShelfViewTest, ShouldHideTooltipWhenHoveringOnTooltip) { ...@@ -1537,6 +1605,11 @@ TEST_F(ShelfViewTest, ShouldHideTooltipWhenHoveringOnTooltip) {
// which happens when overflow happens. Home button should end up in its // which happens when overflow happens. Home button should end up in its
// new ideal bounds. // new ideal bounds.
TEST_F(ShelfViewTest, ResizeDuringOverflowAddAnimation) { TEST_F(ShelfViewTest, ResizeDuringOverflowAddAnimation) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
// All buttons should be visible. // All buttons should be visible.
ASSERT_EQ(test_api_->GetButtonCount(), shelf_view_->last_visible_index() + 1); ASSERT_EQ(test_api_->GetButtonCount(), shelf_view_->last_visible_index() + 1);
...@@ -1571,6 +1644,11 @@ TEST_F(ShelfViewTest, ResizeDuringOverflowAddAnimation) { ...@@ -1571,6 +1644,11 @@ TEST_F(ShelfViewTest, ResizeDuringOverflowAddAnimation) {
// Checks the overflow bubble size when an item is ripped off and re-inserted. // Checks the overflow bubble size when an item is ripped off and re-inserted.
TEST_F(ShelfViewTest, OverflowBubbleSize) { TEST_F(ShelfViewTest, OverflowBubbleSize) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
AddAppShortcutsUntilOverflow(); AddAppShortcutsUntilOverflow();
// Add one more button to prevent the overflow bubble to disappear upon // Add one more button to prevent the overflow bubble to disappear upon
// dragging an item out on windows (flakiness, see crbug.com/436131). // dragging an item out on windows (flakiness, see crbug.com/436131).
...@@ -1624,6 +1702,11 @@ TEST_F(ShelfViewTest, OverflowBubbleSize) { ...@@ -1624,6 +1702,11 @@ TEST_F(ShelfViewTest, OverflowBubbleSize) {
} }
TEST_F(ShelfViewTest, OverflowShelfColorIsDerivedFromWallpaper) { TEST_F(ShelfViewTest, OverflowShelfColorIsDerivedFromWallpaper) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
WallpaperControllerTestApi wallpaper_test_api( WallpaperControllerTestApi wallpaper_test_api(
Shell::Get()->wallpaper_controller()); Shell::Get()->wallpaper_controller());
const SkColor opaque_expected_color = const SkColor opaque_expected_color =
...@@ -1638,6 +1721,11 @@ TEST_F(ShelfViewTest, OverflowShelfColorIsDerivedFromWallpaper) { ...@@ -1638,6 +1721,11 @@ TEST_F(ShelfViewTest, OverflowShelfColorIsDerivedFromWallpaper) {
// Check the drag insertion bounds of scrolled overflow bubble. // Check the drag insertion bounds of scrolled overflow bubble.
TEST_F(ShelfViewTest, CheckDragInsertBoundsOfScrolledOverflowBubble) { TEST_F(ShelfViewTest, CheckDragInsertBoundsOfScrolledOverflowBubble) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
UpdateDisplay("400x300"); UpdateDisplay("400x300");
AddAppShortcutsUntilOverflow(); AddAppShortcutsUntilOverflow();
...@@ -1712,6 +1800,11 @@ TEST_F(ShelfViewTest, CheckDragInsertBoundsOfScrolledOverflowBubble) { ...@@ -1712,6 +1800,11 @@ TEST_F(ShelfViewTest, CheckDragInsertBoundsOfScrolledOverflowBubble) {
// Check the drag insertion bounds of shelf view in multi monitor environment. // Check the drag insertion bounds of shelf view in multi monitor environment.
TEST_F(ShelfViewTest, CheckDragInsertBoundsWithMultiMonitor) { TEST_F(ShelfViewTest, CheckDragInsertBoundsWithMultiMonitor) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
UpdateDisplay("800x600,800x600"); UpdateDisplay("800x600,800x600");
Shelf* secondary_shelf = Shelf::ForWindow(Shell::GetAllRootWindows()[1]); Shelf* secondary_shelf = Shelf::ForWindow(Shell::GetAllRootWindows()[1]);
ShelfView* shelf_view_for_secondary = ShelfView* shelf_view_for_secondary =
...@@ -1815,6 +1908,11 @@ TEST_F(ShelfViewTest, CheckRipOffFromLeftShelfAlignmentWithMultiMonitor) { ...@@ -1815,6 +1908,11 @@ TEST_F(ShelfViewTest, CheckRipOffFromLeftShelfAlignmentWithMultiMonitor) {
// Checks various drag and drop operations from OverflowBubble to Shelf, and // Checks various drag and drop operations from OverflowBubble to Shelf, and
// vice versa. // vice versa.
TEST_F(ShelfViewTest, CheckDragAndDropFromShelfToOtherShelf) { TEST_F(ShelfViewTest, CheckDragAndDropFromShelfToOtherShelf) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
AddAppShortcutsUntilOverflow(); AddAppShortcutsUntilOverflow();
// Add one more button to prevent the overflow bubble to disappear upon // Add one more button to prevent the overflow bubble to disappear upon
// dragging an item out on windows (flakiness, see crbug.com/425097). // dragging an item out on windows (flakiness, see crbug.com/425097).
...@@ -1833,6 +1931,11 @@ TEST_F(ShelfViewTest, CheckDragAndDropFromShelfToOtherShelf) { ...@@ -1833,6 +1931,11 @@ TEST_F(ShelfViewTest, CheckDragAndDropFromShelfToOtherShelf) {
// Checks taking a screenshot while dragging an app into the overflow menu. // Checks taking a screenshot while dragging an app into the overflow menu.
TEST_F(ShelfViewTest, TestDragToOverflowAndTakeScreenshot) { TEST_F(ShelfViewTest, TestDragToOverflowAndTakeScreenshot) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
// We'll need UI controls to trigger the accelerator for taking a screenshot. // We'll need UI controls to trigger the accelerator for taking a screenshot.
ui_controls::InstallUIControlsAura(test::CreateAshUIControls()); ui_controls::InstallUIControlsAura(test::CreateAshUIControls());
...@@ -1898,6 +2001,11 @@ TEST_F(ShelfViewTest, TestDragToOverflowAndTakeScreenshot) { ...@@ -1898,6 +2001,11 @@ TEST_F(ShelfViewTest, TestDragToOverflowAndTakeScreenshot) {
// Checks drag-reorder items within the overflow shelf. // Checks drag-reorder items within the overflow shelf.
TEST_F(ShelfViewTest, TestDragWithinOverflow) { TEST_F(ShelfViewTest, TestDragWithinOverflow) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
// Prepare the overflow and open it. // Prepare the overflow and open it.
AddAppShortcutsUntilOverflow(); AddAppShortcutsUntilOverflow();
// Add a couple more to make sure we have things to drag. // Add a couple more to make sure we have things to drag.
...@@ -1946,6 +2054,11 @@ TEST_F(ShelfViewTest, TestDragWithinOverflow) { ...@@ -1946,6 +2054,11 @@ TEST_F(ShelfViewTest, TestDragWithinOverflow) {
// Checks creating app shortcut for an opened platform app in overflow bubble // Checks creating app shortcut for an opened platform app in overflow bubble
// should be invisible to the shelf. See crbug.com/605793. // should be invisible to the shelf. See crbug.com/605793.
TEST_F(ShelfViewTest, CheckOverflowStatusPinOpenedAppToShelf) { TEST_F(ShelfViewTest, CheckOverflowStatusPinOpenedAppToShelf) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
AddAppShortcutsUntilOverflow(); AddAppShortcutsUntilOverflow();
// Add a running Platform app. // Add a running Platform app.
...@@ -2012,6 +2125,11 @@ TEST_F(ShelfViewTest, ...@@ -2012,6 +2125,11 @@ TEST_F(ShelfViewTest,
} }
TEST_F(ShelfViewTest, TestHideOverflow) { TEST_F(ShelfViewTest, TestHideOverflow) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
// Use an event generator instead of SimulateClick because the overflow bubble // Use an event generator instead of SimulateClick because the overflow bubble
// uses a Shell pre-target EventHandler to observe input events. // uses a Shell pre-target EventHandler to observe input events.
ui::test::EventGenerator* generator = GetEventGenerator(); ui::test::EventGenerator* generator = GetEventGenerator();
...@@ -2088,6 +2206,11 @@ TEST_F(ShelfViewTest, TestHideOverflow) { ...@@ -2088,6 +2206,11 @@ TEST_F(ShelfViewTest, TestHideOverflow) {
} }
TEST_F(ShelfViewTest, UnpinningCancelsOverflow) { TEST_F(ShelfViewTest, UnpinningCancelsOverflow) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
// Add just enough items for overflow; one fewer would not require overflow. // Add just enough items for overflow; one fewer would not require overflow.
const ShelfID first_shelf_id = AddAppShortcut(); const ShelfID first_shelf_id = AddAppShortcut();
AddAppShortcutsUntilOverflow(); AddAppShortcutsUntilOverflow();
...@@ -2218,6 +2341,11 @@ TEST_F(ShelfViewTest, NoContextMenuOnBackButton) { ...@@ -2218,6 +2341,11 @@ TEST_F(ShelfViewTest, NoContextMenuOnBackButton) {
// Tests that the overflow button does not show a context menu. // Tests that the overflow button does not show a context menu.
TEST_F(ShelfViewTest, NoContextMenuOnOverflowButton) { TEST_F(ShelfViewTest, NoContextMenuOnOverflowButton) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
ui::test::EventGenerator* generator = GetEventGenerator(); ui::test::EventGenerator* generator = GetEventGenerator();
AddAppShortcutsUntilOverflow(); AddAppShortcutsUntilOverflow();
views::View* overflow_button = shelf_view_->GetOverflowButton(); views::View* overflow_button = shelf_view_->GetOverflowButton();
...@@ -2393,6 +2521,11 @@ TEST_F(ShelfViewTest, IconCenteringTest) { ...@@ -2393,6 +2521,11 @@ TEST_F(ShelfViewTest, IconCenteringTest) {
screen_width - app_buttons[n_buttons - 1]->GetBoundsInScreen().right()); screen_width - app_buttons[n_buttons - 1]->GetBoundsInScreen().right());
} }
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
// Now add apps until the overflow button appears. // Now add apps until the overflow button appears.
while (!shelf_view_->GetOverflowButton()->GetVisible()) { while (!shelf_view_->GetOverflowButton()->GetVisible()) {
app_buttons.push_back(GetButtonByID(AddApp())); app_buttons.push_back(GetButtonByID(AddApp()));
...@@ -2427,6 +2560,12 @@ TEST_F(ShelfViewTest, FirstAndLastVisibleIndex) { ...@@ -2427,6 +2560,12 @@ TEST_F(ShelfViewTest, FirstAndLastVisibleIndex) {
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(false); Shell::Get()->tablet_mode_controller()->SetEnabledForTest(false);
EXPECT_EQ(0, shelf_view_->first_visible_index()); EXPECT_EQ(0, shelf_view_->first_visible_index());
EXPECT_EQ(0, shelf_view_->last_visible_index()); EXPECT_EQ(0, shelf_view_->last_visible_index());
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
// Now let's add some apps until the overflow button shows up, each time // Now let's add some apps until the overflow button shows up, each time
// checking the first and last visible indices are what we expect. // checking the first and last visible indices are what we expect.
int last_visible_index = 0; int last_visible_index = 0;
...@@ -2495,6 +2634,13 @@ class OverflowBubbleViewTest : public ShelfViewTest { ...@@ -2495,6 +2634,13 @@ class OverflowBubbleViewTest : public ShelfViewTest {
void SetUp() override { void SetUp() override {
ShelfViewTest::SetUp(); ShelfViewTest::SetUp();
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is
// launched.
if (chromeos::switches::ShouldShowScrollableShelf())
GTEST_SKIP();
UpdateDisplay("300x600"); UpdateDisplay("300x600");
AddAppShortcutsUntilOverflow(); AddAppShortcutsUntilOverflow();
test_api_->ShowOverflowBubble(); test_api_->ShowOverflowBubble();
...@@ -2901,6 +3047,12 @@ TEST_P(ShelfViewVisibleBoundsTest, ItemsAreInBounds) { ...@@ -2901,6 +3047,12 @@ TEST_P(ShelfViewVisibleBoundsTest, ItemsAreInBounds) {
test_api_->RunMessageLoopUntilAnimationsDone(); test_api_->RunMessageLoopUntilAnimationsDone();
EXPECT_FALSE(shelf_view_->GetOverflowButton()->GetVisible()); EXPECT_FALSE(shelf_view_->GetOverflowButton()->GetVisible());
CheckAllItemsAreInBounds(); CheckAllItemsAreInBounds();
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
// Same for overflow case. // Same for overflow case.
while (!shelf_view_->GetOverflowButton()->GetVisible()) { while (!shelf_view_->GetOverflowButton()->GetVisible()) {
AddAppShortcut(); AddAppShortcut();
...@@ -3446,6 +3598,12 @@ class OverflowButtonInkDropTest : public ShelfViewInkDropTest { ...@@ -3446,6 +3598,12 @@ class OverflowButtonInkDropTest : public ShelfViewInkDropTest {
void SetUp() override { void SetUp() override {
ShelfViewInkDropTest::SetUp(); ShelfViewInkDropTest::SetUp();
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is
// launched.
if (chromeos::switches::ShouldShowScrollableShelf())
GTEST_SKIP();
overflow_button_ = shelf_view_->GetOverflowButton(); overflow_button_ = shelf_view_->GetOverflowButton();
auto overflow_button_ink_drop = auto overflow_button_ink_drop =
...@@ -3691,6 +3849,12 @@ class OverflowButtonTextDirectionTest ...@@ -3691,6 +3849,12 @@ class OverflowButtonTextDirectionTest
void SetUp() override { void SetUp() override {
OverflowButtonInkDropTest::SetUp(); OverflowButtonInkDropTest::SetUp();
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is
// launched.
if (chromeos::switches::ShouldShowScrollableShelf())
GTEST_SKIP();
} }
private: private:
...@@ -3715,6 +3879,12 @@ class OverflowButtonActiveInkDropTest : public OverflowButtonInkDropTest { ...@@ -3715,6 +3879,12 @@ class OverflowButtonActiveInkDropTest : public OverflowButtonInkDropTest {
void SetUp() override { void SetUp() override {
OverflowButtonInkDropTest::SetUp(); OverflowButtonInkDropTest::SetUp();
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is
// launched.
if (chromeos::switches::ShouldShowScrollableShelf())
GTEST_SKIP();
test_api_->ShowOverflowBubble(); test_api_->ShowOverflowBubble();
ASSERT_TRUE(shelf_view_->IsShowingOverflowBubble()); ASSERT_TRUE(shelf_view_->IsShowingOverflowBubble());
EXPECT_EQ(views::InkDropState::ACTIVATED, EXPECT_EQ(views::InkDropState::ACTIVATED,
...@@ -3977,6 +4147,11 @@ TEST_F(ShelfViewFocusTest, BackwardCycling) { ...@@ -3977,6 +4147,11 @@ TEST_F(ShelfViewFocusTest, BackwardCycling) {
// Verify that the overflow bubble does not activate when it is opened. // Verify that the overflow bubble does not activate when it is opened.
TEST_F(ShelfViewFocusTest, OverflowNotActivatedWhenOpened) { TEST_F(ShelfViewFocusTest, OverflowNotActivatedWhenOpened) {
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is launched.
if (chromeos::switches::ShouldShowScrollableShelf())
return;
std::unique_ptr<aura::Window> window = CreateTestWindow(); std::unique_ptr<aura::Window> window = CreateTestWindow();
wm::ActivateWindow(window.get()); wm::ActivateWindow(window.get());
...@@ -4052,6 +4227,12 @@ class ShelfViewOverflowFocusTest : public ShelfViewFocusTest { ...@@ -4052,6 +4227,12 @@ class ShelfViewOverflowFocusTest : public ShelfViewFocusTest {
void SetUp() override { void SetUp() override {
ShelfViewFocusTest::SetUp(); ShelfViewFocusTest::SetUp();
// No overflow bubble when scrollable shelf enabled.
// TODO(https://crbug.com/1002576): revisit when scrollable shelf is
// launched.
if (chromeos::switches::ShouldShowScrollableShelf())
GTEST_SKIP();
// Add app shortcuts until the overflow button is visible. At this point // Add app shortcuts until the overflow button is visible. At this point
// there will be two items on the overflow shelf. // there will be two items on the overflow shelf.
AddAppShortcutsUntilOverflow(); AddAppShortcutsUntilOverflow();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment