Chromium Code Reviews| 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> |
| 11 | 11 |
| 12 #include "ash/common/shelf/app_list_button.h" | 12 #include "ash/common/shelf/app_list_button.h" |
| 13 #include "ash/common/shelf/overflow_bubble.h" | 13 #include "ash/common/shelf/overflow_bubble.h" |
| 14 #include "ash/common/shelf/overflow_bubble_view.h" | 14 #include "ash/common/shelf/overflow_bubble_view.h" |
| 15 #include "ash/common/shelf/overflow_button.h" | |
| 15 #include "ash/common/shelf/shelf_button.h" | 16 #include "ash/common/shelf/shelf_button.h" |
| 16 #include "ash/common/shelf/shelf_constants.h" | 17 #include "ash/common/shelf/shelf_constants.h" |
| 17 #include "ash/common/shelf/shelf_menu_model.h" | 18 #include "ash/common/shelf/shelf_menu_model.h" |
| 18 #include "ash/common/shelf/shelf_model.h" | 19 #include "ash/common/shelf/shelf_model.h" |
| 19 #include "ash/common/shelf/shelf_tooltip_manager.h" | 20 #include "ash/common/shelf/shelf_tooltip_manager.h" |
| 20 #include "ash/common/shelf/shelf_widget.h" | 21 #include "ash/common/shelf/shelf_widget.h" |
| 21 #include "ash/common/shelf/wm_shelf.h" | 22 #include "ash/common/shelf/wm_shelf.h" |
| 22 #include "ash/common/shelf/wm_shelf_observer.h" | 23 #include "ash/common/shelf/wm_shelf_observer.h" |
| 23 #include "ash/common/shell_window_ids.h" | 24 #include "ash/common/shell_window_ids.h" |
| 24 #include "ash/common/system/web_notification/web_notification_tray.h" | 25 #include "ash/common/system/web_notification/web_notification_tray.h" |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 36 #include "ash/test/test_shelf_item_delegate.h" | 37 #include "ash/test/test_shelf_item_delegate.h" |
| 37 #include "ash/test/test_shell_delegate.h" | 38 #include "ash/test/test_shell_delegate.h" |
| 38 #include "ash/test/test_system_tray_delegate.h" | 39 #include "ash/test/test_system_tray_delegate.h" |
| 39 #include "base/i18n/rtl.h" | 40 #include "base/i18n/rtl.h" |
| 40 #include "base/macros.h" | 41 #include "base/macros.h" |
| 41 #include "base/memory/ptr_util.h" | 42 #include "base/memory/ptr_util.h" |
| 42 #include "base/run_loop.h" | 43 #include "base/run_loop.h" |
| 43 #include "base/strings/string_number_conversions.h" | 44 #include "base/strings/string_number_conversions.h" |
| 44 #include "base/strings/utf_string_conversions.h" | 45 #include "base/strings/utf_string_conversions.h" |
| 45 #include "base/test/histogram_tester.h" | 46 #include "base/test/histogram_tester.h" |
| 47 #include "base/test/test_mock_time_task_runner.h" | |
| 46 #include "base/test/user_action_tester.h" | 48 #include "base/test/user_action_tester.h" |
| 47 #include "base/threading/thread_task_runner_handle.h" | 49 #include "base/threading/thread_task_runner_handle.h" |
| 48 #include "base/time/time.h" | 50 #include "base/time/time.h" |
| 49 #include "testing/gmock/include/gmock/gmock.h" | 51 #include "testing/gmock/include/gmock/gmock.h" |
| 50 #include "ui/app_list/presenter/app_list_presenter.h" | 52 #include "ui/app_list/presenter/app_list_presenter.h" |
| 51 #include "ui/aura/test/aura_test_base.h" | 53 #include "ui/aura/test/aura_test_base.h" |
| 52 #include "ui/aura/window.h" | 54 #include "ui/aura/window.h" |
| 53 #include "ui/aura/window_event_dispatcher.h" | 55 #include "ui/aura/window_event_dispatcher.h" |
| 54 #include "ui/compositor/layer.h" | 56 #include "ui/compositor/layer.h" |
| 55 #include "ui/events/event.h" | 57 #include "ui/events/event.h" |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 583 int items_added = 0; | 585 int items_added = 0; |
| 584 while (!test_api_->IsOverflowButtonVisible()) { | 586 while (!test_api_->IsOverflowButtonVisible()) { |
| 585 AddAppShortcut(); | 587 AddAppShortcut(); |
| 586 ++items_added; | 588 ++items_added; |
| 587 ASSERT_LT(items_added, 10000); | 589 ASSERT_LT(items_added, 10000); |
| 588 } | 590 } |
| 589 } | 591 } |
| 590 | 592 |
| 591 void TestDraggingAnItemFromOverflowToShelf(bool cancel) { | 593 void TestDraggingAnItemFromOverflowToShelf(bool cancel) { |
| 592 test_api_->ShowOverflowBubble(); | 594 test_api_->ShowOverflowBubble(); |
| 593 ASSERT_TRUE(test_api_->overflow_bubble() && | 595 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); |
| 594 test_api_->overflow_bubble()->IsShowing()); | |
| 595 | 596 |
| 596 ShelfViewTestAPI test_api_for_overflow( | 597 ShelfViewTestAPI test_api_for_overflow( |
| 597 test_api_->overflow_bubble()->shelf_view()); | 598 test_api_->overflow_bubble()->shelf_view()); |
| 598 | 599 |
| 599 int total_item_count = model_->item_count(); | 600 int total_item_count = model_->item_count(); |
| 600 | 601 |
| 601 int last_visible_item_id_in_shelf = | 602 int last_visible_item_id_in_shelf = |
| 602 GetItemId(test_api_->GetLastVisibleIndex()); | 603 GetItemId(test_api_->GetLastVisibleIndex()); |
| 603 int second_last_visible_item_id_in_shelf = | 604 int second_last_visible_item_id_in_shelf = |
| 604 GetItemId(test_api_->GetLastVisibleIndex() - 1); | 605 GetItemId(test_api_->GetLastVisibleIndex() - 1); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 664 EXPECT_EQ(total_item_count, model_->item_count()); | 665 EXPECT_EQ(total_item_count, model_->item_count()); |
| 665 EXPECT_EQ(last_visible_item_id_in_shelf, | 666 EXPECT_EQ(last_visible_item_id_in_shelf, |
| 666 GetItemId(test_api_for_overflow.GetFirstVisibleIndex())); | 667 GetItemId(test_api_for_overflow.GetFirstVisibleIndex())); |
| 667 EXPECT_EQ(second_last_visible_item_id_in_shelf, | 668 EXPECT_EQ(second_last_visible_item_id_in_shelf, |
| 668 GetItemId(test_api_->GetLastVisibleIndex())); | 669 GetItemId(test_api_->GetLastVisibleIndex())); |
| 669 EXPECT_EQ(first_visible_item_id_in_overflow, | 670 EXPECT_EQ(first_visible_item_id_in_overflow, |
| 670 GetItemId(test_api_for_overflow.GetFirstVisibleIndex() + 1)); | 671 GetItemId(test_api_for_overflow.GetFirstVisibleIndex() + 1)); |
| 671 EXPECT_EQ(second_last_visible_item_id_in_overflow, | 672 EXPECT_EQ(second_last_visible_item_id_in_overflow, |
| 672 GetItemId(test_api_for_overflow.GetLastVisibleIndex())); | 673 GetItemId(test_api_for_overflow.GetLastVisibleIndex())); |
| 673 } | 674 } |
| 675 test_api_->HideOverflowBubble(); | |
| 674 } | 676 } |
| 675 | 677 |
| 676 // Returns the item's ShelfID at |index|. | 678 // Returns the item's ShelfID at |index|. |
| 677 ShelfID GetItemId(int index) { | 679 ShelfID GetItemId(int index) { |
| 678 DCHECK_GE(index, 0); | 680 DCHECK_GE(index, 0); |
| 679 return model_->items()[index].id; | 681 return model_->items()[index].id; |
| 680 } | 682 } |
| 681 | 683 |
| 682 void ReplaceShelfDelegate() { | 684 void ReplaceShelfDelegate() { |
| 683 shelf_delegate_ = new TestShelfDelegateForShelfView(); | 685 shelf_delegate_ = new TestShelfDelegateForShelfView(); |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1002 views::BubbleBorder::RIGHT_TOP, views::BubbleBorder::BOTTOM_LEFT, | 1004 views::BubbleBorder::RIGHT_TOP, views::BubbleBorder::BOTTOM_LEFT, |
| 1003 }; | 1005 }; |
| 1004 | 1006 |
| 1005 for (size_t i = 0; i < arraysize(kAlignments); i++) { | 1007 for (size_t i = 0; i < arraysize(kAlignments); i++) { |
| 1006 shelf_view_->wm_shelf()->SetAlignment(kAlignments[i]); | 1008 shelf_view_->wm_shelf()->SetAlignment(kAlignments[i]); |
| 1007 | 1009 |
| 1008 // Make sure there are enough icons to trigger the overflow in new | 1010 // Make sure there are enough icons to trigger the overflow in new |
| 1009 // orientation. | 1011 // orientation. |
| 1010 AddButtonsUntilOverflow(); | 1012 AddButtonsUntilOverflow(); |
| 1011 test_api_->ShowOverflowBubble(); | 1013 test_api_->ShowOverflowBubble(); |
| 1012 ASSERT_TRUE(test_api_->overflow_bubble() && | 1014 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); |
| 1013 test_api_->overflow_bubble()->IsShowing()); | |
| 1014 | 1015 |
| 1015 EXPECT_EQ(kArrows[i], test_api_->overflow_bubble()->bubble_view()->arrow()); | 1016 EXPECT_EQ(kArrows[i], test_api_->overflow_bubble()->bubble_view()->arrow()); |
| 1016 OverflowBubbleViewTestAPI bubble_view_api( | 1017 OverflowBubbleViewTestAPI bubble_view_api( |
| 1017 test_api_->overflow_bubble()->bubble_view()); | 1018 test_api_->overflow_bubble()->bubble_view()); |
| 1018 EXPECT_EQ(kArrows[i], | 1019 EXPECT_EQ(kArrows[i], |
| 1019 bubble_view_api.GetBubbleFrameView()->bubble_border()->arrow()); | 1020 bubble_view_api.GetBubbleFrameView()->bubble_border()->arrow()); |
| 1020 } | 1021 } |
| 1021 } | 1022 } |
| 1022 | 1023 |
| 1023 // Adds button until overflow then removes first added one. Verifies that | 1024 // Adds button until overflow then removes first added one. Verifies that |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1576 // Checks the overflow bubble size when an item is ripped off and re-inserted. | 1577 // Checks the overflow bubble size when an item is ripped off and re-inserted. |
| 1577 TEST_F(ShelfViewTest, OverflowBubbleSize) { | 1578 TEST_F(ShelfViewTest, OverflowBubbleSize) { |
| 1578 shelf_delegate_->set_is_app_pinned(true); | 1579 shelf_delegate_->set_is_app_pinned(true); |
| 1579 AddButtonsUntilOverflow(); | 1580 AddButtonsUntilOverflow(); |
| 1580 // Add one more button to prevent the overflow bubble to disappear upon | 1581 // Add one more button to prevent the overflow bubble to disappear upon |
| 1581 // dragging an item out on windows (flakiness, see crbug.com/436131). | 1582 // dragging an item out on windows (flakiness, see crbug.com/436131). |
| 1582 AddAppShortcut(); | 1583 AddAppShortcut(); |
| 1583 | 1584 |
| 1584 // Show overflow bubble. | 1585 // Show overflow bubble. |
| 1585 test_api_->ShowOverflowBubble(); | 1586 test_api_->ShowOverflowBubble(); |
| 1586 ASSERT_TRUE(test_api_->overflow_bubble() && | 1587 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); |
| 1587 test_api_->overflow_bubble()->IsShowing()); | |
| 1588 | 1588 |
| 1589 ShelfViewTestAPI test_for_overflow_view( | 1589 ShelfViewTestAPI test_for_overflow_view( |
| 1590 test_api_->overflow_bubble()->shelf_view()); | 1590 test_api_->overflow_bubble()->shelf_view()); |
| 1591 | 1591 |
| 1592 int ripped_index = test_for_overflow_view.GetLastVisibleIndex(); | 1592 int ripped_index = test_for_overflow_view.GetLastVisibleIndex(); |
| 1593 gfx::Size bubble_size = test_for_overflow_view.GetPreferredSize(); | 1593 gfx::Size bubble_size = test_for_overflow_view.GetPreferredSize(); |
| 1594 int item_width = test_for_overflow_view.GetButtonSize() + | 1594 int item_width = test_for_overflow_view.GetButtonSize() + |
| 1595 test_for_overflow_view.GetButtonSpacing(); | 1595 test_for_overflow_view.GetButtonSpacing(); |
| 1596 | 1596 |
| 1597 ui::test::EventGenerator& generator = GetEventGenerator(); | 1597 ui::test::EventGenerator& generator = GetEventGenerator(); |
| 1598 ShelfButton* button = test_for_overflow_view.GetButton(ripped_index); | 1598 ShelfButton* button = test_for_overflow_view.GetButton(ripped_index); |
| 1599 // Rip off the last visible item. | 1599 // Rip off the last visible item. |
| 1600 gfx::Point start_point = button->GetBoundsInScreen().CenterPoint(); | 1600 gfx::Point start_point = button->GetBoundsInScreen().CenterPoint(); |
| 1601 gfx::Point rip_off_point(start_point.x(), 0); | 1601 gfx::Point rip_off_point(start_point.x(), 0); |
| 1602 generator.MoveMouseTo(start_point.x(), start_point.y()); | 1602 generator.MoveMouseTo(start_point.x(), start_point.y()); |
| 1603 base::RunLoop().RunUntilIdle(); | 1603 base::RunLoop().RunUntilIdle(); |
| 1604 generator.PressLeftButton(); | 1604 generator.PressLeftButton(); |
| 1605 base::RunLoop().RunUntilIdle(); | 1605 base::RunLoop().RunUntilIdle(); |
| 1606 generator.MoveMouseTo(rip_off_point.x(), rip_off_point.y()); | 1606 generator.MoveMouseTo(rip_off_point.x(), rip_off_point.y()); |
| 1607 base::RunLoop().RunUntilIdle(); | 1607 base::RunLoop().RunUntilIdle(); |
| 1608 test_for_overflow_view.RunMessageLoopUntilAnimationsDone(); | 1608 test_for_overflow_view.RunMessageLoopUntilAnimationsDone(); |
| 1609 | 1609 |
| 1610 // Check the overflow bubble size when an item is ripped off. | 1610 // Check the overflow bubble size when an item is ripped off. |
| 1611 EXPECT_EQ(bubble_size.width() - item_width, | 1611 EXPECT_EQ(bubble_size.width() - item_width, |
| 1612 test_for_overflow_view.GetPreferredSize().width()); | 1612 test_for_overflow_view.GetPreferredSize().width()); |
| 1613 ASSERT_TRUE(test_api_->overflow_bubble() && | 1613 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); |
| 1614 test_api_->overflow_bubble()->IsShowing()); | |
| 1615 | 1614 |
| 1616 // Re-insert an item into the overflow bubble. | 1615 // Re-insert an item into the overflow bubble. |
| 1617 int first_index = test_for_overflow_view.GetFirstVisibleIndex(); | 1616 int first_index = test_for_overflow_view.GetFirstVisibleIndex(); |
| 1618 button = test_for_overflow_view.GetButton(first_index); | 1617 button = test_for_overflow_view.GetButton(first_index); |
| 1619 | 1618 |
| 1620 // Check the bubble size after an item is re-inserted. | 1619 // Check the bubble size after an item is re-inserted. |
| 1621 generator.MoveMouseTo(button->GetBoundsInScreen().CenterPoint()); | 1620 generator.MoveMouseTo(button->GetBoundsInScreen().CenterPoint()); |
| 1622 test_for_overflow_view.RunMessageLoopUntilAnimationsDone(); | 1621 test_for_overflow_view.RunMessageLoopUntilAnimationsDone(); |
| 1623 EXPECT_EQ(bubble_size.width(), | 1622 EXPECT_EQ(bubble_size.width(), |
| 1624 test_for_overflow_view.GetPreferredSize().width()); | 1623 test_for_overflow_view.GetPreferredSize().width()); |
| 1625 | 1624 |
| 1626 generator.ReleaseLeftButton(); | 1625 generator.ReleaseLeftButton(); |
| 1627 test_for_overflow_view.RunMessageLoopUntilAnimationsDone(); | 1626 test_for_overflow_view.RunMessageLoopUntilAnimationsDone(); |
| 1628 EXPECT_EQ(bubble_size.width(), | 1627 EXPECT_EQ(bubble_size.width(), |
| 1629 test_for_overflow_view.GetPreferredSize().width()); | 1628 test_for_overflow_view.GetPreferredSize().width()); |
| 1630 } | 1629 } |
| 1631 | 1630 |
| 1632 // Check the drag insertion bounds of scrolled overflow bubble. | 1631 // Check the drag insertion bounds of scrolled overflow bubble. |
| 1633 TEST_F(ShelfViewTest, CheckDragInsertBoundsOfScrolledOverflowBubble) { | 1632 TEST_F(ShelfViewTest, CheckDragInsertBoundsOfScrolledOverflowBubble) { |
| 1634 UpdateDisplay("400x300"); | 1633 UpdateDisplay("400x300"); |
| 1635 | 1634 |
| 1636 EXPECT_EQ(2, model_->item_count()); | 1635 EXPECT_EQ(2, model_->item_count()); |
| 1637 | 1636 |
| 1638 AddButtonsUntilOverflow(); | 1637 AddButtonsUntilOverflow(); |
| 1639 | 1638 |
| 1640 // Show overflow bubble. | 1639 // Show overflow bubble. |
| 1641 test_api_->ShowOverflowBubble(); | 1640 test_api_->ShowOverflowBubble(); |
| 1642 ASSERT_TRUE(test_api_->overflow_bubble() && | 1641 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); |
| 1643 test_api_->overflow_bubble()->IsShowing()); | |
| 1644 | 1642 |
| 1645 int item_width = test_api_->GetButtonSize() + test_api_->GetButtonSpacing(); | 1643 int item_width = test_api_->GetButtonSize() + test_api_->GetButtonSpacing(); |
| 1646 OverflowBubbleView* bubble_view = test_api_->overflow_bubble()->bubble_view(); | 1644 OverflowBubbleView* bubble_view = test_api_->overflow_bubble()->bubble_view(); |
| 1647 OverflowBubbleViewTestAPI bubble_view_api(bubble_view); | 1645 OverflowBubbleViewTestAPI bubble_view_api(bubble_view); |
| 1648 | 1646 |
| 1649 // Add more buttons until OverflowBubble is scrollable and it has 3 invisible | 1647 // Add more buttons until OverflowBubble is scrollable and it has 3 invisible |
| 1650 // items. | 1648 // items. |
| 1651 while (bubble_view_api.GetContentsSize().width() < | 1649 while (bubble_view_api.GetContentsSize().width() < |
| 1652 (bubble_view->GetContentsBounds().width() + 3 * item_width)) | 1650 (bubble_view->GetContentsBounds().width() + 3 * item_width)) |
| 1653 AddAppShortcut(); | 1651 AddAppShortcut(); |
| 1654 | 1652 |
| 1655 ASSERT_TRUE(test_api_->overflow_bubble() && | 1653 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); |
| 1656 test_api_->overflow_bubble()->IsShowing()); | |
| 1657 | 1654 |
| 1658 ShelfViewTestAPI test_for_overflow_view( | 1655 ShelfViewTestAPI test_for_overflow_view( |
| 1659 test_api_->overflow_bubble()->shelf_view()); | 1656 test_api_->overflow_bubble()->shelf_view()); |
| 1660 int first_index = test_for_overflow_view.GetFirstVisibleIndex(); | 1657 int first_index = test_for_overflow_view.GetFirstVisibleIndex(); |
| 1661 int last_index = test_for_overflow_view.GetLastVisibleIndex(); | 1658 int last_index = test_for_overflow_view.GetLastVisibleIndex(); |
| 1662 | 1659 |
| 1663 ShelfButton* first_button = test_for_overflow_view.GetButton(first_index); | 1660 ShelfButton* first_button = test_for_overflow_view.GetButton(first_index); |
| 1664 ShelfButton* last_button = test_for_overflow_view.GetButton(last_index); | 1661 ShelfButton* last_button = test_for_overflow_view.GetButton(last_index); |
| 1665 gfx::Point first_point = first_button->GetBoundsInScreen().CenterPoint(); | 1662 gfx::Point first_point = first_button->GetBoundsInScreen().CenterPoint(); |
| 1666 gfx::Point last_point = last_button->GetBoundsInScreen().CenterPoint(); | 1663 gfx::Point last_point = last_button->GetBoundsInScreen().CenterPoint(); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 1696 | 1693 |
| 1697 ShelfViewTestAPI test_api_for_secondary(shelf_view_for_secondary); | 1694 ShelfViewTestAPI test_api_for_secondary(shelf_view_for_secondary); |
| 1698 // Speeds up animation for test. | 1695 // Speeds up animation for test. |
| 1699 test_api_for_secondary.SetAnimationDuration(1); | 1696 test_api_for_secondary.SetAnimationDuration(1); |
| 1700 | 1697 |
| 1701 AddButtonsUntilOverflow(); | 1698 AddButtonsUntilOverflow(); |
| 1702 | 1699 |
| 1703 // Test #1: Test drag insertion bounds of primary shelf. | 1700 // Test #1: Test drag insertion bounds of primary shelf. |
| 1704 // Show overflow bubble. | 1701 // Show overflow bubble. |
| 1705 test_api_->ShowOverflowBubble(); | 1702 test_api_->ShowOverflowBubble(); |
| 1706 ASSERT_TRUE(test_api_->overflow_bubble() && | 1703 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); |
| 1707 test_api_->overflow_bubble()->IsShowing()); | |
| 1708 | 1704 |
| 1709 ShelfViewTestAPI test_api_for_overflow_view( | 1705 ShelfViewTestAPI test_api_for_overflow_view( |
| 1710 test_api_->overflow_bubble()->shelf_view()); | 1706 test_api_->overflow_bubble()->shelf_view()); |
| 1711 | 1707 |
| 1712 ShelfButton* button = test_api_for_overflow_view.GetButton( | 1708 ShelfButton* button = test_api_for_overflow_view.GetButton( |
| 1713 test_api_for_overflow_view.GetLastVisibleIndex()); | 1709 test_api_for_overflow_view.GetLastVisibleIndex()); |
| 1714 | 1710 |
| 1715 // Checks that a point in shelf is contained in drag insert bounds. | 1711 // Checks that a point in shelf is contained in drag insert bounds. |
| 1716 gfx::Point point_in_shelf_view = button->GetBoundsInScreen().CenterPoint(); | 1712 gfx::Point point_in_shelf_view = button->GetBoundsInScreen().CenterPoint(); |
| 1717 gfx::Rect drag_reinsert_bounds = | 1713 gfx::Rect drag_reinsert_bounds = |
| 1718 test_api_for_overflow_view.GetBoundsForDragInsertInScreen(); | 1714 test_api_for_overflow_view.GetBoundsForDragInsertInScreen(); |
| 1719 EXPECT_TRUE(drag_reinsert_bounds.Contains(point_in_shelf_view)); | 1715 EXPECT_TRUE(drag_reinsert_bounds.Contains(point_in_shelf_view)); |
| 1720 // Checks that a point out of shelf is not contained in drag insert bounds. | 1716 // Checks that a point out of shelf is not contained in drag insert bounds. |
| 1721 EXPECT_FALSE( | 1717 EXPECT_FALSE( |
| 1722 drag_reinsert_bounds.Contains(gfx::Point(point_in_shelf_view.x(), 0))); | 1718 drag_reinsert_bounds.Contains(gfx::Point(point_in_shelf_view.x(), 0))); |
| 1723 | 1719 |
| 1724 // Test #2: Test drag insertion bounds of secondary shelf. | 1720 // Test #2: Test drag insertion bounds of secondary shelf. |
| 1725 // Show overflow bubble. | 1721 // Show overflow bubble. |
| 1726 test_api_for_secondary.ShowOverflowBubble(); | 1722 test_api_for_secondary.ShowOverflowBubble(); |
| 1727 ASSERT_TRUE(test_api_for_secondary.overflow_bubble() && | 1723 ASSERT_TRUE(test_api_for_secondary.IsShowingOverflowBubble()); |
| 1728 test_api_for_secondary.overflow_bubble()->IsShowing()); | |
| 1729 | 1724 |
| 1730 ShelfViewTestAPI test_api_for_overflow_view_of_secondary( | 1725 ShelfViewTestAPI test_api_for_overflow_view_of_secondary( |
| 1731 test_api_for_secondary.overflow_bubble()->shelf_view()); | 1726 test_api_for_secondary.overflow_bubble()->shelf_view()); |
| 1732 | 1727 |
| 1733 ShelfButton* button_in_secondary = | 1728 ShelfButton* button_in_secondary = |
| 1734 test_api_for_overflow_view_of_secondary.GetButton( | 1729 test_api_for_overflow_view_of_secondary.GetButton( |
| 1735 test_api_for_overflow_view_of_secondary.GetLastVisibleIndex()); | 1730 test_api_for_overflow_view_of_secondary.GetLastVisibleIndex()); |
| 1736 | 1731 |
| 1737 // Checks that a point in shelf is contained in drag insert bounds. | 1732 // Checks that a point in shelf is contained in drag insert bounds. |
| 1738 gfx::Point point_in_secondary_shelf_view = | 1733 gfx::Point point_in_secondary_shelf_view = |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2122 } // namespace | 2117 } // namespace |
| 2123 | 2118 |
| 2124 // Test fixture that forces material design mode in order to test ink drop | 2119 // Test fixture that forces material design mode in order to test ink drop |
| 2125 // ripples on shelf. | 2120 // ripples on shelf. |
| 2126 class ShelfViewInkDropTest : public ShelfViewTest { | 2121 class ShelfViewInkDropTest : public ShelfViewTest { |
| 2127 public: | 2122 public: |
| 2128 ShelfViewInkDropTest() {} | 2123 ShelfViewInkDropTest() {} |
| 2129 ~ShelfViewInkDropTest() override {} | 2124 ~ShelfViewInkDropTest() override {} |
| 2130 | 2125 |
| 2131 void SetUp() override { | 2126 void SetUp() override { |
| 2132 shell_delegate_ = new TestAppListShellDelegate; | 2127 ash_test_helper()->set_test_shell_delegate(CreateTestShellDelegate()); |
| 2133 ash_test_helper()->set_test_shell_delegate(shell_delegate_); | |
| 2134 | 2128 |
| 2135 set_material_mode(ash::MaterialDesignController::MATERIAL_EXPERIMENTAL); | 2129 set_material_mode(ash::MaterialDesignController::MATERIAL_EXPERIMENTAL); |
| 2136 | 2130 |
| 2137 ShelfViewTest::SetUp(); | 2131 ShelfViewTest::SetUp(); |
| 2138 } | 2132 } |
| 2139 | 2133 |
| 2140 protected: | 2134 protected: |
| 2135 // Gives subclasses a chance to return a custom test shell delegate to install | |
| 2136 // before calling base class's SetUp(). Shell will take ownership of the | |
| 2137 // returned object. | |
|
James Cook
2016/09/14 21:50:05
Nice docs.
| |
| 2138 virtual TestShellDelegate* CreateTestShellDelegate() { | |
| 2139 shell_delegate_ = new TestAppListShellDelegate; | |
| 2140 return shell_delegate_; | |
| 2141 } | |
| 2142 | |
| 2141 void InitAppListButtonInkDrop() { | 2143 void InitAppListButtonInkDrop() { |
| 2142 app_list_button_ = shelf_view_->GetAppListButton(); | 2144 app_list_button_ = shelf_view_->GetAppListButton(); |
| 2143 | 2145 |
| 2144 views::InkDropImpl* ink_drop_impl = | 2146 auto app_list_button_ink_drop = base::MakeUnique<InkDropSpy>( |
| 2145 new views::InkDropImpl(app_list_button_); | 2147 base::MakeUnique<views::InkDropImpl>(app_list_button_)); |
| 2146 app_list_button_ink_drop_ = new InkDropSpy(base::WrapUnique(ink_drop_impl)); | 2148 app_list_button_ink_drop_ = app_list_button_ink_drop.get(); |
| 2147 views::test::InkDropHostViewTestApi(app_list_button_) | 2149 views::test::InkDropHostViewTestApi(app_list_button_) |
| 2148 .SetInkDrop(base::WrapUnique(app_list_button_ink_drop_), false); | 2150 .SetInkDrop(std::move(app_list_button_ink_drop), false); |
| 2149 } | 2151 } |
| 2150 | 2152 |
| 2151 void InitBrowserButtonInkDrop() { | 2153 void InitBrowserButtonInkDrop() { |
| 2152 browser_button_ = test_api_->GetButton(browser_index_); | 2154 browser_button_ = test_api_->GetButton(browser_index_); |
| 2153 | 2155 |
| 2154 views::InkDropImpl* ink_drop_impl = new views::InkDropImpl(browser_button_); | 2156 auto browser_button_ink_drop = base::MakeUnique<InkDropSpy>( |
| 2155 browser_button_ink_drop_ = new InkDropSpy(base::WrapUnique(ink_drop_impl)); | 2157 base::MakeUnique<views::InkDropImpl>(browser_button_)); |
| 2158 browser_button_ink_drop_ = browser_button_ink_drop.get(); | |
| 2156 views::test::InkDropHostViewTestApi(browser_button_) | 2159 views::test::InkDropHostViewTestApi(browser_button_) |
| 2157 .SetInkDrop(base::WrapUnique(browser_button_ink_drop_)); | 2160 .SetInkDrop(std::move(browser_button_ink_drop)); |
| 2158 } | 2161 } |
| 2159 | 2162 |
| 2160 void ShowAppList() { | 2163 void ShowAppList() { |
| 2164 DCHECK(shelf_delegate_); | |
| 2161 shell_delegate_->app_list_presenter()->Show(0); | 2165 shell_delegate_->app_list_presenter()->Show(0); |
| 2162 // Similar to real AppListPresenter, notify button that the app list is | 2166 // Similar to real AppListPresenter, notify button that the app list is |
| 2163 // shown. | 2167 // shown. |
| 2164 app_list_button_->OnAppListShown(); | 2168 app_list_button_->OnAppListShown(); |
| 2165 } | 2169 } |
| 2166 | 2170 |
| 2167 void DismissAppList() { | 2171 void DismissAppList() { |
| 2172 DCHECK(shelf_delegate_); | |
| 2168 shell_delegate_->app_list_presenter()->Dismiss(); | 2173 shell_delegate_->app_list_presenter()->Dismiss(); |
| 2169 // Similar to real AppListPresenter, notify button that the app list is | 2174 // Similar to real AppListPresenter, notify button that the app list is |
| 2170 // dismissed. | 2175 // dismissed. |
| 2171 app_list_button_->OnAppListDismissed(); | 2176 app_list_button_->OnAppListDismissed(); |
| 2172 } | 2177 } |
| 2173 | 2178 |
| 2174 void FinishAppListVisibilityChange() { | 2179 void FinishAppListVisibilityChange() { |
| 2180 DCHECK(shelf_delegate_); | |
| 2175 shell_delegate_->app_list_presenter()->FinishVisibilityChange(); | 2181 shell_delegate_->app_list_presenter()->FinishVisibilityChange(); |
| 2176 } | 2182 } |
| 2177 | 2183 |
| 2178 TestAppListShellDelegate* shell_delegate_ = nullptr; // Owned by Shell. | 2184 TestAppListShellDelegate* shell_delegate_ = nullptr; // Owned by Shell. |
| 2179 | 2185 |
| 2180 AppListButton* app_list_button_ = nullptr; | 2186 AppListButton* app_list_button_ = nullptr; |
| 2181 InkDropSpy* app_list_button_ink_drop_ = nullptr; | 2187 InkDropSpy* app_list_button_ink_drop_ = nullptr; |
| 2182 ShelfButton* browser_button_ = nullptr; | 2188 ShelfButton* browser_button_ = nullptr; |
| 2183 InkDropSpy* browser_button_ink_drop_ = nullptr; | 2189 InkDropSpy* browser_button_ink_drop_ = nullptr; |
| 2184 | 2190 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2270 // ink drop state. | 2276 // ink drop state. |
| 2271 generator.MoveMouseBy(app_list_button_->width(), 0); | 2277 generator.MoveMouseBy(app_list_button_->width(), 0); |
| 2272 generator.MoveMouseBy(-app_list_button_->width(), 0); | 2278 generator.MoveMouseBy(-app_list_button_->width(), 0); |
| 2273 generator.ReleaseLeftButton(); | 2279 generator.ReleaseLeftButton(); |
| 2274 EXPECT_EQ(views::InkDropState::HIDDEN, | 2280 EXPECT_EQ(views::InkDropState::HIDDEN, |
| 2275 app_list_button_ink_drop_->GetTargetInkDropState()); | 2281 app_list_button_ink_drop_->GetTargetInkDropState()); |
| 2276 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), | 2282 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), |
| 2277 IsEmpty()); | 2283 IsEmpty()); |
| 2278 } | 2284 } |
| 2279 | 2285 |
| 2286 // There is no ink drop effect for gesture events on Windows. | |
| 2280 #if !defined(OS_WIN) | 2287 #if !defined(OS_WIN) |
| 2281 // There is no ink drop effect for gesture events on Windows. | |
| 2282 | |
| 2283 // Tests that when the app list is hidden, tapping on the app list button | 2288 // Tests that when the app list is hidden, tapping on the app list button |
| 2284 // transitions ink drop states correctly. | 2289 // transitions ink drop states correctly. |
| 2285 TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapWhenHidden) { | 2290 TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapWhenHidden) { |
| 2286 InitAppListButtonInkDrop(); | 2291 InitAppListButtonInkDrop(); |
| 2287 | 2292 |
| 2288 ui::test::EventGenerator& generator = GetEventGenerator(); | 2293 ui::test::EventGenerator& generator = GetEventGenerator(); |
| 2289 generator.MoveMouseTo(app_list_button_->GetBoundsInScreen().CenterPoint()); | 2294 generator.MoveMouseTo(app_list_button_->GetBoundsInScreen().CenterPoint()); |
| 2290 | 2295 |
| 2291 // Touch press on the button should end up in the pending state. | 2296 // Touch press on the button should end up in the pending state. |
| 2292 generator.PressTouch(); | 2297 generator.PressTouch(); |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2566 ui::EF_LEFT_MOUSE_BUTTON, 0); | 2571 ui::EF_LEFT_MOUSE_BUTTON, 0); |
| 2567 button->OnMouseReleased(release_event); | 2572 button->OnMouseReleased(release_event); |
| 2568 test_api_->CloseMenu(); | 2573 test_api_->CloseMenu(); |
| 2569 EXPECT_EQ(views::InkDropState::HIDDEN, | 2574 EXPECT_EQ(views::InkDropState::HIDDEN, |
| 2570 browser_button_ink_drop_->GetTargetInkDropState()); | 2575 browser_button_ink_drop_->GetTargetInkDropState()); |
| 2571 EXPECT_THAT(browser_button_ink_drop_->GetAndResetRequestedStates(), | 2576 EXPECT_THAT(browser_button_ink_drop_->GetAndResetRequestedStates(), |
| 2572 ElementsAre(views::InkDropState::ACTIVATED, | 2577 ElementsAre(views::InkDropState::ACTIVATED, |
| 2573 views::InkDropState::DEACTIVATED)); | 2578 views::InkDropState::DEACTIVATED)); |
| 2574 } | 2579 } |
| 2575 | 2580 |
| 2581 namespace { | |
| 2582 | |
| 2583 // An empty menu model for shell context menu just to have a menu. | |
| 2584 class TestShellMenuModel : public ui::SimpleMenuModel, | |
| 2585 public ui::SimpleMenuModel::Delegate { | |
| 2586 public: | |
| 2587 TestShellMenuModel() : ui::SimpleMenuModel(this) {} | |
| 2588 ~TestShellMenuModel() override {} | |
| 2589 | |
| 2590 private: | |
| 2591 // ui::SimpleMenuModel::Delegate: | |
| 2592 bool IsCommandIdChecked(int command_id) const override { return false; } | |
| 2593 bool IsCommandIdEnabled(int command_id) const override { return true; } | |
| 2594 void ExecuteCommand(int command_id, int event_flags) override {} | |
| 2595 | |
| 2596 DISALLOW_COPY_AND_ASSIGN(TestShellMenuModel); | |
| 2597 }; | |
| 2598 | |
| 2599 // A test ShellDelegate implementation for overflow button tests that returns a | |
| 2600 // TestShelfMenuModel for the shell context menu. | |
| 2601 class TestOverflowButtonShellDelegate : public TestShellDelegate { | |
| 2602 public: | |
| 2603 TestOverflowButtonShellDelegate() {} | |
| 2604 ~TestOverflowButtonShellDelegate() override {} | |
| 2605 | |
| 2606 // TestShellDelegate: | |
| 2607 ui::MenuModel* CreateContextMenu(WmShelf* wm_shelf, | |
| 2608 const ShelfItem* item) override { | |
| 2609 // Caller takes ownership of the returned object. | |
| 2610 return new TestShellMenuModel; | |
| 2611 } | |
| 2612 | |
| 2613 private: | |
| 2614 DISALLOW_COPY_AND_ASSIGN(TestOverflowButtonShellDelegate); | |
| 2615 }; | |
| 2616 | |
| 2617 // A scoped wrapper around TestMockTimeTaskRunner that replaces message loop's | |
| 2618 // task runner with a TestMockTimeTaskRunner and resets it back at the end of | |
| 2619 // the scope. | |
| 2620 class ScopedMockTaskRunnerWrapper { | |
| 2621 public: | |
| 2622 ScopedMockTaskRunnerWrapper() { | |
| 2623 mock_task_runner_ = new base::TestMockTimeTaskRunner; | |
| 2624 previous_task_runner_ = base::MessageLoop::current()->task_runner(); | |
| 2625 base::MessageLoop::current()->SetTaskRunner(mock_task_runner_); | |
| 2626 } | |
| 2627 | |
| 2628 ~ScopedMockTaskRunnerWrapper() { | |
| 2629 DCHECK_EQ(mock_task_runner_, base::MessageLoop::current()->task_runner()); | |
| 2630 mock_task_runner_->ClearPendingTasks(); | |
| 2631 base::MessageLoop::current()->SetTaskRunner(previous_task_runner_); | |
| 2632 } | |
| 2633 | |
| 2634 void FastForwardUntilNoTasksRemain() { | |
| 2635 mock_task_runner_->FastForwardUntilNoTasksRemain(); | |
| 2636 } | |
| 2637 | |
| 2638 private: | |
| 2639 scoped_refptr<base::TestMockTimeTaskRunner> mock_task_runner_; | |
| 2640 scoped_refptr<base::SingleThreadTaskRunner> previous_task_runner_; | |
| 2641 | |
| 2642 DISALLOW_COPY_AND_ASSIGN(ScopedMockTaskRunnerWrapper); | |
| 2643 }; | |
| 2644 | |
| 2645 } // namespace | |
| 2646 | |
| 2647 // Test fixture for testing material design ink drop on overflow button. | |
| 2648 class OverflowButtonInkDropTest : public ShelfViewInkDropTest { | |
| 2649 public: | |
| 2650 OverflowButtonInkDropTest() {} | |
| 2651 ~OverflowButtonInkDropTest() override {} | |
| 2652 | |
| 2653 void SetUp() override { | |
| 2654 ShelfViewInkDropTest::SetUp(); | |
| 2655 | |
| 2656 overflow_button_ = test_api_->overflow_button(); | |
| 2657 | |
| 2658 auto overflow_button_ink_drop = base::MakeUnique<InkDropSpy>( | |
| 2659 base::MakeUnique<views::InkDropImpl>(overflow_button_)); | |
| 2660 overflow_button_ink_drop_ = overflow_button_ink_drop.get(); | |
| 2661 views::test::InkDropHostViewTestApi(overflow_button_) | |
| 2662 .SetInkDrop(std::move(overflow_button_ink_drop)); | |
| 2663 | |
| 2664 AddButtonsUntilOverflow(); | |
| 2665 EXPECT_TRUE(test_api_->IsOverflowButtonVisible()); | |
| 2666 EXPECT_FALSE(test_api_->IsShowingOverflowBubble()); | |
| 2667 } | |
| 2668 | |
| 2669 protected: | |
| 2670 gfx::Point GetScreenPointInsideOverflowButton() const { | |
| 2671 return overflow_button_->GetBoundsInScreen().CenterPoint(); | |
| 2672 } | |
| 2673 | |
| 2674 gfx::Point GetScreenPointOutsideOverflowButton() const { | |
| 2675 gfx::Point point = GetScreenPointInsideOverflowButton(); | |
| 2676 point.Offset(overflow_button_->width(), 0); | |
| 2677 return point; | |
| 2678 } | |
| 2679 | |
| 2680 // Overridden from ShelfViewInkDropTest: | |
| 2681 TestShellDelegate* CreateTestShellDelegate() override { | |
| 2682 return new TestOverflowButtonShellDelegate; | |
| 2683 } | |
| 2684 | |
| 2685 OverflowButton* overflow_button_ = nullptr; | |
| 2686 InkDropSpy* overflow_button_ink_drop_ = nullptr; | |
| 2687 | |
| 2688 private: | |
| 2689 DISALLOW_COPY_AND_ASSIGN(OverflowButtonInkDropTest); | |
| 2690 }; | |
| 2691 | |
| 2692 // Tests ink drop state transitions for the overflow button when the overflow | |
| 2693 // bubble is shown or hidden. | |
| 2694 TEST_F(OverflowButtonInkDropTest, OnOverflowBubbleShowHide) { | |
| 2695 test_api_->ShowOverflowBubble(); | |
| 2696 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | |
| 2697 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 2698 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2699 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2700 ElementsAre(views::InkDropState::ACTIVATED)); | |
| 2701 | |
| 2702 test_api_->HideOverflowBubble(); | |
| 2703 EXPECT_FALSE(test_api_->IsShowingOverflowBubble()); | |
| 2704 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 2705 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2706 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2707 ElementsAre(views::InkDropState::DEACTIVATED)); | |
| 2708 } | |
| 2709 | |
| 2710 // Tests ink drop state transitions for the overflow button when the user clicks | |
| 2711 // on it. | |
| 2712 TEST_F(OverflowButtonInkDropTest, MouseActivate) { | |
| 2713 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 2714 gfx::Point mouse_location = GetScreenPointInsideOverflowButton(); | |
| 2715 generator.MoveMouseTo(mouse_location); | |
| 2716 | |
| 2717 generator.PressLeftButton(); | |
| 2718 EXPECT_EQ(views::InkDropState::ACTION_PENDING, | |
| 2719 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2720 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2721 ElementsAre(views::InkDropState::ACTION_PENDING)); | |
| 2722 | |
| 2723 generator.ReleaseLeftButton(); | |
| 2724 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 2725 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2726 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2727 ElementsAre(views::InkDropState::ACTIVATED)); | |
| 2728 | |
| 2729 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | |
| 2730 } | |
| 2731 | |
| 2732 // Tests ink drop state transitions for the overflow button when the user | |
| 2733 // presses left mouse button on it and drags it out of the button bounds. | |
| 2734 TEST_F(OverflowButtonInkDropTest, MouseDragOut) { | |
| 2735 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 2736 generator.MoveMouseTo(GetScreenPointInsideOverflowButton()); | |
| 2737 | |
| 2738 generator.PressLeftButton(); | |
| 2739 EXPECT_EQ(views::InkDropState::ACTION_PENDING, | |
| 2740 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2741 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2742 ElementsAre(views::InkDropState::ACTION_PENDING)); | |
| 2743 | |
| 2744 generator.MoveMouseTo(GetScreenPointOutsideOverflowButton()); | |
| 2745 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 2746 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2747 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2748 ElementsAre(views::InkDropState::HIDDEN)); | |
| 2749 | |
| 2750 generator.ReleaseLeftButton(); | |
| 2751 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 2752 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2753 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2754 IsEmpty()); | |
| 2755 | |
| 2756 EXPECT_FALSE(test_api_->IsShowingOverflowBubble()); | |
| 2757 } | |
| 2758 | |
| 2759 // Tests ink drop state transitions for the overflow button when the user | |
| 2760 // presses left mouse button on it and drags it out of the button bounds and | |
| 2761 // back. | |
| 2762 TEST_F(OverflowButtonInkDropTest, MouseDragOutAndBack) { | |
| 2763 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 2764 generator.MoveMouseTo(GetScreenPointInsideOverflowButton()); | |
| 2765 | |
| 2766 generator.PressLeftButton(); | |
| 2767 EXPECT_EQ(views::InkDropState::ACTION_PENDING, | |
| 2768 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2769 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2770 ElementsAre(views::InkDropState::ACTION_PENDING)); | |
| 2771 | |
| 2772 generator.MoveMouseTo(GetScreenPointOutsideOverflowButton()); | |
| 2773 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 2774 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2775 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2776 ElementsAre(views::InkDropState::HIDDEN)); | |
| 2777 | |
| 2778 generator.MoveMouseTo(GetScreenPointInsideOverflowButton()); | |
| 2779 EXPECT_EQ(views::InkDropState::ACTION_PENDING, | |
| 2780 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2781 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2782 ElementsAre(views::InkDropState::ACTION_PENDING)); | |
| 2783 | |
| 2784 generator.ReleaseLeftButton(); | |
| 2785 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 2786 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2787 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2788 ElementsAre(views::InkDropState::ACTIVATED)); | |
| 2789 | |
| 2790 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | |
| 2791 } | |
| 2792 | |
| 2793 // Tests ink drop state transitions for the overflow button when the user right | |
| 2794 // clicks on the button to show the context menu. | |
| 2795 TEST_F(OverflowButtonInkDropTest, MouseContextMenu) { | |
| 2796 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 2797 generator.MoveMouseTo(GetScreenPointInsideOverflowButton()); | |
| 2798 | |
| 2799 generator.PressRightButton(); | |
| 2800 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 2801 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2802 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2803 IsEmpty()); | |
| 2804 | |
| 2805 generator.ReleaseRightButton(); | |
| 2806 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 2807 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2808 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2809 IsEmpty()); | |
| 2810 | |
| 2811 EXPECT_FALSE(test_api_->IsShowingOverflowBubble()); | |
| 2812 } | |
| 2813 | |
| 2814 // There is no ink drop effect for gesture events on Windows. | |
| 2815 #if !defined(OS_WIN) | |
| 2816 // Tests ink drop state transitions for the overflow button when the user taps | |
| 2817 // on it. | |
| 2818 TEST_F(OverflowButtonInkDropTest, TouchActivate) { | |
| 2819 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 2820 generator.set_current_location(GetScreenPointInsideOverflowButton()); | |
| 2821 | |
| 2822 generator.PressTouch(); | |
| 2823 EXPECT_EQ(views::InkDropState::ACTION_PENDING, | |
| 2824 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2825 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2826 ElementsAre(views::InkDropState::ACTION_PENDING)); | |
| 2827 | |
| 2828 generator.ReleaseTouch(); | |
| 2829 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 2830 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2831 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2832 ElementsAre(views::InkDropState::ACTIVATED)); | |
| 2833 | |
| 2834 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | |
| 2835 } | |
| 2836 | |
| 2837 // Tests ink drop state transitions for the overflow button when the user taps | |
| 2838 // down on it and drags it out of the button bounds. | |
| 2839 TEST_F(OverflowButtonInkDropTest, TouchDragOut) { | |
| 2840 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 2841 generator.set_current_location(GetScreenPointInsideOverflowButton()); | |
| 2842 | |
| 2843 generator.PressTouch(); | |
| 2844 EXPECT_EQ(views::InkDropState::ACTION_PENDING, | |
| 2845 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2846 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2847 ElementsAre(views::InkDropState::ACTION_PENDING)); | |
| 2848 | |
| 2849 generator.MoveTouch(GetScreenPointOutsideOverflowButton()); | |
| 2850 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 2851 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2852 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2853 ElementsAre(views::InkDropState::HIDDEN)); | |
| 2854 | |
| 2855 generator.ReleaseTouch(); | |
| 2856 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 2857 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2858 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2859 IsEmpty()); | |
| 2860 | |
| 2861 EXPECT_FALSE(test_api_->IsShowingOverflowBubble()); | |
| 2862 } | |
| 2863 | |
| 2864 // Tests ink drop state transitions for the overflow button when the user taps | |
| 2865 // down on it and drags it out of the button bounds and back. | |
| 2866 TEST_F(OverflowButtonInkDropTest, TouchDragOutAndBack) { | |
| 2867 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 2868 generator.set_current_location(GetScreenPointInsideOverflowButton()); | |
| 2869 | |
| 2870 generator.PressTouch(); | |
| 2871 EXPECT_EQ(views::InkDropState::ACTION_PENDING, | |
| 2872 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2873 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2874 ElementsAre(views::InkDropState::ACTION_PENDING)); | |
| 2875 | |
| 2876 generator.MoveTouch(GetScreenPointOutsideOverflowButton()); | |
| 2877 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 2878 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2879 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2880 ElementsAre(views::InkDropState::HIDDEN)); | |
| 2881 | |
| 2882 generator.MoveTouch(GetScreenPointInsideOverflowButton()); | |
| 2883 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 2884 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2885 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2886 IsEmpty()); | |
| 2887 | |
| 2888 generator.ReleaseTouch(); | |
| 2889 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 2890 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2891 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2892 IsEmpty()); | |
| 2893 | |
| 2894 EXPECT_FALSE(test_api_->IsShowingOverflowBubble()); | |
| 2895 } | |
| 2896 | |
| 2897 // Tests ink drop state transitions for the overflow button when the user long | |
| 2898 // presses on the button to show the context menu. | |
| 2899 TEST_F(OverflowButtonInkDropTest, TouchContextMenu) { | |
| 2900 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 2901 generator.set_current_location(GetScreenPointInsideOverflowButton()); | |
| 2902 | |
| 2903 RunAllPendingInMessageLoop(); | |
| 2904 { | |
| 2905 ScopedMockTaskRunnerWrapper mock_task_runner; | |
| 2906 | |
| 2907 generator.PressTouch(); | |
| 2908 EXPECT_EQ(views::InkDropState::ACTION_PENDING, | |
| 2909 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2910 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2911 ElementsAre(views::InkDropState::ACTION_PENDING)); | |
| 2912 | |
| 2913 mock_task_runner.FastForwardUntilNoTasksRemain(); | |
| 2914 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 2915 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2916 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2917 ElementsAre(views::InkDropState::ALTERNATE_ACTION_PENDING, | |
| 2918 views::InkDropState::HIDDEN)); | |
| 2919 | |
| 2920 generator.ReleaseTouch(); | |
| 2921 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 2922 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2923 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2924 IsEmpty()); | |
| 2925 | |
| 2926 EXPECT_FALSE(test_api_->IsShowingOverflowBubble()); | |
| 2927 } | |
| 2928 } | |
| 2929 | |
| 2930 #endif // !defined(OS_WIN) | |
| 2931 | |
| 2932 // Test fixture for testing material design ink drop on overflow button when it | |
| 2933 // is active. | |
| 2934 class OverflowButtonActiveInkDropTest : public OverflowButtonInkDropTest { | |
| 2935 public: | |
| 2936 OverflowButtonActiveInkDropTest() {} | |
| 2937 ~OverflowButtonActiveInkDropTest() override {} | |
| 2938 | |
| 2939 void SetUp() override { | |
| 2940 OverflowButtonInkDropTest::SetUp(); | |
| 2941 | |
| 2942 test_api_->ShowOverflowBubble(); | |
| 2943 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | |
| 2944 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 2945 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2946 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2947 ElementsAre(views::InkDropState::ACTIVATED)); | |
| 2948 } | |
| 2949 | |
| 2950 private: | |
| 2951 DISALLOW_COPY_AND_ASSIGN(OverflowButtonActiveInkDropTest); | |
| 2952 }; | |
| 2953 | |
| 2954 // Tests ink drop state transitions for the overflow button when it is active | |
| 2955 // and the user clicks on it. | |
| 2956 TEST_F(OverflowButtonActiveInkDropTest, MouseDeactivate) { | |
| 2957 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 2958 generator.MoveMouseTo(GetScreenPointInsideOverflowButton()); | |
| 2959 | |
| 2960 generator.PressLeftButton(); | |
| 2961 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 2962 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2963 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2964 IsEmpty()); | |
| 2965 | |
| 2966 generator.ReleaseLeftButton(); | |
| 2967 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 2968 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2969 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2970 ElementsAre(views::InkDropState::DEACTIVATED)); | |
| 2971 | |
| 2972 EXPECT_FALSE(test_api_->IsShowingOverflowBubble()); | |
| 2973 } | |
| 2974 | |
| 2975 // Tests ink drop state transitions for the overflow button when it is active | |
| 2976 // and the user presses left mouse button on it and drags it out of the button | |
| 2977 // bounds. | |
| 2978 TEST_F(OverflowButtonActiveInkDropTest, MouseDragOut) { | |
| 2979 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 2980 generator.MoveMouseTo(GetScreenPointInsideOverflowButton()); | |
| 2981 | |
| 2982 generator.PressLeftButton(); | |
| 2983 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 2984 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2985 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2986 IsEmpty()); | |
| 2987 | |
| 2988 generator.MoveMouseTo(GetScreenPointOutsideOverflowButton()); | |
| 2989 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 2990 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2991 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2992 IsEmpty()); | |
| 2993 | |
| 2994 generator.ReleaseLeftButton(); | |
| 2995 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 2996 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 2997 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 2998 IsEmpty()); | |
| 2999 | |
| 3000 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | |
| 3001 } | |
| 3002 | |
| 3003 // Tests ink drop state transitions for the overflow button when it is active | |
| 3004 // and the user presses left mouse button on it and drags it out of the button | |
| 3005 // bounds and back. | |
| 3006 TEST_F(OverflowButtonActiveInkDropTest, MouseDragOutAndBack) { | |
| 3007 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 3008 generator.MoveMouseTo(GetScreenPointInsideOverflowButton()); | |
| 3009 | |
| 3010 generator.PressLeftButton(); | |
| 3011 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3012 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3013 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3014 IsEmpty()); | |
| 3015 | |
| 3016 generator.MoveMouseTo(GetScreenPointOutsideOverflowButton()); | |
| 3017 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3018 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3019 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3020 IsEmpty()); | |
| 3021 | |
| 3022 generator.MoveMouseTo(GetScreenPointInsideOverflowButton()); | |
| 3023 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3024 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3025 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3026 IsEmpty()); | |
| 3027 | |
| 3028 generator.ReleaseLeftButton(); | |
| 3029 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 3030 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3031 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3032 ElementsAre(views::InkDropState::DEACTIVATED)); | |
| 3033 | |
| 3034 EXPECT_FALSE(test_api_->IsShowingOverflowBubble()); | |
| 3035 } | |
| 3036 | |
| 3037 // Tests ink drop state transitions for the overflow button when it is active | |
| 3038 // and the user right clicks on the button to show the context menu. | |
| 3039 TEST_F(OverflowButtonActiveInkDropTest, MouseContextMenu) { | |
| 3040 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 3041 generator.MoveMouseTo(GetScreenPointInsideOverflowButton()); | |
| 3042 | |
| 3043 generator.PressRightButton(); | |
| 3044 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3045 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3046 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3047 IsEmpty()); | |
| 3048 | |
| 3049 generator.ReleaseRightButton(); | |
| 3050 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3051 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3052 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3053 IsEmpty()); | |
| 3054 | |
| 3055 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | |
| 3056 } | |
| 3057 | |
| 3058 // There is no ink drop effect for gesture events on Windows. | |
| 3059 #if !defined(OS_WIN) | |
| 3060 // Tests ink drop state transitions for the overflow button when it is active | |
| 3061 // and the user taps on it. | |
| 3062 TEST_F(OverflowButtonActiveInkDropTest, TouchDeactivate) { | |
| 3063 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 3064 generator.set_current_location(GetScreenPointInsideOverflowButton()); | |
| 3065 | |
| 3066 generator.PressTouch(); | |
| 3067 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3068 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3069 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3070 IsEmpty()); | |
| 3071 | |
| 3072 generator.ReleaseTouch(); | |
| 3073 EXPECT_EQ(views::InkDropState::HIDDEN, | |
| 3074 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3075 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3076 ElementsAre(views::InkDropState::DEACTIVATED, | |
| 3077 views::InkDropState::HIDDEN)); | |
| 3078 | |
| 3079 EXPECT_FALSE(test_api_->IsShowingOverflowBubble()); | |
| 3080 } | |
| 3081 | |
| 3082 // Tests ink drop state transitions for the overflow button when it is active | |
| 3083 // and the user taps down on it and drags it out of the button bounds. | |
| 3084 TEST_F(OverflowButtonActiveInkDropTest, TouchDragOut) { | |
| 3085 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 3086 generator.set_current_location(GetScreenPointInsideOverflowButton()); | |
| 3087 | |
| 3088 generator.PressTouch(); | |
| 3089 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3090 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3091 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3092 IsEmpty()); | |
| 3093 | |
| 3094 generator.MoveTouch(GetScreenPointOutsideOverflowButton()); | |
| 3095 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3096 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3097 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3098 IsEmpty()); | |
| 3099 | |
| 3100 generator.ReleaseTouch(); | |
| 3101 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3102 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3103 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3104 IsEmpty()); | |
| 3105 | |
| 3106 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | |
| 3107 } | |
| 3108 | |
| 3109 // Tests ink drop state transitions for the overflow button when it is active | |
| 3110 // and the user taps down on it and drags it out of the button bounds and back. | |
| 3111 TEST_F(OverflowButtonActiveInkDropTest, TouchDragOutAndBack) { | |
| 3112 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 3113 generator.set_current_location(GetScreenPointInsideOverflowButton()); | |
| 3114 | |
| 3115 generator.PressTouch(); | |
| 3116 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3117 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3118 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3119 IsEmpty()); | |
| 3120 | |
| 3121 generator.MoveTouch(GetScreenPointOutsideOverflowButton()); | |
| 3122 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3123 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3124 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3125 IsEmpty()); | |
| 3126 | |
| 3127 generator.MoveTouch(GetScreenPointInsideOverflowButton()); | |
| 3128 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3129 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3130 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3131 IsEmpty()); | |
| 3132 | |
| 3133 generator.ReleaseTouch(); | |
| 3134 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3135 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3136 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3137 IsEmpty()); | |
| 3138 | |
| 3139 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | |
| 3140 } | |
| 3141 | |
| 3142 // Tests ink drop state transitions for the overflow button when it is active | |
| 3143 // and the user long presses on the button to show the context menu. | |
| 3144 TEST_F(OverflowButtonActiveInkDropTest, TouchContextMenu) { | |
| 3145 ui::test::EventGenerator& generator = GetEventGenerator(); | |
| 3146 generator.set_current_location(GetScreenPointInsideOverflowButton()); | |
| 3147 | |
| 3148 RunAllPendingInMessageLoop(); | |
| 3149 { | |
| 3150 ScopedMockTaskRunnerWrapper mock_task_runner; | |
| 3151 | |
| 3152 generator.PressTouch(); | |
| 3153 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3154 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3155 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3156 IsEmpty()); | |
| 3157 | |
| 3158 mock_task_runner.FastForwardUntilNoTasksRemain(); | |
| 3159 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3160 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3161 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3162 IsEmpty()); | |
| 3163 | |
| 3164 generator.ReleaseTouch(); | |
| 3165 EXPECT_EQ(views::InkDropState::ACTIVATED, | |
| 3166 overflow_button_ink_drop_->GetTargetInkDropState()); | |
| 3167 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | |
| 3168 IsEmpty()); | |
| 3169 | |
| 3170 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | |
| 3171 } | |
| 3172 } | |
| 3173 | |
| 3174 #endif // !defined(OS_WIN) | |
| 3175 | |
| 2576 } // namespace test | 3176 } // namespace test |
| 2577 } // namespace ash | 3177 } // namespace ash |
| OLD | NEW |