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

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

Issue 2539283002: Remove PlatformGestureEvent in favour of using WebGestureEvent (Closed)
Patch Set: Created 4 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
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 "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/Range.h" 8 #include "core/dom/Range.h"
9 #include "core/editing/Editor.h" 9 #include "core/editing/Editor.h"
10 #include "core/editing/FrameSelection.h" 10 #include "core/editing/FrameSelection.h"
(...skipping 15 matching lines...) Expand all
26 26
27 Page& page() const { return m_dummyPageHolder->page(); } 27 Page& page() const { return m_dummyPageHolder->page(); }
28 Document& document() const { return m_dummyPageHolder->document(); } 28 Document& document() const { return m_dummyPageHolder->document(); }
29 29
30 void setHtmlInnerHTML(const char* htmlContent); 30 void setHtmlInnerHTML(const char* htmlContent);
31 31
32 private: 32 private:
33 std::unique_ptr<DummyPageHolder> m_dummyPageHolder; 33 std::unique_ptr<DummyPageHolder> m_dummyPageHolder;
34 }; 34 };
35 35
36 class TapEventBuilder : public PlatformGestureEvent { 36 class TapEventBuilder : public WebGestureEvent {
37 public: 37 public:
38 TapEventBuilder(IntPoint position, int tapCount) 38 TapEventBuilder(IntPoint position, int tapCount) : WebGestureEvent() {
39 : PlatformGestureEvent(PlatformEvent::GestureTap, 39 type = WebInputEvent::GestureTap;
40 position, 40 x = globalX = position.x();
41 position, 41 y = globalY = position.y();
42 IntSize(5, 5), 42 timeStampSeconds = WTF::monotonicallyIncreasingTime();
43 WTF::monotonicallyIncreasingTime(), 43 sourceDevice = WebGestureDeviceTouchscreen;
44 static_cast<PlatformEvent::Modifiers>(0), 44 data.tap.tapCount = tapCount;
45 PlatformGestureSourceTouchscreen) { 45 data.tap.width = 5;
46 m_data.m_tap.m_tapCount = tapCount; 46 data.tap.height = 5;
majidvp 2016/12/01 15:46:30 One of the advantage of PlatformGestureEvent was t
dtapuska 2016/12/01 16:26:43 So my eventual goal is to have WebInputEvent be a
47 } 47 }
48 }; 48 };
49 49
50 void EventHandlerTest::SetUp() { 50 void EventHandlerTest::SetUp() {
51 m_dummyPageHolder = DummyPageHolder::create(IntSize(300, 400)); 51 m_dummyPageHolder = DummyPageHolder::create(IntSize(300, 400));
52 } 52 }
53 53
54 void EventHandlerTest::setHtmlInnerHTML(const char* htmlContent) { 54 void EventHandlerTest::setHtmlInnerHTML(const char* htmlContent) {
55 document().documentElement()->setInnerHTML(String::fromUTF8(htmlContent)); 55 document().documentElement()->setInnerHTML(String::fromUTF8(htmlContent));
56 document().view()->updateAllLifecyclePhases(); 56 document().view()->updateAllLifecyclePhases();
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 PlatformMouseEvent mouseDownEvent( 252 PlatformMouseEvent mouseDownEvent(
253 IntPoint(0, 0), IntPoint(100, 200), WebPointerProperties::Button::Right, 253 IntPoint(0, 0), IntPoint(100, 200), WebPointerProperties::Button::Right,
254 PlatformEvent::MousePressed, 1, PlatformEvent::Modifiers::RightButtonDown, 254 PlatformEvent::MousePressed, 1, PlatformEvent::Modifiers::RightButtonDown,
255 WTF::monotonicallyIncreasingTime()); 255 WTF::monotonicallyIncreasingTime());
256 EXPECT_EQ( 256 EXPECT_EQ(
257 WebInputEventResult::HandledApplication, 257 WebInputEventResult::HandledApplication,
258 document().frame()->eventHandler().sendContextMenuEvent(mouseDownEvent)); 258 document().frame()->eventHandler().sendContextMenuEvent(mouseDownEvent));
259 } 259 }
260 260
261 } // namespace blink 261 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698