Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: ash/shelf/shelf_view_unittest.cc

Issue 2808723004: Renames WmShell to ShellPort (Closed)
Patch Set: feedback Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "ash/public/cpp/shell_window_ids.h" 12 #include "ash/public/cpp/shell_window_ids.h"
13 #include "ash/root_window_controller.h" 13 #include "ash/root_window_controller.h"
14 #include "ash/shelf/app_list_button.h" 14 #include "ash/shelf/app_list_button.h"
15 #include "ash/shelf/overflow_bubble.h" 15 #include "ash/shelf/overflow_bubble.h"
16 #include "ash/shelf/overflow_bubble_view.h" 16 #include "ash/shelf/overflow_bubble_view.h"
17 #include "ash/shelf/overflow_button.h" 17 #include "ash/shelf/overflow_button.h"
18 #include "ash/shelf/shelf_button.h" 18 #include "ash/shelf/shelf_button.h"
19 #include "ash/shelf/shelf_constants.h" 19 #include "ash/shelf/shelf_constants.h"
20 #include "ash/shelf/shelf_model.h" 20 #include "ash/shelf/shelf_model.h"
21 #include "ash/shelf/shelf_tooltip_manager.h" 21 #include "ash/shelf/shelf_tooltip_manager.h"
22 #include "ash/shelf/shelf_widget.h" 22 #include "ash/shelf/shelf_widget.h"
23 #include "ash/shelf/wm_shelf.h" 23 #include "ash/shelf/wm_shelf.h"
24 #include "ash/shelf/wm_shelf_observer.h" 24 #include "ash/shelf/wm_shelf_observer.h"
25 #include "ash/shell.h" 25 #include "ash/shell.h"
26 #include "ash/shell_port.h"
26 #include "ash/system/web_notification/web_notification_tray.h" 27 #include "ash/system/web_notification/web_notification_tray.h"
27 #include "ash/test/ash_test_base.h" 28 #include "ash/test/ash_test_base.h"
28 #include "ash/test/ash_test_helper.h" 29 #include "ash/test/ash_test_helper.h"
29 #include "ash/test/overflow_bubble_view_test_api.h" 30 #include "ash/test/overflow_bubble_view_test_api.h"
30 #include "ash/test/overflow_button_test_api.h" 31 #include "ash/test/overflow_button_test_api.h"
31 #include "ash/test/shelf_view_test_api.h" 32 #include "ash/test/shelf_view_test_api.h"
32 #include "ash/test/shell_test_api.h" 33 #include "ash/test/shell_test_api.h"
33 #include "ash/test/test_shelf_delegate.h" 34 #include "ash/test/test_shelf_delegate.h"
34 #include "ash/test/test_shelf_item_delegate.h" 35 #include "ash/test/test_shelf_item_delegate.h"
35 #include "ash/test/test_shell_delegate.h" 36 #include "ash/test/test_shell_delegate.h"
36 #include "ash/test/test_system_tray_delegate.h" 37 #include "ash/test/test_system_tray_delegate.h"
37 #include "ash/wm_shell.h"
38 #include "ash/wm_window.h" 38 #include "ash/wm_window.h"
39 #include "base/i18n/rtl.h" 39 #include "base/i18n/rtl.h"
40 #include "base/macros.h" 40 #include "base/macros.h"
41 #include "base/memory/ptr_util.h" 41 #include "base/memory/ptr_util.h"
42 #include "base/numerics/safe_conversions.h" 42 #include "base/numerics/safe_conversions.h"
43 #include "base/run_loop.h" 43 #include "base/run_loop.h"
44 #include "base/strings/string_number_conversions.h" 44 #include "base/strings/string_number_conversions.h"
45 #include "base/strings/utf_string_conversions.h" 45 #include "base/strings/utf_string_conversions.h"
46 #include "base/test/histogram_tester.h" 46 #include "base/test/histogram_tester.h"
47 #include "base/test/scoped_mock_time_message_loop_task_runner.h" 47 #include "base/test/scoped_mock_time_message_loop_task_runner.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 widget.GetNativeWindow()->parent()->RemoveChild(widget.GetNativeWindow()); 193 widget.GetNativeWindow()->parent()->RemoveChild(widget.GetNativeWindow());
194 shelf_view_test()->RunMessageLoopUntilAnimationsDone(); 194 shelf_view_test()->RunMessageLoopUntilAnimationsDone();
195 EXPECT_TRUE(observer()->icon_positions_changed()); 195 EXPECT_TRUE(observer()->icon_positions_changed());
196 observer()->Reset(); 196 observer()->Reset();
197 } 197 }
198 198
199 // Make sure creating/deleting an window on one displays notifies a 199 // Make sure creating/deleting an window on one displays notifies a
200 // shelf on external display as well as one on primary. 200 // shelf on external display as well as one on primary.
201 TEST_F(WmShelfObserverIconTest, AddRemoveWithMultipleDisplays) { 201 TEST_F(WmShelfObserverIconTest, AddRemoveWithMultipleDisplays) {
202 // TODO: investigate failure in mash, http://crbug.com/695751. 202 // TODO: investigate failure in mash, http://crbug.com/695751.
203 if (WmShell::Get()->IsRunningInMash()) 203 if (ShellPort::Get()->IsRunningInMash())
204 return; 204 return;
205 205
206 UpdateDisplay("400x400,400x400"); 206 UpdateDisplay("400x400,400x400");
207 WmWindow* second_root = WmShell::Get()->GetAllRootWindows()[1]; 207 WmWindow* second_root = ShellPort::Get()->GetAllRootWindows()[1];
208 WmShelf* second_shelf = second_root->GetRootWindowController()->GetShelf(); 208 WmShelf* second_shelf = second_root->GetRootWindowController()->GetShelf();
209 TestWmShelfObserver second_observer(second_shelf); 209 TestWmShelfObserver second_observer(second_shelf);
210 210
211 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); 211 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
212 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 212 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
213 params.bounds = gfx::Rect(0, 0, 200, 200); 213 params.bounds = gfx::Rect(0, 0, 200, 200);
214 params.context = CurrentContext(); 214 params.context = CurrentContext();
215 views::Widget widget; 215 views::Widget widget;
216 widget.Init(params); 216 widget.Init(params);
217 217
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 } 697 }
698 698
699 gfx::Point GetButtonCenter(ShelfButton* button) { 699 gfx::Point GetButtonCenter(ShelfButton* button) {
700 return button->GetBoundsInScreen().CenterPoint(); 700 return button->GetBoundsInScreen().CenterPoint();
701 } 701 }
702 702
703 ShelfModel* model_; 703 ShelfModel* model_;
704 ShelfView* shelf_view_; 704 ShelfView* shelf_view_;
705 int browser_index_; 705 int browser_index_;
706 706
707 // Owned by ash::WmShell. 707 // Owned by ash::ShellPort.
708 TestShelfDelegateForShelfView* shelf_delegate_; 708 TestShelfDelegateForShelfView* shelf_delegate_;
709 709
710 std::unique_ptr<ShelfViewTestAPI> test_api_; 710 std::unique_ptr<ShelfViewTestAPI> test_api_;
711 711
712 private: 712 private:
713 DISALLOW_COPY_AND_ASSIGN(ShelfViewTest); 713 DISALLOW_COPY_AND_ASSIGN(ShelfViewTest);
714 }; 714 };
715 715
716 const char* 716 const char*
717 ShelfViewTest::kTimeBetweenWindowMinimizedAndActivatedActionsHistogramName = 717 ShelfViewTest::kTimeBetweenWindowMinimizedAndActivatedActionsHistogramName =
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 first_point = first_button->GetBoundsInScreen().CenterPoint(); 1649 first_point = first_button->GetBoundsInScreen().CenterPoint();
1650 last_point = last_button->GetBoundsInScreen().CenterPoint(); 1650 last_point = last_button->GetBoundsInScreen().CenterPoint();
1651 EXPECT_FALSE(drag_reinsert_bounds.Contains(first_point)); 1651 EXPECT_FALSE(drag_reinsert_bounds.Contains(first_point));
1652 EXPECT_TRUE(drag_reinsert_bounds.Contains(last_point)); 1652 EXPECT_TRUE(drag_reinsert_bounds.Contains(last_point));
1653 } 1653 }
1654 1654
1655 // Check the drag insertion bounds of shelf view in multi monitor environment. 1655 // Check the drag insertion bounds of shelf view in multi monitor environment.
1656 TEST_F(ShelfViewTest, CheckDragInsertBoundsWithMultiMonitor) { 1656 TEST_F(ShelfViewTest, CheckDragInsertBoundsWithMultiMonitor) {
1657 UpdateDisplay("800x600,800x600"); 1657 UpdateDisplay("800x600,800x600");
1658 WmShelf* secondary_shelf = 1658 WmShelf* secondary_shelf =
1659 WmShelf::ForWindow(WmShell::Get()->GetAllRootWindows()[1]); 1659 WmShelf::ForWindow(ShellPort::Get()->GetAllRootWindows()[1]);
1660 ShelfView* shelf_view_for_secondary = 1660 ShelfView* shelf_view_for_secondary =
1661 secondary_shelf->GetShelfViewForTesting(); 1661 secondary_shelf->GetShelfViewForTesting();
1662 1662
1663 // The bounds should be big enough for 4 buttons + overflow chevron. 1663 // The bounds should be big enough for 4 buttons + overflow chevron.
1664 shelf_view_for_secondary->SetBounds(0, 0, 500, GetShelfConstant(SHELF_SIZE)); 1664 shelf_view_for_secondary->SetBounds(0, 0, 500, GetShelfConstant(SHELF_SIZE));
1665 1665
1666 ShelfViewTestAPI test_api_for_secondary(shelf_view_for_secondary); 1666 ShelfViewTestAPI test_api_for_secondary(shelf_view_for_secondary);
1667 // Speeds up animation for test. 1667 // Speeds up animation for test.
1668 test_api_for_secondary.SetAnimationDuration(1); 1668 test_api_for_secondary.SetAnimationDuration(1);
1669 1669
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 EXPECT_FALSE(drag_reinsert_bounds_in_secondary.Contains( 1712 EXPECT_FALSE(drag_reinsert_bounds_in_secondary.Contains(
1713 gfx::Point(point_in_secondary_shelf_view.x(), 0))); 1713 gfx::Point(point_in_secondary_shelf_view.x(), 0)));
1714 // Checks that a point of overflow bubble in primary shelf should not be 1714 // Checks that a point of overflow bubble in primary shelf should not be
1715 // contained by insert bounds of secondary shelf. 1715 // contained by insert bounds of secondary shelf.
1716 EXPECT_FALSE(drag_reinsert_bounds_in_secondary.Contains(point_in_shelf_view)); 1716 EXPECT_FALSE(drag_reinsert_bounds_in_secondary.Contains(point_in_shelf_view));
1717 } 1717 }
1718 1718
1719 // Checks the rip an item off from left aligned shelf in secondary monitor. 1719 // Checks the rip an item off from left aligned shelf in secondary monitor.
1720 TEST_F(ShelfViewTest, CheckRipOffFromLeftShelfAlignmentWithMultiMonitor) { 1720 TEST_F(ShelfViewTest, CheckRipOffFromLeftShelfAlignmentWithMultiMonitor) {
1721 UpdateDisplay("800x600,800x600"); 1721 UpdateDisplay("800x600,800x600");
1722 ASSERT_EQ(2U, WmShell::Get()->GetAllRootWindows().size()); 1722 ASSERT_EQ(2U, ShellPort::Get()->GetAllRootWindows().size());
1723 1723
1724 WmWindow* second_root = WmShell::Get()->GetAllRootWindows()[1]; 1724 WmWindow* second_root = ShellPort::Get()->GetAllRootWindows()[1];
1725 WmShelf* secondary_shelf = second_root->GetRootWindowController()->GetShelf(); 1725 WmShelf* secondary_shelf = second_root->GetRootWindowController()->GetShelf();
1726 1726
1727 secondary_shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); 1727 secondary_shelf->SetAlignment(SHELF_ALIGNMENT_LEFT);
1728 ASSERT_EQ(SHELF_ALIGNMENT_LEFT, secondary_shelf->alignment()); 1728 ASSERT_EQ(SHELF_ALIGNMENT_LEFT, secondary_shelf->alignment());
1729 1729
1730 // Initially, app list and browser shortcut are added. 1730 // Initially, app list and browser shortcut are added.
1731 EXPECT_EQ(2, model_->item_count()); 1731 EXPECT_EQ(2, model_->item_count());
1732 int browser_index = model_->GetItemIndexForType(TYPE_BROWSER_SHORTCUT); 1732 int browser_index = model_->GetItemIndexForType(TYPE_BROWSER_SHORTCUT);
1733 EXPECT_GT(browser_index, 0); 1733 EXPECT_GT(browser_index, 0);
1734 1734
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1778 // invisible. 1778 // invisible.
1779 SetShelfItemTypeToAppShortcut(platform_app_id); 1779 SetShelfItemTypeToAppShortcut(platform_app_id);
1780 EXPECT_FALSE(GetButtonByID(platform_app_id)->visible()); 1780 EXPECT_FALSE(GetButtonByID(platform_app_id)->visible());
1781 } 1781 }
1782 1782
1783 // Verifies that Launcher_ButtonPressed_* UMA user actions are recorded when an 1783 // Verifies that Launcher_ButtonPressed_* UMA user actions are recorded when an
1784 // item is selected. 1784 // item is selected.
1785 TEST_F(ShelfViewTest, 1785 TEST_F(ShelfViewTest,
1786 Launcher_ButtonPressedUserActionsRecordedWhenItemSelected) { 1786 Launcher_ButtonPressedUserActionsRecordedWhenItemSelected) {
1787 // TODO: investigate failure in mash, http://crbug.com/695751. 1787 // TODO: investigate failure in mash, http://crbug.com/695751.
1788 if (WmShell::Get()->IsRunningInMash()) 1788 if (ShellPort::Get()->IsRunningInMash())
1789 return; 1789 return;
1790 1790
1791 base::UserActionTester user_action_tester; 1791 base::UserActionTester user_action_tester;
1792 1792
1793 ShelfID browser_shelf_id = model_->items()[browser_index_].id; 1793 ShelfID browser_shelf_id = model_->items()[browser_index_].id;
1794 ShelfItemSelectionTracker* selection_tracker = new ShelfItemSelectionTracker; 1794 ShelfItemSelectionTracker* selection_tracker = new ShelfItemSelectionTracker;
1795 model_->SetShelfItemDelegate( 1795 model_->SetShelfItemDelegate(
1796 browser_shelf_id, 1796 browser_shelf_id,
1797 base::WrapUnique<ShelfItemSelectionTracker>(selection_tracker)); 1797 base::WrapUnique<ShelfItemSelectionTracker>(selection_tracker));
1798 1798
1799 SimulateClick(browser_index_); 1799 SimulateClick(browser_index_);
1800 EXPECT_EQ(1, 1800 EXPECT_EQ(1,
1801 user_action_tester.GetActionCount("Launcher_ButtonPressed_Mouse")); 1801 user_action_tester.GetActionCount("Launcher_ButtonPressed_Mouse"));
1802 } 1802 }
1803 1803
1804 // Verifies that Launcher_*Task UMA user actions are recorded when an item is 1804 // Verifies that Launcher_*Task UMA user actions are recorded when an item is
1805 // selected. 1805 // selected.
1806 TEST_F(ShelfViewTest, Launcher_TaskUserActionsRecordedWhenItemSelected) { 1806 TEST_F(ShelfViewTest, Launcher_TaskUserActionsRecordedWhenItemSelected) {
1807 // TODO: investigate failure in mash, http://crbug.com/695751. 1807 // TODO: investigate failure in mash, http://crbug.com/695751.
1808 if (WmShell::Get()->IsRunningInMash()) 1808 if (ShellPort::Get()->IsRunningInMash())
1809 return; 1809 return;
1810 1810
1811 base::UserActionTester user_action_tester; 1811 base::UserActionTester user_action_tester;
1812 1812
1813 ShelfID browser_shelf_id = model_->items()[browser_index_].id; 1813 ShelfID browser_shelf_id = model_->items()[browser_index_].id;
1814 ShelfItemSelectionTracker* selection_tracker = new ShelfItemSelectionTracker; 1814 ShelfItemSelectionTracker* selection_tracker = new ShelfItemSelectionTracker;
1815 selection_tracker->set_item_selected_action(SHELF_ACTION_NEW_WINDOW_CREATED); 1815 selection_tracker->set_item_selected_action(SHELF_ACTION_NEW_WINDOW_CREATED);
1816 model_->SetShelfItemDelegate( 1816 model_->SetShelfItemDelegate(
1817 browser_shelf_id, 1817 browser_shelf_id,
1818 base::WrapUnique<ShelfItemSelectionTracker>(selection_tracker)); 1818 base::WrapUnique<ShelfItemSelectionTracker>(selection_tracker));
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
2090 InkDropSpy* browser_button_ink_drop_ = nullptr; 2090 InkDropSpy* browser_button_ink_drop_ = nullptr;
2091 2091
2092 private: 2092 private:
2093 DISALLOW_COPY_AND_ASSIGN(ShelfViewInkDropTest); 2093 DISALLOW_COPY_AND_ASSIGN(ShelfViewInkDropTest);
2094 }; 2094 };
2095 2095
2096 // Tests that changing visibility of the app list transitions app list button's 2096 // Tests that changing visibility of the app list transitions app list button's
2097 // ink drop states correctly. 2097 // ink drop states correctly.
2098 TEST_F(ShelfViewInkDropTest, AppListButtonWhenVisibilityChanges) { 2098 TEST_F(ShelfViewInkDropTest, AppListButtonWhenVisibilityChanges) {
2099 // TODO: investigate failure in mash, http://crbug.com/695751. 2099 // TODO: investigate failure in mash, http://crbug.com/695751.
2100 if (WmShell::Get()->IsRunningInMash()) 2100 if (ShellPort::Get()->IsRunningInMash())
2101 return; 2101 return;
2102 2102
2103 InitAppListButtonInkDrop(); 2103 InitAppListButtonInkDrop();
2104 2104
2105 ShowAppList(); 2105 ShowAppList();
2106 FinishAppListVisibilityChange(); 2106 FinishAppListVisibilityChange();
2107 EXPECT_EQ(views::InkDropState::ACTIVATED, 2107 EXPECT_EQ(views::InkDropState::ACTIVATED,
2108 app_list_button_ink_drop_->GetTargetInkDropState()); 2108 app_list_button_ink_drop_->GetTargetInkDropState());
2109 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), 2109 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
2110 ElementsAre(views::InkDropState::ACTIVATED)); 2110 ElementsAre(views::InkDropState::ACTIVATED));
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2147 app_list_button_ink_drop_->GetTargetInkDropState()); 2147 app_list_button_ink_drop_->GetTargetInkDropState());
2148 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), 2148 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
2149 IsEmpty()); 2149 IsEmpty());
2150 } 2150 }
2151 2151
2152 // Tests that when the app list is visible, mouse press on the app list button, 2152 // Tests that when the app list is visible, mouse press on the app list button,
2153 // which dismisses the app list, transitions ink drop states correctly. Also, 2153 // which dismisses the app list, transitions ink drop states correctly. Also,
2154 // tests that mouse drag and mouse release does not affect the ink drop state. 2154 // tests that mouse drag and mouse release does not affect the ink drop state.
2155 TEST_F(ShelfViewInkDropTest, AppListButtonMouseEventsWhenVisible) { 2155 TEST_F(ShelfViewInkDropTest, AppListButtonMouseEventsWhenVisible) {
2156 // TODO: investigate failure in mash, http://crbug.com/695751. 2156 // TODO: investigate failure in mash, http://crbug.com/695751.
2157 if (WmShell::Get()->IsRunningInMash()) 2157 if (ShellPort::Get()->IsRunningInMash())
2158 return; 2158 return;
2159 2159
2160 InitAppListButtonInkDrop(); 2160 InitAppListButtonInkDrop();
2161 2161
2162 ShowAppList(); 2162 ShowAppList();
2163 FinishAppListVisibilityChange(); 2163 FinishAppListVisibilityChange();
2164 EXPECT_EQ(views::InkDropState::ACTIVATED, 2164 EXPECT_EQ(views::InkDropState::ACTIVATED,
2165 app_list_button_ink_drop_->GetTargetInkDropState()); 2165 app_list_button_ink_drop_->GetTargetInkDropState());
2166 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), 2166 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
2167 ElementsAre(views::InkDropState::ACTIVATED)); 2167 ElementsAre(views::InkDropState::ACTIVATED));
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
2214 EXPECT_EQ(views::InkDropState::ACTIVATED, 2214 EXPECT_EQ(views::InkDropState::ACTIVATED,
2215 app_list_button_ink_drop_->GetTargetInkDropState()); 2215 app_list_button_ink_drop_->GetTargetInkDropState());
2216 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), 2216 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
2217 ElementsAre(views::InkDropState::ACTIVATED)); 2217 ElementsAre(views::InkDropState::ACTIVATED));
2218 } 2218 }
2219 2219
2220 // Tests that when the app list is visible, tapping on the app list button 2220 // Tests that when the app list is visible, tapping on the app list button
2221 // transitions ink drop states correctly. 2221 // transitions ink drop states correctly.
2222 TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapWhenVisible) { 2222 TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapWhenVisible) {
2223 // TODO: investigate failure in mash, http://crbug.com/695751. 2223 // TODO: investigate failure in mash, http://crbug.com/695751.
2224 if (WmShell::Get()->IsRunningInMash()) 2224 if (ShellPort::Get()->IsRunningInMash())
2225 return; 2225 return;
2226 2226
2227 InitAppListButtonInkDrop(); 2227 InitAppListButtonInkDrop();
2228 2228
2229 ShowAppList(); 2229 ShowAppList();
2230 FinishAppListVisibilityChange(); 2230 FinishAppListVisibilityChange();
2231 EXPECT_EQ(views::InkDropState::ACTIVATED, 2231 EXPECT_EQ(views::InkDropState::ACTIVATED,
2232 app_list_button_ink_drop_->GetTargetInkDropState()); 2232 app_list_button_ink_drop_->GetTargetInkDropState());
2233 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), 2233 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
2234 ElementsAre(views::InkDropState::ACTIVATED)); 2234 ElementsAre(views::InkDropState::ACTIVATED));
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
2284 EXPECT_EQ(views::InkDropState::HIDDEN, 2284 EXPECT_EQ(views::InkDropState::HIDDEN,
2285 app_list_button_ink_drop_->GetTargetInkDropState()); 2285 app_list_button_ink_drop_->GetTargetInkDropState());
2286 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), 2286 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
2287 IsEmpty()); 2287 IsEmpty());
2288 } 2288 }
2289 2289
2290 // Tests that when the app list is visible, tapping down on the app list button 2290 // Tests that when the app list is visible, tapping down on the app list button
2291 // and dragging the touch point transitions ink drop states correctly. 2291 // and dragging the touch point transitions ink drop states correctly.
2292 TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapDragWhenVisible) { 2292 TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapDragWhenVisible) {
2293 // TODO: investigate failure in mash, http://crbug.com/695751. 2293 // TODO: investigate failure in mash, http://crbug.com/695751.
2294 if (WmShell::Get()->IsRunningInMash()) 2294 if (ShellPort::Get()->IsRunningInMash())
2295 return; 2295 return;
2296 2296
2297 InitAppListButtonInkDrop(); 2297 InitAppListButtonInkDrop();
2298 2298
2299 ShowAppList(); 2299 ShowAppList();
2300 FinishAppListVisibilityChange(); 2300 FinishAppListVisibilityChange();
2301 EXPECT_EQ(views::InkDropState::ACTIVATED, 2301 EXPECT_EQ(views::InkDropState::ACTIVATED,
2302 app_list_button_ink_drop_->GetTargetInkDropState()); 2302 app_list_button_ink_drop_->GetTargetInkDropState());
2303 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(), 2303 EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
2304 ElementsAre(views::InkDropState::ACTIVATED)); 2304 ElementsAre(views::InkDropState::ACTIVATED));
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
3119 EXPECT_EQ(views::InkDropState::ACTIVATED, 3119 EXPECT_EQ(views::InkDropState::ACTIVATED,
3120 overflow_button_ink_drop_->GetTargetInkDropState()); 3120 overflow_button_ink_drop_->GetTargetInkDropState());
3121 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), 3121 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(),
3122 IsEmpty()); 3122 IsEmpty());
3123 3123
3124 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); 3124 ASSERT_TRUE(test_api_->IsShowingOverflowBubble());
3125 } 3125 }
3126 3126
3127 } // namespace test 3127 } // namespace test
3128 } // namespace ash 3128 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698