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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
7 #include "chrome/test/base/interactive_test_utils.h" | 7 #include "chrome/test/base/interactive_test_utils.h" |
8 #include "chrome/test/base/ui_controls.h" | 8 #include "chrome/test/base/ui_controls.h" |
9 #include "chrome/test/base/ui_test_utils.h" | 9 #include "chrome/test/base/ui_test_utils.h" |
10 #include "chrome/test/base/view_event_test_base.h" | 10 #include "chrome/test/base/view_event_test_base.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 button_, | 106 button_, |
107 ui_controls::LEFT, | 107 ui_controls::LEFT, |
108 ui_controls::DOWN | ui_controls::UP, | 108 ui_controls::DOWN | ui_controls::UP, |
109 CreateEventTask(this, &ButtonDropDownDragTest::Step4)); | 109 CreateEventTask(this, &ButtonDropDownDragTest::Step4)); |
110 } | 110 } |
111 | 111 |
112 void Step4() { | 112 void Step4() { |
113 // One more hop is required because ui::SimpleMenuModel calls | 113 // One more hop is required because ui::SimpleMenuModel calls |
114 // ui::SimpleMenuModel::Delegate::MenuClosed() via a posted | 114 // ui::SimpleMenuModel::Delegate::MenuClosed() via a posted |
115 // task. | 115 // task. |
116 MessageLoopForUI::current()->PostTask( | 116 base::MessageLoopForUI::current()->PostTask( |
117 FROM_HERE, | 117 FROM_HERE, CreateEventTask(this, &ButtonDropDownDragTest::Step5)); |
118 CreateEventTask(this, &ButtonDropDownDragTest::Step5)); | |
119 } | 118 } |
120 | 119 |
121 void Step5() { | 120 void Step5() { |
122 ASSERT_TRUE(menu_closed_); | 121 ASSERT_TRUE(menu_closed_); |
123 Done(); | 122 Done(); |
124 } | 123 } |
125 | 124 |
126 private: | 125 private: |
127 views::ButtonDropDown* button_; | 126 views::ButtonDropDown* button_; |
128 bool menu_shown_; | 127 bool menu_shown_; |
129 bool menu_closed_; | 128 bool menu_closed_; |
130 }; | 129 }; |
131 | 130 |
132 #if defined(OS_WIN) | 131 #if defined(OS_WIN) |
133 #define MAYBE_DragActivation DISABLED_DragActivation | 132 #define MAYBE_DragActivation DISABLED_DragActivation |
134 #else | 133 #else |
135 #define MAYBE_DragActivation DragActivation | 134 #define MAYBE_DragActivation DragActivation |
136 #endif | 135 #endif |
137 VIEW_TEST(ButtonDropDownDragTest, MAYBE_DragActivation) | 136 VIEW_TEST(ButtonDropDownDragTest, MAYBE_DragActivation) |
OLD | NEW |