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

Unified Diff: ash/shelf/shelf_navigator_unittest.cc

Issue 140323010: Ash:Shelf - Cleanup of Alternate Shelf (part 1) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + remove AlternateShelf from variable names Created 6 years, 11 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
Index: ash/shelf/shelf_navigator_unittest.cc
diff --git a/ash/shelf/shelf_navigator_unittest.cc b/ash/shelf/shelf_navigator_unittest.cc
index cf9e5d372514ca614d1902183f8bea55bc8bbf45..950fc8ff702dd3c2548100bd45edeb28a39fe934 100644
--- a/ash/shelf/shelf_navigator_unittest.cc
+++ b/ash/shelf/shelf_navigator_unittest.cc
@@ -69,21 +69,6 @@ class ShelfNavigatorTest : public testing::Test {
DISALLOW_COPY_AND_ASSIGN(ShelfNavigatorTest);
};
-class ShelfNavigatorLegacyShelfLayoutTest : public ShelfNavigatorTest {
- public:
- ShelfNavigatorLegacyShelfLayoutTest() : ShelfNavigatorTest() {}
-
- protected:
- virtual void SetUp() OVERRIDE {
- CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kAshDisableAlternateShelfLayout);
- ShelfNavigatorTest::SetUp();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ShelfNavigatorLegacyShelfLayoutTest);
-};
-
} // namespace
TEST_F(ShelfNavigatorTest, BasicCycle) {
@@ -102,22 +87,6 @@ TEST_F(ShelfNavigatorTest, BasicCycle) {
EXPECT_EQ(5, GetNextActivatedItemIndex(model(), CYCLE_BACKWARD));
}
-TEST_F(ShelfNavigatorLegacyShelfLayoutTest, BasicCycle) {
- // An app shortcut and three platform apps.
- ShelfItemType types[] = {
- TYPE_APP_SHORTCUT, TYPE_PLATFORM_APP, TYPE_PLATFORM_APP, TYPE_PLATFORM_APP,
- };
- // ShelfModel automatically adds BROWSER_SHORTCUT item at the
- // beginning, so '2' refers the first TYPE_PLATFORM_APP item.
- SetupMockShelfModel(types, arraysize(types), 2);
-
- EXPECT_EQ(3, GetNextActivatedItemIndex(model(), CYCLE_FORWARD));
-
- // Fourth one. It will skip the APP_SHORTCUT at the beginning of the list and
- // the APP_LIST item which is automatically added at the end of items.
- EXPECT_EQ(4, GetNextActivatedItemIndex(model(), CYCLE_BACKWARD));
-}
-
TEST_F(ShelfNavigatorTest, WrapToBeginning) {
ShelfItemType types[] = {
TYPE_APP_SHORTCUT, TYPE_PLATFORM_APP, TYPE_PLATFORM_APP, TYPE_PLATFORM_APP,
@@ -130,18 +99,6 @@ TEST_F(ShelfNavigatorTest, WrapToBeginning) {
EXPECT_EQ(3, GetNextActivatedItemIndex(model(), CYCLE_FORWARD));
}
-TEST_F(ShelfNavigatorLegacyShelfLayoutTest, WrapToBeginning) {
- ShelfItemType types[] = {
- TYPE_APP_SHORTCUT, TYPE_PLATFORM_APP, TYPE_PLATFORM_APP, TYPE_PLATFORM_APP,
- };
- SetupMockShelfModel(types, arraysize(types), 4);
-
- // Second one. It skips the APP_LIST item at the end of the list,
- // wraps to the beginning, and skips BROWSER_SHORTCUT and APP_SHORTCUT
- // at the beginning of the list.
- EXPECT_EQ(2, GetNextActivatedItemIndex(model(), CYCLE_FORWARD));
-}
-
TEST_F(ShelfNavigatorTest, Empty) {
SetupMockShelfModel(NULL, 0, -1);
EXPECT_EQ(-1, GetNextActivatedItemIndex(model(), CYCLE_FORWARD));
@@ -158,16 +115,6 @@ TEST_F(ShelfNavigatorTest, SingleEntry) {
EXPECT_EQ(-1, GetNextActivatedItemIndex(model(), CYCLE_BACKWARD));
}
-TEST_F(ShelfNavigatorLegacyShelfLayoutTest, SingleEntry) {
- ShelfItemType type = TYPE_PLATFORM_APP;
- SetupMockShelfModel(&type, 1, 1);
-
- // If there's only one item there and it is already active, there's no item
- // to be activated next.
- EXPECT_EQ(-1, GetNextActivatedItemIndex(model(), CYCLE_FORWARD));
- EXPECT_EQ(-1, GetNextActivatedItemIndex(model(), CYCLE_BACKWARD));
-}
-
TEST_F(ShelfNavigatorTest, NoActive) {
ShelfItemType types[] = {
TYPE_PLATFORM_APP, TYPE_PLATFORM_APP,
@@ -180,16 +127,4 @@ TEST_F(ShelfNavigatorTest, NoActive) {
EXPECT_EQ(2, GetNextActivatedItemIndex(model(), CYCLE_BACKWARD));
}
-TEST_F(ShelfNavigatorLegacyShelfLayoutTest, NoActive) {
- ShelfItemType types[] = {
- TYPE_PLATFORM_APP, TYPE_PLATFORM_APP,
- };
- // Special case: no items are 'STATUS_ACTIVE'.
- SetupMockShelfModel(types, arraysize(types), -1);
-
- // If there are no active status, pick the first running item as a fallback.
- EXPECT_EQ(1, GetNextActivatedItemIndex(model(), CYCLE_FORWARD));
- EXPECT_EQ(1, GetNextActivatedItemIndex(model(), CYCLE_BACKWARD));
-}
-
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698