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

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

Issue 2539283002: Remove PlatformGestureEvent in favour of using WebGestureEvent (Closed)
Patch Set: Add missing copyright on new file 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 = TimeTicks::Now().InSeconds();
43 TimeTicks::Now(), 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;
47 m_frameScale = 1;
47 } 48 }
48 }; 49 };
49 50
50 void EventHandlerTest::SetUp() { 51 void EventHandlerTest::SetUp() {
51 m_dummyPageHolder = DummyPageHolder::create(IntSize(300, 400)); 52 m_dummyPageHolder = DummyPageHolder::create(IntSize(300, 400));
52 } 53 }
53 54
54 void EventHandlerTest::setHtmlInnerHTML(const char* htmlContent) { 55 void EventHandlerTest::setHtmlInnerHTML(const char* htmlContent) {
55 document().documentElement()->setInnerHTML(String::fromUTF8(htmlContent)); 56 document().documentElement()->setInnerHTML(String::fromUTF8(htmlContent));
56 document().view()->updateAllLifecyclePhases(); 57 document().view()->updateAllLifecyclePhases();
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 PlatformMouseEvent mouseDownEvent( 250 PlatformMouseEvent mouseDownEvent(
250 IntPoint(0, 0), IntPoint(100, 200), WebPointerProperties::Button::Right, 251 IntPoint(0, 0), IntPoint(100, 200), WebPointerProperties::Button::Right,
251 PlatformEvent::MousePressed, 1, PlatformEvent::Modifiers::RightButtonDown, 252 PlatformEvent::MousePressed, 1, PlatformEvent::Modifiers::RightButtonDown,
252 TimeTicks::Now()); 253 TimeTicks::Now());
253 EXPECT_EQ( 254 EXPECT_EQ(
254 WebInputEventResult::HandledApplication, 255 WebInputEventResult::HandledApplication,
255 document().frame()->eventHandler().sendContextMenuEvent(mouseDownEvent)); 256 document().frame()->eventHandler().sendContextMenuEvent(mouseDownEvent));
256 } 257 }
257 258
258 } // namespace blink 259 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/EventHandler.cpp ('k') | third_party/WebKit/Source/core/input/GestureManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698