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

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

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse event constructor Created 3 years, 8 months 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
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/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 event_generator_->ReleaseKey(key_code, flags); 235 event_generator_->ReleaseKey(key_code, flags);
236 } 236 }
237 237
238 View* GetFocusedView() { 238 View* GetFocusedView() {
239 return widget_->GetFocusManager()->GetFocusedView(); 239 return widget_->GetFocusManager()->GetFocusedView();
240 } 240 }
241 241
242 void PerformMousePress(const gfx::Point& point) { 242 void PerformMousePress(const gfx::Point& point) {
243 ui::MouseEvent pressed_event = ui::MouseEvent( 243 ui::MouseEvent pressed_event = ui::MouseEvent(
244 ui::ET_MOUSE_PRESSED, point, point, ui::EventTimeForNow(), 244 ui::ET_MOUSE_PRESSED, point, point, ui::EventTimeForNow(),
245 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); 245 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
246 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
246 widget_->OnMouseEvent(&pressed_event); 247 widget_->OnMouseEvent(&pressed_event);
247 } 248 }
248 249
249 void PerformMouseRelease(const gfx::Point& point) { 250 void PerformMouseRelease(const gfx::Point& point) {
250 ui::MouseEvent released_event = ui::MouseEvent( 251 ui::MouseEvent released_event = ui::MouseEvent(
251 ui::ET_MOUSE_RELEASED, point, point, ui::EventTimeForNow(), 252 ui::ET_MOUSE_RELEASED, point, point, ui::EventTimeForNow(),
252 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); 253 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
254 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
253 widget_->OnMouseEvent(&released_event); 255 widget_->OnMouseEvent(&released_event);
254 } 256 }
255 257
256 void PerformClick(const gfx::Point& point) { 258 void PerformClick(const gfx::Point& point) {
257 PerformMousePress(point); 259 PerformMousePress(point);
258 PerformMouseRelease(point); 260 PerformMouseRelease(point);
259 } 261 }
260 262
261 // We need widget to populate wrapper class. 263 // We need widget to populate wrapper class.
262 Widget* widget_ = nullptr; 264 Widget* widget_ = nullptr;
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 EXPECT_EQ(ui::MenuModel::TYPE_COMMAND, menu_model->GetTypeAt(0)); 918 EXPECT_EQ(ui::MenuModel::TYPE_COMMAND, menu_model->GetTypeAt(0));
917 EXPECT_EQ(ui::MenuModel::TYPE_COMMAND, menu_model->GetTypeAt(1)); 919 EXPECT_EQ(ui::MenuModel::TYPE_COMMAND, menu_model->GetTypeAt(1));
918 920
919 EXPECT_EQ(ASCIIToUTF16("PEANUT BUTTER"), menu_model->GetLabelAt(0)); 921 EXPECT_EQ(ASCIIToUTF16("PEANUT BUTTER"), menu_model->GetLabelAt(0));
920 EXPECT_EQ(ASCIIToUTF16("JELLY"), menu_model->GetLabelAt(1)); 922 EXPECT_EQ(ASCIIToUTF16("JELLY"), menu_model->GetLabelAt(1));
921 EXPECT_FALSE(menu_model->IsVisibleAt(0)); 923 EXPECT_FALSE(menu_model->IsVisibleAt(0));
922 EXPECT_TRUE(menu_model->IsVisibleAt(1)); 924 EXPECT_TRUE(menu_model->IsVisibleAt(1));
923 } 925 }
924 926
925 } // namespace views 927 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698