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

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandlerTest.cpp

Issue 2782893002: WebMouseEvent coordinates are now fractional & private (Closed)
Patch Set: Rebased, fixed a comment in web_input_event_builders_mac.mm 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "core/input/EventHandler.h" 5 #include "core/input/EventHandler.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/Range.h" 9 #include "core/dom/Range.h"
10 #include "core/editing/Editor.h" 10 #include "core/editing/Editor.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 y = globalY = position.y(); 58 y = globalY = position.y();
59 sourceDevice = WebGestureDeviceTouchscreen; 59 sourceDevice = WebGestureDeviceTouchscreen;
60 data.longPress.width = 5; 60 data.longPress.width = 5;
61 data.longPress.height = 5; 61 data.longPress.height = 5;
62 m_frameScale = 1; 62 m_frameScale = 1;
63 } 63 }
64 }; 64 };
65 65
66 class MousePressEventBuilder : public WebMouseEvent { 66 class MousePressEventBuilder : public WebMouseEvent {
67 public: 67 public:
68 MousePressEventBuilder(IntPoint position, 68 MousePressEventBuilder(IntPoint positionParam,
69 int clickCountParam, 69 int clickCountParam,
70 WebMouseEvent::Button buttonParam) 70 WebMouseEvent::Button buttonParam)
71 : WebMouseEvent(WebInputEvent::MouseDown, 71 : WebMouseEvent(WebInputEvent::MouseDown,
72 WebInputEvent::NoModifiers, 72 WebInputEvent::NoModifiers,
73 TimeTicks::Now().InSeconds()) { 73 TimeTicks::Now().InSeconds()) {
74 clickCount = clickCountParam; 74 clickCount = clickCountParam;
75 button = buttonParam; 75 button = buttonParam;
76 x = globalX = position.x(); 76 setPositionInWidget(positionParam.x(), positionParam.y());
77 y = globalY = position.y(); 77 setPositionInScreen(positionParam.x(), positionParam.y());
78 m_frameScale = 1; 78 m_frameScale = 1;
79 } 79 }
80 }; 80 };
81 81
82 void EventHandlerTest::SetUp() { 82 void EventHandlerTest::SetUp() {
83 m_dummyPageHolder = DummyPageHolder::create(IntSize(300, 400)); 83 m_dummyPageHolder = DummyPageHolder::create(IntSize(300, 400));
84 } 84 }
85 85
86 void EventHandlerTest::setHtmlInnerHTML(const char* htmlContent) { 86 void EventHandlerTest::setHtmlInnerHTML(const char* htmlContent) {
87 document().documentElement()->setInnerHTML(String::fromUTF8(htmlContent)); 87 document().documentElement()->setInnerHTML(String::fromUTF8(htmlContent));
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 WebInputEvent::MouseLeave, WebFloatPoint(0, 0), WebFloatPoint(0, 0), 514 WebInputEvent::MouseLeave, WebFloatPoint(0, 0), WebFloatPoint(0, 0),
515 WebPointerProperties::Button::NoButton, 0, WebInputEvent::NoModifiers, 515 WebPointerProperties::Button::NoButton, 0, WebInputEvent::NoModifiers,
516 TimeTicks::Now().InSeconds()); 516 TimeTicks::Now().InSeconds());
517 mouseLeaveEvent.setFrameScale(1); 517 mouseLeaveEvent.setFrameScale(1);
518 document().frame()->eventHandler().handleMouseLeaveEvent(mouseLeaveEvent); 518 document().frame()->eventHandler().handleMouseLeaveEvent(mouseLeaveEvent);
519 519
520 EXPECT_EQ(WTF::String(), lastToolTip()); 520 EXPECT_EQ(WTF::String(), lastToolTip());
521 } 521 }
522 522
523 } // namespace blink 523 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698