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

Side by Side Diff: third_party/WebKit/Source/core/events/PointerEventFactoryTest.cpp

Issue 1892653003: Extract touch handling logic from EventHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 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/events/PointerEventFactory.h" 5 #include "core/events/PointerEventFactory.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/page/Page.h" 8 #include "core/page/Page.h"
9 #include "public/platform/WebPointerProperties.h" 9 #include "public/platform/WebPointerProperties.h"
10 #include <climits> 10 #include <climits>
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 EXPECT_EQ(clonePointerEvent->isPrimary(), pointerEvent->isPrimary()); 94 EXPECT_EQ(clonePointerEvent->isPrimary(), pointerEvent->isPrimary());
95 EXPECT_EQ(clonePointerEvent->type(), type); 95 EXPECT_EQ(clonePointerEvent->type(), type);
96 } 96 }
97 97
98 PointerEvent* PointerEventFactoryTest::createAndCheckTouchEvent( 98 PointerEvent* PointerEventFactoryTest::createAndCheckTouchEvent(
99 WebPointerProperties::PointerType pointerType, 99 WebPointerProperties::PointerType pointerType,
100 int rawId, int uniqueId, bool isPrimary, 100 int rawId, int uniqueId, bool isPrimary,
101 PlatformTouchPoint::TouchState state) 101 PlatformTouchPoint::TouchState state)
102 { 102 {
103 PointerEvent* pointerEvent = m_pointerEventFactory.create( 103 PointerEvent* pointerEvent = m_pointerEventFactory.create(
104 EventTypeNames::pointerdown, PointerEventFactoryTest::PlatformTouchPoint Builder(pointerType, rawId, state), PlatformEvent::NoModifiers, 0, 0, 0, 0); 104 EventTypeNames::pointerdown, PointerEventFactoryTest::PlatformTouchPoint Builder(pointerType, rawId, state), PlatformEvent::NoModifiers, FloatSize(0, 0), FloatPoint(0, 0));
dtapuska 2016/04/25 20:15:00 Just FloatSize(), FloatPoint() is good enough
Navid Zolghadr 2016/04/26 21:57:50 Sure.
105 EXPECT_EQ(uniqueId, pointerEvent->pointerId()); 105 EXPECT_EQ(uniqueId, pointerEvent->pointerId());
106 EXPECT_EQ(isPrimary, pointerEvent->isPrimary()); 106 EXPECT_EQ(isPrimary, pointerEvent->isPrimary());
107 return pointerEvent; 107 return pointerEvent;
108 } 108 }
109 109
110 PointerEvent* PointerEventFactoryTest::createAndCheckMouseEvent( 110 PointerEvent* PointerEventFactoryTest::createAndCheckMouseEvent(
111 WebPointerProperties::PointerType pointerType, 111 WebPointerProperties::PointerType pointerType,
112 int rawId, int uniqueId, bool isPrimary, 112 int rawId, int uniqueId, bool isPrimary,
113 PlatformEvent::Modifiers modifiers) 113 PlatformEvent::Modifiers modifiers)
114 { 114 {
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 createAndCheckMouseEvent(WebPointerProperties::PointerType::Touch, i, m_ mappedIdStart+i, i == 0); 314 createAndCheckMouseEvent(WebPointerProperties::PointerType::Touch, i, m_ mappedIdStart+i, i == 0);
315 } 315 }
316 316
317 for (int i = 0; i < 100; ++i) { 317 for (int i = 0; i < 100; ++i) {
318 createAndCheckTouchEvent(WebPointerProperties::PointerType::Mouse, i, m_ expectedMouseId, true); 318 createAndCheckTouchEvent(WebPointerProperties::PointerType::Mouse, i, m_ expectedMouseId, true);
319 } 319 }
320 createAndCheckTouchCancel(WebPointerProperties::PointerType::Mouse, 0, m_exp ectedMouseId, true); 320 createAndCheckTouchCancel(WebPointerProperties::PointerType::Mouse, 0, m_exp ectedMouseId, true);
321 } 321 }
322 322
323 } // namespace blink 323 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698