| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/base/models/simple_menu_model.h" | 7 #include "ui/base/models/simple_menu_model.h" |
| 8 #include "chrome/browser/automation/ui_controls.h" | 8 #include "chrome/browser/automation/ui_controls.h" |
| 9 #include "chrome/test/interactive_ui/view_event_test_base.h" | 9 #include "chrome/test/interactive_ui/view_event_test_base.h" |
| 10 #include "views/controls/button/button_dropdown.h" | 10 #include "views/controls/button/button_dropdown.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 virtual bool GetAcceleratorForCommandId( | 53 virtual bool GetAcceleratorForCommandId( |
| 54 int id, | 54 int id, |
| 55 ui::Accelerator* accelerator) OVERRIDE { | 55 ui::Accelerator* accelerator) OVERRIDE { |
| 56 return false; | 56 return false; |
| 57 } | 57 } |
| 58 | 58 |
| 59 virtual void ExecuteCommand(int id) OVERRIDE { | 59 virtual void ExecuteCommand(int id) OVERRIDE { |
| 60 } | 60 } |
| 61 | 61 |
| 62 virtual void MenuWillShow() OVERRIDE { | 62 virtual void MenuWillShow(ui::SimpleMenuModel* /*source*/) OVERRIDE { |
| 63 menu_shown_ = true; | 63 menu_shown_ = true; |
| 64 } | 64 } |
| 65 | 65 |
| 66 virtual void MenuClosed() OVERRIDE { | 66 virtual void MenuClosed(ui::SimpleMenuModel* /*source*/) OVERRIDE { |
| 67 menu_closed_ = true; | 67 menu_closed_ = true; |
| 68 } | 68 } |
| 69 | 69 |
| 70 // ViewEventTestBase implementation. | 70 // ViewEventTestBase implementation. |
| 71 virtual void DoTestOnMessageLoop() OVERRIDE { | 71 virtual void DoTestOnMessageLoop() OVERRIDE { |
| 72 // Click on the ButtonDropDown. | 72 // Click on the ButtonDropDown. |
| 73 ui_controls::MoveMouseToCenterAndPress( | 73 ui_controls::MoveMouseToCenterAndPress( |
| 74 button_, | 74 button_, |
| 75 ui_controls::LEFT, | 75 ui_controls::LEFT, |
| 76 ui_controls::DOWN, | 76 ui_controls::DOWN, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 | 122 |
| 123 private: | 123 private: |
| 124 views::ButtonDropDown* button_; | 124 views::ButtonDropDown* button_; |
| 125 ui::SimpleMenuModel menu_model_; | 125 ui::SimpleMenuModel menu_model_; |
| 126 bool menu_shown_; | 126 bool menu_shown_; |
| 127 bool menu_closed_; | 127 bool menu_closed_; |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 VIEW_TEST(ButtonDropDownDragTest, DragActivation) | 130 VIEW_TEST(ButtonDropDownDragTest, DragActivation) |
| OLD | NEW |