diff options
author | harrym@chromium.org <harrym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-12 02:57:56 +0000 |
---|---|---|
committer | harrym@chromium.org <harrym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-12 02:57:56 +0000 |
commit | 0ac231118b5ffa2ca76423c1ecc10ca47327596f (patch) | |
tree | fd7503398048811b348ea3b820e7600ada9946f3 /ash/shelf/shelf_navigator_unittest.cc | |
parent | 7177c4325ff6804e53ae62399a48e7af7b04abec (diff) | |
download | chromium_src-0ac231118b5ffa2ca76423c1ecc10ca47327596f.zip chromium_src-0ac231118b5ffa2ca76423c1ecc10ca47327596f.tar.gz chromium_src-0ac231118b5ffa2ca76423c1ecc10ca47327596f.tar.bz2 |
Shelf Cleanup AlternateShelfLayout P1 Attempt 3
R=skuhne@chromium.org
TBR=jamescook@chromium.org, miket@chromium.org, skuhne@chromium.org
BUG=338429
re-landing of https://codereview.chromium.org/176883022/ with fix for the inset of app panel as discussed offline /w jennyz@
Review URL: https://codereview.chromium.org/229453005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263451 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shelf/shelf_navigator_unittest.cc')
-rw-r--r-- | ash/shelf/shelf_navigator_unittest.cc | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/ash/shelf/shelf_navigator_unittest.cc b/ash/shelf/shelf_navigator_unittest.cc index 7807ecc..0033da7 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 |