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

Side by Side Diff: ui/views/controls/combobox/combobox_unittest.cc

Issue 101573006: Changes MouseEvent constructor to take changed_button_flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test; needs updated expectations as mouse entered wasnt sent before because of env::mouse_butto… Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/button/radio_button.cc ('k') | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/views/controls/combobox/combobox.h" 5 #include "ui/views/controls/combobox/combobox.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 input_method_->DispatchKeyEvent(event); 213 input_method_->DispatchKeyEvent(event);
214 } 214 }
215 215
216 View* GetFocusedView() { 216 View* GetFocusedView() {
217 return widget_->GetFocusManager()->GetFocusedView(); 217 return widget_->GetFocusManager()->GetFocusedView();
218 } 218 }
219 219
220 void PerformClick(const gfx::Point& point) { 220 void PerformClick(const gfx::Point& point) {
221 ui::MouseEvent pressed_event = ui::MouseEvent(ui::ET_MOUSE_PRESSED, point, 221 ui::MouseEvent pressed_event = ui::MouseEvent(ui::ET_MOUSE_PRESSED, point,
222 point, 222 point,
223 ui::EF_LEFT_MOUSE_BUTTON,
223 ui::EF_LEFT_MOUSE_BUTTON); 224 ui::EF_LEFT_MOUSE_BUTTON);
224 widget_->OnMouseEvent(&pressed_event); 225 widget_->OnMouseEvent(&pressed_event);
225 ui::MouseEvent released_event = ui::MouseEvent(ui::ET_MOUSE_RELEASED, point, 226 ui::MouseEvent released_event = ui::MouseEvent(ui::ET_MOUSE_RELEASED, point,
226 point, 227 point,
228 ui::EF_LEFT_MOUSE_BUTTON,
227 ui::EF_LEFT_MOUSE_BUTTON); 229 ui::EF_LEFT_MOUSE_BUTTON);
228 widget_->OnMouseEvent(&released_event); 230 widget_->OnMouseEvent(&released_event);
229 } 231 }
230 232
231 // We need widget to populate wrapper class. 233 // We need widget to populate wrapper class.
232 Widget* widget_; 234 Widget* widget_;
233 235
234 // |combobox_| will be allocated InitCombobox() and then owned by |widget_|. 236 // |combobox_| will be allocated InitCombobox() and then owned by |widget_|.
235 TestCombobox* combobox_; 237 TestCombobox* combobox_;
236 238
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 test_api.reset( 531 test_api.reset(
530 new test::MenuRunnerTestAPI(combobox_->dropdown_list_menu_runner_.get())); 532 new test::MenuRunnerTestAPI(combobox_->dropdown_list_menu_runner_.get()));
531 test_api->SetMenuRunnerHandler(menu_runner_handler.Pass()); 533 test_api->SetMenuRunnerHandler(menu_runner_handler.Pass());
532 PerformClick(gfx::Point(combobox_->x() + 1, 534 PerformClick(gfx::Point(combobox_->x() + 1,
533 combobox_->y() + combobox_->height() / 2)); 535 combobox_->y() + combobox_->height() / 2));
534 EXPECT_TRUE(listener.on_combobox_text_button_clicked_called()); 536 EXPECT_TRUE(listener.on_combobox_text_button_clicked_called());
535 EXPECT_FALSE(test_menu_runner_handler->executed()); 537 EXPECT_FALSE(test_menu_runner_handler->executed());
536 } 538 }
537 539
538 } // namespace views 540 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/radio_button.cc ('k') | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698