| Index: ash/launcher/launcher_view_unittest.cc
|
| ===================================================================
|
| --- ash/launcher/launcher_view_unittest.cc (revision 170419)
|
| +++ ash/launcher/launcher_view_unittest.cc (working copy)
|
| @@ -220,12 +220,6 @@
|
| return id;
|
| }
|
|
|
| - LauncherID AddPanel() {
|
| - LauncherID id = AddPanelNoWait();
|
| - test_api_->RunMessageLoopUntilAnimationsDone();
|
| - return id;
|
| - }
|
| -
|
| LauncherID AddPlatformAppNoWait() {
|
| LauncherItem item;
|
| item.type = TYPE_PLATFORM_APP;
|
| @@ -236,16 +230,6 @@
|
| return id;
|
| }
|
|
|
| - LauncherID AddPanelNoWait() {
|
| - LauncherItem item;
|
| - item.type = TYPE_APP_PANEL;
|
| - item.status = STATUS_RUNNING;
|
| -
|
| - LauncherID id = model_->next_id();
|
| - model_->Add(item);
|
| - return id;
|
| - }
|
| -
|
| LauncherID AddPlatformApp() {
|
| LauncherID id = AddPlatformAppNoWait();
|
| test_api_->RunMessageLoopUntilAnimationsDone();
|
| @@ -349,15 +333,12 @@
|
| test_api_->GetButtonCount());
|
|
|
| // Add tabbed browser until overflow.
|
| - int items_added = 0;
|
| LauncherID last_added = AddTabbedBrowser();
|
| while (!test_api_->IsOverflowButtonVisible()) {
|
| // Added button is visible after animation while in this loop.
|
| EXPECT_TRUE(GetButtonByID(last_added)->visible());
|
|
|
| last_added = AddTabbedBrowser();
|
| - ++items_added;
|
| - ASSERT_LT(items_added, 10000);
|
| }
|
|
|
| // The last added button should be invisible.
|
| @@ -375,15 +356,12 @@
|
| LauncherID browser_button_id = AddTabbedBrowser();
|
|
|
| // Add app shortcut until overflow.
|
| - int items_added = 0;
|
| LauncherID last_added = AddAppShortcut();
|
| while (!test_api_->IsOverflowButtonVisible()) {
|
| // Added button is visible after animation while in this loop.
|
| EXPECT_TRUE(GetButtonByID(last_added)->visible());
|
|
|
| last_added = AddAppShortcut();
|
| - ++items_added;
|
| - ASSERT_LT(items_added, 10000);
|
| }
|
|
|
| // The last added app short button should be visible.
|
| @@ -392,58 +370,6 @@
|
| EXPECT_FALSE(GetButtonByID(browser_button_id)->visible());
|
| }
|
|
|
| -TEST_F(LauncherViewTest, AddPanelHidesTabbedBrowser) {
|
| - ASSERT_EQ(test_api_->GetLastVisibleIndex() + 1,
|
| - test_api_->GetButtonCount());
|
| -
|
| - // Add tabbed browser until overflow, remember last visible tabbed browser.
|
| - int items_added = 0;
|
| - LauncherID first_added = AddTabbedBrowser();
|
| - EXPECT_TRUE(GetButtonByID(first_added)->visible());
|
| - LauncherID last_visible = first_added;
|
| - while (true) {
|
| - LauncherID added = AddTabbedBrowser();
|
| - if (test_api_->IsOverflowButtonVisible()) {
|
| - EXPECT_FALSE(GetButtonByID(added)->visible());
|
| - break;
|
| - }
|
| - last_visible = added;
|
| - ++items_added;
|
| - ASSERT_LT(items_added, 10000);
|
| - }
|
| -
|
| - LauncherID panel = AddPanel();
|
| - EXPECT_TRUE(GetButtonByID(panel)->visible());
|
| - EXPECT_FALSE(GetButtonByID(last_visible)->visible());
|
| -
|
| - RemoveByID(panel);
|
| - EXPECT_TRUE(GetButtonByID(last_visible)->visible());
|
| -}
|
| -
|
| -TEST_F(LauncherViewTest, PanelsHideLast) {
|
| - ASSERT_EQ(test_api_->GetLastVisibleIndex() + 1,
|
| - test_api_->GetButtonCount());
|
| -
|
| - // Add tabbed browser.
|
| - LauncherID browser = AddTabbedBrowser();
|
| - LauncherID first_panel = AddPanel();
|
| -
|
| - EXPECT_TRUE(GetButtonByID(browser)->visible());
|
| - EXPECT_TRUE(GetButtonByID(first_panel)->visible());
|
| -
|
| - LauncherID last_panel = first_panel;
|
| - int items_added = 0;
|
| - while (!test_api_->IsOverflowButtonVisible()) {
|
| - last_panel = AddPanel();
|
| - ++items_added;
|
| - ASSERT_LT(items_added, 10000);
|
| - }
|
| -
|
| - EXPECT_TRUE(GetButtonByID(last_panel)->visible());
|
| - EXPECT_TRUE(GetButtonByID(first_panel)->visible());
|
| - EXPECT_FALSE(GetButtonByID(browser)->visible());
|
| -}
|
| -
|
| // Adds button until overflow then removes first added one. Verifies that
|
| // the last added one changes from invisible to visible and overflow
|
| // chevron is gone.
|
| @@ -453,14 +379,10 @@
|
| test_api_->GetButtonCount());
|
|
|
| // Add tabbed browser until overflow.
|
| - int items_added = 0;
|
| - LauncherID first_added = AddTabbedBrowser();
|
| + LauncherID first_added= AddTabbedBrowser();
|
| LauncherID last_added = first_added;
|
| - while (!test_api_->IsOverflowButtonVisible()) {
|
| + while (!test_api_->IsOverflowButtonVisible())
|
| last_added = AddTabbedBrowser();
|
| - ++items_added;
|
| - ASSERT_LT(items_added, 10000);
|
| - }
|
|
|
| // Expect add more than 1 button. First added is visible and last is not.
|
| EXPECT_NE(first_added, last_added);
|
| @@ -483,13 +405,9 @@
|
| test_api_->GetButtonCount());
|
|
|
| // Add tabbed browser until overflow.
|
| - int items_added = 0;
|
| - LauncherID last_added = AddTabbedBrowser();
|
| - while (!test_api_->IsOverflowButtonVisible()) {
|
| + LauncherID last_added= AddTabbedBrowser();
|
| + while (!test_api_->IsOverflowButtonVisible())
|
| last_added = AddTabbedBrowser();
|
| - ++items_added;
|
| - ASSERT_LT(items_added, 10000);
|
| - }
|
|
|
| RemoveByID(last_added);
|
| EXPECT_FALSE(test_api_->IsOverflowButtonVisible());
|
| @@ -507,7 +425,6 @@
|
| while (!test_api_->IsOverflowButtonVisible()) {
|
| AddTabbedBrowserNoWait();
|
| ++added_count;
|
| - ASSERT_LT(added_count, 10000);
|
| }
|
|
|
| // LauncherView should be big enough to hold at least 3 new buttons.
|
| @@ -785,13 +702,10 @@
|
|
|
| // Add buttons until overflow. Let the non-overflow add animations finish but
|
| // leave the last running.
|
| - int items_added = 0;
|
| AddTabbedBrowserNoWait();
|
| while (!test_api_->IsOverflowButtonVisible()) {
|
| test_api_->RunMessageLoopUntilAnimationsDone();
|
| AddTabbedBrowserNoWait();
|
| - ++items_added;
|
| - ASSERT_LT(items_added, 10000);
|
| }
|
|
|
| // Resize launcher view with that animation running and stay overflown.
|
|
|