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/common/shelf/shelf_view.h" | 5 #include "ash/common/shelf/shelf_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 widget.Show(); | 190 widget.Show(); |
191 widget.GetNativeWindow()->parent()->RemoveChild(widget.GetNativeWindow()); | 191 widget.GetNativeWindow()->parent()->RemoveChild(widget.GetNativeWindow()); |
192 shelf_view_test()->RunMessageLoopUntilAnimationsDone(); | 192 shelf_view_test()->RunMessageLoopUntilAnimationsDone(); |
193 EXPECT_TRUE(observer()->icon_positions_changed()); | 193 EXPECT_TRUE(observer()->icon_positions_changed()); |
194 observer()->Reset(); | 194 observer()->Reset(); |
195 } | 195 } |
196 | 196 |
197 // Make sure creating/deleting an window on one displays notifies a | 197 // Make sure creating/deleting an window on one displays notifies a |
198 // shelf on external display as well as one on primary. | 198 // shelf on external display as well as one on primary. |
199 TEST_F(WmShelfObserverIconTest, AddRemoveWithMultipleDisplays) { | 199 TEST_F(WmShelfObserverIconTest, AddRemoveWithMultipleDisplays) { |
| 200 // TODO: investigate failure in mash, http://crbug.com/695751. |
| 201 if (WmShell::Get()->IsRunningInMash()) |
| 202 return; |
| 203 |
200 UpdateDisplay("400x400,400x400"); | 204 UpdateDisplay("400x400,400x400"); |
201 WmWindow* second_root = WmShell::Get()->GetAllRootWindows()[1]; | 205 WmWindow* second_root = WmShell::Get()->GetAllRootWindows()[1]; |
202 WmShelf* second_shelf = second_root->GetRootWindowController()->GetShelf(); | 206 WmShelf* second_shelf = second_root->GetRootWindowController()->GetShelf(); |
203 TestWmShelfObserver second_observer(second_shelf); | 207 TestWmShelfObserver second_observer(second_shelf); |
204 | 208 |
205 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 209 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
206 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 210 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
207 params.bounds = gfx::Rect(0, 0, 200, 200); | 211 params.bounds = gfx::Rect(0, 0, 200, 200); |
208 params.context = CurrentContext(); | 212 params.context = CurrentContext(); |
209 views::Widget widget; | 213 views::Widget widget; |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 last_added = AddAppShortcut(); | 854 last_added = AddAppShortcut(); |
851 ++items_added; | 855 ++items_added; |
852 ASSERT_LT(items_added, 10000); | 856 ASSERT_LT(items_added, 10000); |
853 } | 857 } |
854 | 858 |
855 // And the platform app button is invisible. | 859 // And the platform app button is invisible. |
856 EXPECT_FALSE(GetButtonByID(browser_button_id)->visible()); | 860 EXPECT_FALSE(GetButtonByID(browser_button_id)->visible()); |
857 } | 861 } |
858 | 862 |
859 TEST_F(ShelfViewTest, AddPanelHidesPlatformAppButton) { | 863 TEST_F(ShelfViewTest, AddPanelHidesPlatformAppButton) { |
| 864 // TODO: investigate failure in mash, http://crbug.com/695751. |
| 865 if (WmShell::Get()->IsRunningInMash()) |
| 866 return; |
| 867 |
860 // All buttons should be visible. | 868 // All buttons should be visible. |
861 ASSERT_EQ(test_api_->GetButtonCount(), test_api_->GetLastVisibleIndex() + 1); | 869 ASSERT_EQ(test_api_->GetButtonCount(), test_api_->GetLastVisibleIndex() + 1); |
862 | 870 |
863 // Add platform app button until overflow, remember last visible platform app | 871 // Add platform app button until overflow, remember last visible platform app |
864 // button. | 872 // button. |
865 int items_added = 0; | 873 int items_added = 0; |
866 ShelfID first_added = AddApp(); | 874 ShelfID first_added = AddApp(); |
867 EXPECT_TRUE(GetButtonByID(first_added)->visible()); | 875 EXPECT_TRUE(GetButtonByID(first_added)->visible()); |
868 while (true) { | 876 while (true) { |
869 ShelfID added = AddApp(); | 877 ShelfID added = AddApp(); |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 const int app_list_button_index = test_api_->GetButtonCount() - 1; | 1570 const int app_list_button_index = test_api_->GetButtonCount() - 1; |
1563 const gfx::Rect& app_list_ideal_bounds = | 1571 const gfx::Rect& app_list_ideal_bounds = |
1564 test_api_->GetIdealBoundsByIndex(app_list_button_index); | 1572 test_api_->GetIdealBoundsByIndex(app_list_button_index); |
1565 const gfx::Rect& app_list_bounds = | 1573 const gfx::Rect& app_list_bounds = |
1566 test_api_->GetBoundsByIndex(app_list_button_index); | 1574 test_api_->GetBoundsByIndex(app_list_button_index); |
1567 EXPECT_EQ(app_list_ideal_bounds, app_list_bounds); | 1575 EXPECT_EQ(app_list_ideal_bounds, app_list_bounds); |
1568 } | 1576 } |
1569 | 1577 |
1570 // Checks the overflow bubble size when an item is ripped off and re-inserted. | 1578 // Checks the overflow bubble size when an item is ripped off and re-inserted. |
1571 TEST_F(ShelfViewTest, OverflowBubbleSize) { | 1579 TEST_F(ShelfViewTest, OverflowBubbleSize) { |
| 1580 // TODO: investigate failure in mash, http://crbug.com/695751. |
| 1581 if (WmShell::Get()->IsRunningInMash()) |
| 1582 return; |
| 1583 |
1572 shelf_delegate_->set_is_app_pinned(true); | 1584 shelf_delegate_->set_is_app_pinned(true); |
1573 AddButtonsUntilOverflow(); | 1585 AddButtonsUntilOverflow(); |
1574 // Add one more button to prevent the overflow bubble to disappear upon | 1586 // Add one more button to prevent the overflow bubble to disappear upon |
1575 // dragging an item out on windows (flakiness, see crbug.com/436131). | 1587 // dragging an item out on windows (flakiness, see crbug.com/436131). |
1576 AddAppShortcut(); | 1588 AddAppShortcut(); |
1577 | 1589 |
1578 // Show overflow bubble. | 1590 // Show overflow bubble. |
1579 test_api_->ShowOverflowBubble(); | 1591 test_api_->ShowOverflowBubble(); |
1580 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | 1592 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); |
1581 | 1593 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1616 test_for_overflow_view.GetPreferredSize().width()); | 1628 test_for_overflow_view.GetPreferredSize().width()); |
1617 | 1629 |
1618 generator.ReleaseLeftButton(); | 1630 generator.ReleaseLeftButton(); |
1619 test_for_overflow_view.RunMessageLoopUntilAnimationsDone(); | 1631 test_for_overflow_view.RunMessageLoopUntilAnimationsDone(); |
1620 EXPECT_EQ(bubble_size.width(), | 1632 EXPECT_EQ(bubble_size.width(), |
1621 test_for_overflow_view.GetPreferredSize().width()); | 1633 test_for_overflow_view.GetPreferredSize().width()); |
1622 } | 1634 } |
1623 | 1635 |
1624 // Check the drag insertion bounds of scrolled overflow bubble. | 1636 // Check the drag insertion bounds of scrolled overflow bubble. |
1625 TEST_F(ShelfViewTest, CheckDragInsertBoundsOfScrolledOverflowBubble) { | 1637 TEST_F(ShelfViewTest, CheckDragInsertBoundsOfScrolledOverflowBubble) { |
| 1638 // TODO: investigate failure in mash, http://crbug.com/695751. |
| 1639 if (WmShell::Get()->IsRunningInMash()) |
| 1640 return; |
| 1641 |
1626 UpdateDisplay("400x300"); | 1642 UpdateDisplay("400x300"); |
1627 | 1643 |
1628 EXPECT_EQ(2, model_->item_count()); | 1644 EXPECT_EQ(2, model_->item_count()); |
1629 | 1645 |
1630 AddButtonsUntilOverflow(); | 1646 AddButtonsUntilOverflow(); |
1631 | 1647 |
1632 // Show overflow bubble. | 1648 // Show overflow bubble. |
1633 test_api_->ShowOverflowBubble(); | 1649 test_api_->ShowOverflowBubble(); |
1634 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | 1650 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); |
1635 | 1651 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1767 | 1783 |
1768 // Rip off the browser item. | 1784 // Rip off the browser item. |
1769 generator.PressLeftButton(); | 1785 generator.PressLeftButton(); |
1770 generator.MoveMouseTo(start_point.x() + 400, start_point.y()); | 1786 generator.MoveMouseTo(start_point.x() + 400, start_point.y()); |
1771 test_api_for_secondary_shelf_view.RunMessageLoopUntilAnimationsDone(); | 1787 test_api_for_secondary_shelf_view.RunMessageLoopUntilAnimationsDone(); |
1772 EXPECT_TRUE(test_api_for_secondary_shelf_view.IsRippedOffFromShelf()); | 1788 EXPECT_TRUE(test_api_for_secondary_shelf_view.IsRippedOffFromShelf()); |
1773 } | 1789 } |
1774 | 1790 |
1775 // Checks various drag and drop operations from OverflowBubble to Shelf. | 1791 // Checks various drag and drop operations from OverflowBubble to Shelf. |
1776 TEST_F(ShelfViewTest, CheckDragAndDropFromOverflowBubbleToShelf) { | 1792 TEST_F(ShelfViewTest, CheckDragAndDropFromOverflowBubbleToShelf) { |
| 1793 // TODO: investigate failure in mash, http://crbug.com/695751. |
| 1794 if (WmShell::Get()->IsRunningInMash()) |
| 1795 return; |
| 1796 |
1777 AddButtonsUntilOverflow(); | 1797 AddButtonsUntilOverflow(); |
1778 // Add one more button to prevent the overflow bubble to disappear upon | 1798 // Add one more button to prevent the overflow bubble to disappear upon |
1779 // dragging an item out on windows (flakiness, see crbug.com/425097). | 1799 // dragging an item out on windows (flakiness, see crbug.com/425097). |
1780 AddAppShortcut(); | 1800 AddAppShortcut(); |
1781 | 1801 |
1782 TestDraggingAnItemFromOverflowToShelf(false); | 1802 TestDraggingAnItemFromOverflowToShelf(false); |
1783 TestDraggingAnItemFromOverflowToShelf(true); | 1803 TestDraggingAnItemFromOverflowToShelf(true); |
1784 } | 1804 } |
1785 | 1805 |
1786 // Checks creating app shortcut for an opened platform app in overflow bubble | 1806 // Checks creating app shortcut for an opened platform app in overflow bubble |
1787 // should be invisible to the shelf. See crbug.com/605793. | 1807 // should be invisible to the shelf. See crbug.com/605793. |
1788 TEST_F(ShelfViewTest, CheckOverflowStatusPinOpenedAppToShelf) { | 1808 TEST_F(ShelfViewTest, CheckOverflowStatusPinOpenedAppToShelf) { |
1789 AddButtonsUntilOverflow(); | 1809 AddButtonsUntilOverflow(); |
1790 | 1810 |
1791 // Add a running Platform app. | 1811 // Add a running Platform app. |
1792 ShelfID platform_app_id = AddApp(); | 1812 ShelfID platform_app_id = AddApp(); |
1793 EXPECT_FALSE(GetButtonByID(platform_app_id)->visible()); | 1813 EXPECT_FALSE(GetButtonByID(platform_app_id)->visible()); |
1794 | 1814 |
1795 // Make the added running platform app to be an app shortcut. | 1815 // Make the added running platform app to be an app shortcut. |
1796 // This app shortcut should be a swapped view in overflow bubble, which is | 1816 // This app shortcut should be a swapped view in overflow bubble, which is |
1797 // invisible. | 1817 // invisible. |
1798 SetShelfItemTypeToAppShortcut(platform_app_id); | 1818 SetShelfItemTypeToAppShortcut(platform_app_id); |
1799 EXPECT_FALSE(GetButtonByID(platform_app_id)->visible()); | 1819 EXPECT_FALSE(GetButtonByID(platform_app_id)->visible()); |
1800 } | 1820 } |
1801 | 1821 |
1802 // Verifies that Launcher_ButtonPressed_* UMA user actions are recorded when an | 1822 // Verifies that Launcher_ButtonPressed_* UMA user actions are recorded when an |
1803 // item is selected. | 1823 // item is selected. |
1804 TEST_F(ShelfViewTest, | 1824 TEST_F(ShelfViewTest, |
1805 Launcher_ButtonPressedUserActionsRecordedWhenItemSelected) { | 1825 Launcher_ButtonPressedUserActionsRecordedWhenItemSelected) { |
| 1826 // TODO: investigate failure in mash, http://crbug.com/695751. |
| 1827 if (WmShell::Get()->IsRunningInMash()) |
| 1828 return; |
| 1829 |
1806 base::UserActionTester user_action_tester; | 1830 base::UserActionTester user_action_tester; |
1807 | 1831 |
1808 ShelfID browser_shelf_id = model_->items()[browser_index_].id; | 1832 ShelfID browser_shelf_id = model_->items()[browser_index_].id; |
1809 ShelfItemSelectionTracker* selection_tracker = new ShelfItemSelectionTracker; | 1833 ShelfItemSelectionTracker* selection_tracker = new ShelfItemSelectionTracker; |
1810 model_->SetShelfItemDelegate( | 1834 model_->SetShelfItemDelegate( |
1811 browser_shelf_id, std::unique_ptr<ShelfItemDelegate>(selection_tracker)); | 1835 browser_shelf_id, std::unique_ptr<ShelfItemDelegate>(selection_tracker)); |
1812 | 1836 |
1813 SimulateClick(browser_index_); | 1837 SimulateClick(browser_index_); |
1814 EXPECT_EQ(1, | 1838 EXPECT_EQ(1, |
1815 user_action_tester.GetActionCount("Launcher_ButtonPressed_Mouse")); | 1839 user_action_tester.GetActionCount("Launcher_ButtonPressed_Mouse")); |
1816 } | 1840 } |
1817 | 1841 |
1818 // Verifies that Launcher_*Task UMA user actions are recorded when an item is | 1842 // Verifies that Launcher_*Task UMA user actions are recorded when an item is |
1819 // selected. | 1843 // selected. |
1820 TEST_F(ShelfViewTest, Launcher_TaskUserActionsRecordedWhenItemSelected) { | 1844 TEST_F(ShelfViewTest, Launcher_TaskUserActionsRecordedWhenItemSelected) { |
| 1845 // TODO: investigate failure in mash, http://crbug.com/695751. |
| 1846 if (WmShell::Get()->IsRunningInMash()) |
| 1847 return; |
| 1848 |
1821 base::UserActionTester user_action_tester; | 1849 base::UserActionTester user_action_tester; |
1822 | 1850 |
1823 ShelfID browser_shelf_id = model_->items()[browser_index_].id; | 1851 ShelfID browser_shelf_id = model_->items()[browser_index_].id; |
1824 ShelfItemSelectionTracker* selection_tracker = new ShelfItemSelectionTracker; | 1852 ShelfItemSelectionTracker* selection_tracker = new ShelfItemSelectionTracker; |
1825 selection_tracker->set_item_selected_action(SHELF_ACTION_NEW_WINDOW_CREATED); | 1853 selection_tracker->set_item_selected_action(SHELF_ACTION_NEW_WINDOW_CREATED); |
1826 model_->SetShelfItemDelegate( | 1854 model_->SetShelfItemDelegate( |
1827 browser_shelf_id, std::unique_ptr<ShelfItemDelegate>(selection_tracker)); | 1855 browser_shelf_id, std::unique_ptr<ShelfItemDelegate>(selection_tracker)); |
1828 | 1856 |
1829 SimulateClick(browser_index_); | 1857 SimulateClick(browser_index_); |
1830 EXPECT_EQ(1, user_action_tester.GetActionCount("Launcher_LaunchTask")); | 1858 EXPECT_EQ(1, user_action_tester.GetActionCount("Launcher_LaunchTask")); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2033 ShelfButton* browser_button_ = nullptr; | 2061 ShelfButton* browser_button_ = nullptr; |
2034 InkDropSpy* browser_button_ink_drop_ = nullptr; | 2062 InkDropSpy* browser_button_ink_drop_ = nullptr; |
2035 | 2063 |
2036 private: | 2064 private: |
2037 DISALLOW_COPY_AND_ASSIGN(ShelfViewInkDropTest); | 2065 DISALLOW_COPY_AND_ASSIGN(ShelfViewInkDropTest); |
2038 }; | 2066 }; |
2039 | 2067 |
2040 // Tests that changing visibility of the app list transitions app list button's | 2068 // Tests that changing visibility of the app list transitions app list button's |
2041 // ink drop states correctly. | 2069 // ink drop states correctly. |
2042 TEST_F(ShelfViewInkDropTest, AppListButtonWhenVisibilityChanges) { | 2070 TEST_F(ShelfViewInkDropTest, AppListButtonWhenVisibilityChanges) { |
| 2071 // TODO: investigate failure in mash, http://crbug.com/695751. |
| 2072 if (WmShell::Get()->IsRunningInMash()) |
| 2073 return; |
| 2074 |
2043 InitAppListButtonInkDrop(); | 2075 InitAppListButtonInkDrop(); |
2044 | 2076 |
2045 ShowAppList(); | 2077 ShowAppList(); |
2046 FinishAppListVisibilityChange(); | 2078 FinishAppListVisibilityChange(); |
2047 EXPECT_EQ(views::InkDropState::ACTIVATED, | 2079 EXPECT_EQ(views::InkDropState::ACTIVATED, |
2048 app_list_button_ink_drop_->GetTargetInkDropState()); | 2080 app_list_button_ink_drop_->GetTargetInkDropState()); |
2049 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), | 2081 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), |
2050 ElementsAre(views::InkDropState::ACTIVATED)); | 2082 ElementsAre(views::InkDropState::ACTIVATED)); |
2051 | 2083 |
2052 DismissAppList(); | 2084 DismissAppList(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2086 EXPECT_EQ(views::InkDropState::ACTIVATED, | 2118 EXPECT_EQ(views::InkDropState::ACTIVATED, |
2087 app_list_button_ink_drop_->GetTargetInkDropState()); | 2119 app_list_button_ink_drop_->GetTargetInkDropState()); |
2088 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), | 2120 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), |
2089 IsEmpty()); | 2121 IsEmpty()); |
2090 } | 2122 } |
2091 | 2123 |
2092 // Tests that when the app list is visible, mouse press on the app list button, | 2124 // Tests that when the app list is visible, mouse press on the app list button, |
2093 // which dismisses the app list, transitions ink drop states correctly. Also, | 2125 // which dismisses the app list, transitions ink drop states correctly. Also, |
2094 // tests that mouse drag and mouse release does not affect the ink drop state. | 2126 // tests that mouse drag and mouse release does not affect the ink drop state. |
2095 TEST_F(ShelfViewInkDropTest, AppListButtonMouseEventsWhenVisible) { | 2127 TEST_F(ShelfViewInkDropTest, AppListButtonMouseEventsWhenVisible) { |
| 2128 // TODO: investigate failure in mash, http://crbug.com/695751. |
| 2129 if (WmShell::Get()->IsRunningInMash()) |
| 2130 return; |
| 2131 |
2096 InitAppListButtonInkDrop(); | 2132 InitAppListButtonInkDrop(); |
2097 | 2133 |
2098 ShowAppList(); | 2134 ShowAppList(); |
2099 FinishAppListVisibilityChange(); | 2135 FinishAppListVisibilityChange(); |
2100 EXPECT_EQ(views::InkDropState::ACTIVATED, | 2136 EXPECT_EQ(views::InkDropState::ACTIVATED, |
2101 app_list_button_ink_drop_->GetTargetInkDropState()); | 2137 app_list_button_ink_drop_->GetTargetInkDropState()); |
2102 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), | 2138 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), |
2103 ElementsAre(views::InkDropState::ACTIVATED)); | 2139 ElementsAre(views::InkDropState::ACTIVATED)); |
2104 | 2140 |
2105 ui::test::EventGenerator& generator = GetEventGenerator(); | 2141 ui::test::EventGenerator& generator = GetEventGenerator(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2149 FinishAppListVisibilityChange(); | 2185 FinishAppListVisibilityChange(); |
2150 EXPECT_EQ(views::InkDropState::ACTIVATED, | 2186 EXPECT_EQ(views::InkDropState::ACTIVATED, |
2151 app_list_button_ink_drop_->GetTargetInkDropState()); | 2187 app_list_button_ink_drop_->GetTargetInkDropState()); |
2152 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), | 2188 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), |
2153 ElementsAre(views::InkDropState::ACTIVATED)); | 2189 ElementsAre(views::InkDropState::ACTIVATED)); |
2154 } | 2190 } |
2155 | 2191 |
2156 // Tests that when the app list is visible, tapping on the app list button | 2192 // Tests that when the app list is visible, tapping on the app list button |
2157 // transitions ink drop states correctly. | 2193 // transitions ink drop states correctly. |
2158 TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapWhenVisible) { | 2194 TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapWhenVisible) { |
| 2195 // TODO: investigate failure in mash, http://crbug.com/695751. |
| 2196 if (WmShell::Get()->IsRunningInMash()) |
| 2197 return; |
| 2198 |
2159 InitAppListButtonInkDrop(); | 2199 InitAppListButtonInkDrop(); |
2160 | 2200 |
2161 ShowAppList(); | 2201 ShowAppList(); |
2162 FinishAppListVisibilityChange(); | 2202 FinishAppListVisibilityChange(); |
2163 EXPECT_EQ(views::InkDropState::ACTIVATED, | 2203 EXPECT_EQ(views::InkDropState::ACTIVATED, |
2164 app_list_button_ink_drop_->GetTargetInkDropState()); | 2204 app_list_button_ink_drop_->GetTargetInkDropState()); |
2165 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), | 2205 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), |
2166 ElementsAre(views::InkDropState::ACTIVATED)); | 2206 ElementsAre(views::InkDropState::ACTIVATED)); |
2167 | 2207 |
2168 ui::test::EventGenerator& generator = GetEventGenerator(); | 2208 ui::test::EventGenerator& generator = GetEventGenerator(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2215 generator.ReleaseTouch(); | 2255 generator.ReleaseTouch(); |
2216 EXPECT_EQ(views::InkDropState::HIDDEN, | 2256 EXPECT_EQ(views::InkDropState::HIDDEN, |
2217 app_list_button_ink_drop_->GetTargetInkDropState()); | 2257 app_list_button_ink_drop_->GetTargetInkDropState()); |
2218 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), | 2258 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), |
2219 IsEmpty()); | 2259 IsEmpty()); |
2220 } | 2260 } |
2221 | 2261 |
2222 // Tests that when the app list is visible, tapping down on the app list button | 2262 // Tests that when the app list is visible, tapping down on the app list button |
2223 // and dragging the touch point transitions ink drop states correctly. | 2263 // and dragging the touch point transitions ink drop states correctly. |
2224 TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapDragWhenVisible) { | 2264 TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapDragWhenVisible) { |
| 2265 // TODO: investigate failure in mash, http://crbug.com/695751. |
| 2266 if (WmShell::Get()->IsRunningInMash()) |
| 2267 return; |
| 2268 |
2225 InitAppListButtonInkDrop(); | 2269 InitAppListButtonInkDrop(); |
2226 | 2270 |
2227 ShowAppList(); | 2271 ShowAppList(); |
2228 FinishAppListVisibilityChange(); | 2272 FinishAppListVisibilityChange(); |
2229 EXPECT_EQ(views::InkDropState::ACTIVATED, | 2273 EXPECT_EQ(views::InkDropState::ACTIVATED, |
2230 app_list_button_ink_drop_->GetTargetInkDropState()); | 2274 app_list_button_ink_drop_->GetTargetInkDropState()); |
2231 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), | 2275 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), |
2232 ElementsAre(views::InkDropState::ACTIVATED)); | 2276 ElementsAre(views::InkDropState::ACTIVATED)); |
2233 | 2277 |
2234 ui::test::EventGenerator& generator = GetEventGenerator(); | 2278 ui::test::EventGenerator& generator = GetEventGenerator(); |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2961 EXPECT_EQ(views::InkDropState::ACTIVATED, | 3005 EXPECT_EQ(views::InkDropState::ACTIVATED, |
2962 overflow_button_ink_drop_->GetTargetInkDropState()); | 3006 overflow_button_ink_drop_->GetTargetInkDropState()); |
2963 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | 3007 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), |
2964 IsEmpty()); | 3008 IsEmpty()); |
2965 | 3009 |
2966 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | 3010 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); |
2967 } | 3011 } |
2968 | 3012 |
2969 } // namespace test | 3013 } // namespace test |
2970 } // namespace ash | 3014 } // namespace ash |
OLD | NEW |