OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ui/strings/grit/ui_strings.h" | 5 #include "ui/strings/grit/ui_strings.h" |
6 #include "ui/touch_selection/touch_selection_menu_runner.h" | 6 #include "ui/touch_selection/touch_selection_menu_runner.h" |
7 #include "ui/views/test/views_test_base.h" | 7 #include "ui/views/test/views_test_base.h" |
8 #include "ui/views/touchui/touch_selection_menu_runner_views.h" | 8 #include "ui/views/touchui/touch_selection_menu_runner_views.h" |
9 #include "ui/views/views_delegate.h" | |
10 | 9 |
11 namespace views { | 10 namespace views { |
12 namespace { | 11 namespace { |
13 | 12 |
14 // Should match |kMenuButtonWidth| in touch_selection_menu_runner_views.cc. | 13 // Should match |kMenuButtonWidth| in touch_selection_menu_runner_views.cc. |
15 const int kMenuButtonWidth = 63; | 14 const int kMenuButtonWidth = 63; |
16 | 15 |
17 // Should match size of |kMenuCommands| array in | 16 // Should match size of |kMenuCommands| array in |
18 // touch_selection_menu_runner_views.cc. | 17 // touch_selection_menu_runner_views.cc. |
19 const int kMenuCommandCount = 3; | 18 const int kMenuCommandCount = 3; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // Set anchor rect's width a bit greater than the quick menu width plus handle | 100 // Set anchor rect's width a bit greater than the quick menu width plus handle |
102 // image width and check that anchor rect's height is not adjusted. | 101 // image width and check that anchor rect's height is not adjusted. |
103 anchor_rect = | 102 anchor_rect = |
104 gfx::Rect(0, 0, quick_menu_width + handle_size.width() + 10, 20); | 103 gfx::Rect(0, 0, quick_menu_width + handle_size.width() + 10, 20); |
105 ui::TouchSelectionMenuRunner::GetInstance()->OpenMenu( | 104 ui::TouchSelectionMenuRunner::GetInstance()->OpenMenu( |
106 this, anchor_rect, handle_size, GetContext()); | 105 this, anchor_rect, handle_size, GetContext()); |
107 EXPECT_EQ(anchor_rect, GetMenuAnchorRect()); | 106 EXPECT_EQ(anchor_rect, GetMenuAnchorRect()); |
108 } | 107 } |
109 | 108 |
110 } // namespace views | 109 } // namespace views |
OLD | NEW |