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

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

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 years, 11 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 "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 17 matching lines...) Expand all
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 WebGestureEvent { 36 class TapEventBuilder : public WebGestureEvent {
37 public: 37 public:
38 TapEventBuilder(IntPoint position, int tapCount) : WebGestureEvent() { 38 TapEventBuilder(IntPoint position, int tapCount)
39 type = WebInputEvent::GestureTap; 39 : WebGestureEvent(WebInputEvent::GestureTap,
40 WebInputEvent::NoModifiers,
41 TimeTicks::Now().InSeconds()) {
40 x = globalX = position.x(); 42 x = globalX = position.x();
41 y = globalY = position.y(); 43 y = globalY = position.y();
42 timeStampSeconds = TimeTicks::Now().InSeconds();
43 sourceDevice = WebGestureDeviceTouchscreen; 44 sourceDevice = WebGestureDeviceTouchscreen;
44 data.tap.tapCount = tapCount; 45 data.tap.tapCount = tapCount;
45 data.tap.width = 5; 46 data.tap.width = 5;
46 data.tap.height = 5; 47 data.tap.height = 5;
47 m_frameScale = 1; 48 m_frameScale = 1;
48 } 49 }
49 }; 50 };
50 51
51 void EventHandlerTest::SetUp() { 52 void EventHandlerTest::SetUp() {
52 m_dummyPageHolder = DummyPageHolder::create(IntSize(300, 400)); 53 m_dummyPageHolder = DummyPageHolder::create(IntSize(300, 400));
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 PlatformMouseEvent mouseDownEvent( 251 PlatformMouseEvent mouseDownEvent(
251 IntPoint(0, 0), IntPoint(100, 200), WebPointerProperties::Button::Right, 252 IntPoint(0, 0), IntPoint(100, 200), WebPointerProperties::Button::Right,
252 PlatformEvent::MousePressed, 1, PlatformEvent::Modifiers::RightButtonDown, 253 PlatformEvent::MousePressed, 1, PlatformEvent::Modifiers::RightButtonDown,
253 TimeTicks::Now()); 254 TimeTicks::Now());
254 EXPECT_EQ( 255 EXPECT_EQ(
255 WebInputEventResult::HandledApplication, 256 WebInputEventResult::HandledApplication,
256 document().frame()->eventHandler().sendContextMenuEvent(mouseDownEvent)); 257 document().frame()->eventHandler().sendContextMenuEvent(mouseDownEvent));
257 } 258 }
258 259
259 } // namespace blink 260 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/EventHandler.cpp ('k') | third_party/WebKit/Source/core/input/GestureManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698