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 #ifndef ASH_TEST_SHELF_VIEW_TEST_API_H_ | 5 #ifndef ASH_TEST_SHELF_VIEW_TEST_API_H_ |
6 #define ASH_TEST_SHELF_VIEW_TEST_API_H_ | 6 #define ASH_TEST_SHELF_VIEW_TEST_API_H_ |
7 | 7 |
8 #include "ash/common/shelf/shelf_item_delegate.h" | 8 #include "ash/common/shelf/shelf_item_delegate.h" |
9 #include "ash/common/shelf/shelf_item_types.h" | 9 #include "ash/common/shelf/shelf_item_types.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 | 11 |
12 namespace gfx { | 12 namespace gfx { |
13 class Rect; | 13 class Rect; |
14 class Size; | 14 class Size; |
15 } | 15 } |
16 | 16 |
17 namespace ui { | 17 namespace ui { |
18 class Event; | 18 class Event; |
19 } | 19 } |
20 | 20 |
21 namespace views { | 21 namespace views { |
22 class Button; | 22 class Button; |
23 class InkDrop; | 23 class InkDrop; |
24 } | 24 } |
25 | 25 |
26 namespace ash { | 26 namespace ash { |
27 class OverflowBubble; | 27 class OverflowBubble; |
28 class OverflowButton; | |
28 class ShelfButton; | 29 class ShelfButton; |
29 class ShelfButtonPressedMetricTracker; | 30 class ShelfButtonPressedMetricTracker; |
30 class ShelfDelegate; | 31 class ShelfDelegate; |
31 class ShelfTooltipManager; | 32 class ShelfTooltipManager; |
32 class ShelfView; | 33 class ShelfView; |
33 | 34 |
34 namespace test { | 35 namespace test { |
35 | 36 |
36 // Use the api in this class to test ShelfView. | 37 // Use the api in this class to test ShelfView. |
37 class ShelfViewTestAPI { | 38 class ShelfViewTestAPI { |
(...skipping 16 matching lines...) Expand all Loading... | |
54 // Gets current/ideal bounds for button at |index|. | 55 // Gets current/ideal bounds for button at |index|. |
55 const gfx::Rect& GetBoundsByIndex(int index); | 56 const gfx::Rect& GetBoundsByIndex(int index); |
56 const gfx::Rect& GetIdealBoundsByIndex(int index); | 57 const gfx::Rect& GetIdealBoundsByIndex(int index); |
57 | 58 |
58 // Returns true if overflow button is visible. | 59 // Returns true if overflow button is visible. |
59 bool IsOverflowButtonVisible(); | 60 bool IsOverflowButtonVisible(); |
60 | 61 |
61 // Makes shelf view show its overflow bubble. | 62 // Makes shelf view show its overflow bubble. |
62 void ShowOverflowBubble(); | 63 void ShowOverflowBubble(); |
63 | 64 |
65 // Makes shelf view hide its overflow bubble. | |
66 void HideOverflowBubble(); | |
67 | |
68 // Returns true if the overflow bubble is visible. | |
69 bool IsShowingOverflowBubble() const; | |
James Cook
2016/09/14 21:50:05
Nice, makes tests easier to read.
| |
70 | |
64 // Sets animation duration in milliseconds for test. | 71 // Sets animation duration in milliseconds for test. |
65 void SetAnimationDuration(int duration_ms); | 72 void SetAnimationDuration(int duration_ms); |
66 | 73 |
67 // Runs message loop and waits until all add/remove animations are done. | 74 // Runs message loop and waits until all add/remove animations are done. |
68 void RunMessageLoopUntilAnimationsDone(); | 75 void RunMessageLoopUntilAnimationsDone(); |
69 | 76 |
70 // Closes the app list or context menu if it is running. | 77 // Closes the app list or context menu if it is running. |
71 void CloseMenu(); | 78 void CloseMenu(); |
72 | 79 |
73 // An accessor for |shelf_view|. | 80 // An accessor for |shelf_view|. |
74 ShelfView* shelf_view() { return shelf_view_; } | 81 ShelfView* shelf_view() { return shelf_view_; } |
75 | 82 |
76 // An accessor for the shelf tooltip manager. | 83 // An accessor for the shelf tooltip manager. |
77 ShelfTooltipManager* tooltip_manager(); | 84 ShelfTooltipManager* tooltip_manager(); |
78 | 85 |
79 // An accessor for overflow bubble. | 86 // An accessor for overflow bubble. |
80 OverflowBubble* overflow_bubble(); | 87 OverflowBubble* overflow_bubble(); |
81 | 88 |
89 // An accessor for overflow button. | |
90 OverflowButton* overflow_button() const; | |
91 | |
82 // Returns the preferred size of |shelf_view_|. | 92 // Returns the preferred size of |shelf_view_|. |
83 gfx::Size GetPreferredSize(); | 93 gfx::Size GetPreferredSize(); |
84 | 94 |
85 // Returns the button size. | 95 // Returns the button size. |
86 int GetButtonSize(); | 96 int GetButtonSize(); |
87 | 97 |
88 // Returns the button space size. | 98 // Returns the button space size. |
89 int GetButtonSpacing(); | 99 int GetButtonSpacing(); |
90 | 100 |
91 // Returns minimum distance before drag starts. | 101 // Returns minimum distance before drag starts. |
(...skipping 25 matching lines...) Expand all Loading... | |
117 private: | 127 private: |
118 ShelfView* shelf_view_; | 128 ShelfView* shelf_view_; |
119 | 129 |
120 DISALLOW_COPY_AND_ASSIGN(ShelfViewTestAPI); | 130 DISALLOW_COPY_AND_ASSIGN(ShelfViewTestAPI); |
121 }; | 131 }; |
122 | 132 |
123 } // namespace test | 133 } // namespace test |
124 } // namespace ash | 134 } // namespace ash |
125 | 135 |
126 #endif // ASH_TEST_SHELF_VIEW_TEST_API_H_ | 136 #endif // ASH_TEST_SHELF_VIEW_TEST_API_H_ |
OLD | NEW |