OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/shelf/shelf_view.h" | 5 #include "ash/shelf/shelf_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1667 // Replace current ShelfDelegate with TestShelfDelegateForShelfView. | 1667 // Replace current ShelfDelegate with TestShelfDelegateForShelfView. |
1668 ReplaceShelfDelegateForRipOffTest(); | 1668 ReplaceShelfDelegateForRipOffTest(); |
1669 | 1669 |
1670 AddButtonsUntilOverflow(); | 1670 AddButtonsUntilOverflow(); |
1671 | 1671 |
1672 TestDraggingAnItemFromOverflowToShelf(false); | 1672 TestDraggingAnItemFromOverflowToShelf(false); |
1673 TestDraggingAnItemFromOverflowToShelf(true); | 1673 TestDraggingAnItemFromOverflowToShelf(true); |
1674 } | 1674 } |
1675 | 1675 |
1676 // Tests that the AppListButton renders as active in response to touches. | 1676 // Tests that the AppListButton renders as active in response to touches. |
1677 TEST_F(ShelfViewTest, AppListButtonTouchFeedback) { | 1677 TEST_F(ShelfViewTest, DISABLED_AppListButtonTouchFeedback) { |
1678 AppListButton* app_list_button = | 1678 AppListButton* app_list_button = |
1679 static_cast<AppListButton*>(shelf_view_->GetAppListButtonView()); | 1679 static_cast<AppListButton*>(shelf_view_->GetAppListButtonView()); |
1680 EXPECT_FALSE(app_list_button->draw_background_as_active()); | 1680 EXPECT_FALSE(app_list_button->draw_background_as_active()); |
1681 | 1681 |
1682 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); | 1682 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); |
1683 generator.set_current_location(app_list_button-> | 1683 generator.set_current_location(app_list_button-> |
1684 GetBoundsInScreen().CenterPoint()); | 1684 GetBoundsInScreen().CenterPoint()); |
1685 generator.PressTouch(); | 1685 generator.PressTouch(); |
1686 RunAllPendingInMessageLoop(); | 1686 RunAllPendingInMessageLoop(); |
1687 EXPECT_TRUE(app_list_button->draw_background_as_active()); | 1687 EXPECT_TRUE(app_list_button->draw_background_as_active()); |
1688 | 1688 |
1689 generator.ReleaseTouch(); | 1689 generator.ReleaseTouch(); |
1690 RunAllPendingInMessageLoop(); | 1690 RunAllPendingInMessageLoop(); |
1691 EXPECT_FALSE(app_list_button->draw_background_as_active()); | 1691 EXPECT_FALSE(app_list_button->draw_background_as_active()); |
1692 EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility()); | 1692 EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility()); |
1693 } | 1693 } |
1694 | 1694 |
1695 // Tests that a touch that slides out of the bounds of the AppListButton leads | 1695 // Tests that a touch that slides out of the bounds of the AppListButton leads |
1696 // to the end of rendering an active state. | 1696 // to the end of rendering an active state. |
1697 TEST_F(ShelfViewTest, AppListButtonTouchFeedbackCancellation) { | 1697 TEST_F(ShelfViewTest, DISABLED_AppListButtonTouchFeedbackCancellation) { |
1698 AppListButton* app_list_button = | 1698 AppListButton* app_list_button = |
1699 static_cast<AppListButton*>(shelf_view_->GetAppListButtonView()); | 1699 static_cast<AppListButton*>(shelf_view_->GetAppListButtonView()); |
1700 EXPECT_FALSE(app_list_button->draw_background_as_active()); | 1700 EXPECT_FALSE(app_list_button->draw_background_as_active()); |
1701 | 1701 |
1702 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); | 1702 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); |
1703 generator.set_current_location(app_list_button-> | 1703 generator.set_current_location(app_list_button-> |
1704 GetBoundsInScreen().CenterPoint()); | 1704 GetBoundsInScreen().CenterPoint()); |
1705 generator.PressTouch(); | 1705 generator.PressTouch(); |
1706 RunAllPendingInMessageLoop(); | 1706 RunAllPendingInMessageLoop(); |
1707 EXPECT_TRUE(app_list_button->draw_background_as_active()); | 1707 EXPECT_TRUE(app_list_button->draw_background_as_active()); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1763 test_api_->RunMessageLoopUntilAnimationsDone(); | 1763 test_api_->RunMessageLoopUntilAnimationsDone(); |
1764 CheckAllItemsAreInBounds(); | 1764 CheckAllItemsAreInBounds(); |
1765 } | 1765 } |
1766 | 1766 |
1767 INSTANTIATE_TEST_CASE_P(LtrRtl, ShelfViewTextDirectionTest, testing::Bool()); | 1767 INSTANTIATE_TEST_CASE_P(LtrRtl, ShelfViewTextDirectionTest, testing::Bool()); |
1768 INSTANTIATE_TEST_CASE_P(VisibleBounds, ShelfViewVisibleBoundsTest, | 1768 INSTANTIATE_TEST_CASE_P(VisibleBounds, ShelfViewVisibleBoundsTest, |
1769 testing::Bool()); | 1769 testing::Bool()); |
1770 | 1770 |
1771 } // namespace test | 1771 } // namespace test |
1772 } // namespace ash | 1772 } // namespace ash |
OLD | NEW |