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

Unified Diff: ui/aura/window_event_dispatcher_unittest.cc

Issue 139983009: ui::LocatedEvent location() returns gfx::PointF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo accidental change. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: ui/aura/window_event_dispatcher_unittest.cc
diff --git a/ui/aura/window_event_dispatcher_unittest.cc b/ui/aura/window_event_dispatcher_unittest.cc
index 5f677b90d538a81ff9422e4088be637d281b0d27..0437e7d3e9485b0dd30020e2c247b491dbc88a88 100644
--- a/ui/aura/window_event_dispatcher_unittest.cc
+++ b/ui/aura/window_event_dispatcher_unittest.cc
@@ -60,7 +60,7 @@ class NonClientDelegate : public test::TestWindowDelegate {
}
virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
mouse_event_count_++;
- mouse_event_location_ = event->location();
+ mouse_event_location_ = gfx::ToFlooredPoint(event->location());
mouse_event_flags_ = event->flags();
event->SetHandled();
}
@@ -212,13 +212,14 @@ TEST_F(WindowEventDispatcherTest, TranslatedEvent) {
gfx::Point origin(100, 100);
ui::MouseEvent root(ui::ET_MOUSE_PRESSED, origin, origin, 0, 0);
- EXPECT_EQ("100,100", root.location().ToString());
+ EXPECT_EQ("100,100", gfx::ToFlooredPoint(root.location()).ToString());
EXPECT_EQ("100,100", root.root_location().ToString());
ui::MouseEvent translated_event(
root, static_cast<Window*>(root_window()), w1.get(),
ui::ET_MOUSE_ENTERED, root.flags());
- EXPECT_EQ("50,50", translated_event.location().ToString());
+ EXPECT_EQ("50,50",
+ gfx::ToFlooredPoint(translated_event.location()).ToString());
EXPECT_EQ("100,100", translated_event.root_location().ToString());
}
@@ -475,12 +476,12 @@ class EventFilterRecorder : public ui::EventHandler {
}
virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
- mouse_locations_.push_back(event->location());
+ mouse_locations_.push_back(gfx::ToFlooredPoint(event->location()));
mouse_event_flags_.push_back(event->flags());
}
virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE {
- touch_locations_.push_back(event->location());
+ touch_locations_.push_back(gfx::ToFlooredPoint(event->location()));
}
private:

Powered by Google App Engine
This is Rietveld 408576698