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

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

Issue 1774913004: Firing got/lost pointer capture events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 int uniqueId, bool isPrimary, 78 int uniqueId, bool isPrimary,
79 PlatformTouchPoint::TouchState state) 79 PlatformTouchPoint::TouchState state)
80 { 80 {
81 RefPtrWillBeRawPtr<PointerEvent> pointerEvent = m_pointerEventFactory.create PointerCancel( 81 RefPtrWillBeRawPtr<PointerEvent> pointerEvent = m_pointerEventFactory.create PointerCancel(
82 PointerEventFactoryTest::PlatformTouchPointBuilder(pointerType, rawId, s tate)); 82 PointerEventFactoryTest::PlatformTouchPointBuilder(pointerType, rawId, s tate));
83 EXPECT_EQ(uniqueId, pointerEvent->pointerId()); 83 EXPECT_EQ(uniqueId, pointerEvent->pointerId());
84 EXPECT_EQ(isPrimary, pointerEvent->isPrimary()); 84 EXPECT_EQ(isPrimary, pointerEvent->isPrimary());
85 return pointerEvent; 85 return pointerEvent;
86 } 86 }
87 87
88 void PointerEventFactoryTest::cloneAndCheckPointerEvent( 88 void PointerEventFactoryTest::cloneAndCheckPointerEvent(
mustaq 2016/03/10 19:28:19 s/cloneAndCheckPointerEvent/cloneAndCheckPointerTr
Navid Zolghadr 2016/03/10 20:27:35 I replaced it with createAndCheckPointerTransition
89 PassRefPtrWillBeRawPtr<PointerEvent> prpPointerEvent, 89 PassRefPtrWillBeRawPtr<PointerEvent> prpPointerEvent,
90 const AtomicString& type) 90 const AtomicString& type)
91 { 91 {
92 RefPtrWillBeRawPtr<PointerEvent> pointerEvent = prpPointerEvent; 92 RefPtrWillBeRawPtr<PointerEvent> pointerEvent = prpPointerEvent;
93 RefPtrWillBeRawPtr<PointerEvent> clonePointerEvent = 93 RefPtrWillBeRawPtr<PointerEvent> clonePointerEvent = m_pointerEventFactory.
94 m_pointerEventFactory.create(pointerEvent, type, nullptr); 94 createPointerTransition(pointerEvent, type, nullptr);
95 EXPECT_EQ(clonePointerEvent->pointerType(), pointerEvent->pointerType()); 95 EXPECT_EQ(clonePointerEvent->pointerType(), pointerEvent->pointerType());
96 EXPECT_EQ(clonePointerEvent->pointerId(), pointerEvent->pointerId()); 96 EXPECT_EQ(clonePointerEvent->pointerId(), pointerEvent->pointerId());
97 EXPECT_EQ(clonePointerEvent->isPrimary(), pointerEvent->isPrimary()); 97 EXPECT_EQ(clonePointerEvent->isPrimary(), pointerEvent->isPrimary());
98 EXPECT_EQ(clonePointerEvent->type(), type); 98 EXPECT_EQ(clonePointerEvent->type(), type);
99 } 99 }
100 100
101 PassRefPtrWillBeRawPtr<PointerEvent> PointerEventFactoryTest::createAndCheckTouc hEvent( 101 PassRefPtrWillBeRawPtr<PointerEvent> PointerEventFactoryTest::createAndCheckTouc hEvent(
102 WebPointerProperties::PointerType pointerType, 102 WebPointerProperties::PointerType pointerType,
103 int rawId, int uniqueId, bool isPrimary, 103 int rawId, int uniqueId, bool isPrimary,
104 PlatformTouchPoint::TouchState state) 104 PlatformTouchPoint::TouchState state)
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 createAndCheckMouseEvent(WebPointerProperties::PointerType::Touch, i, m_ mappedIdStart+i, i == 0); 317 createAndCheckMouseEvent(WebPointerProperties::PointerType::Touch, i, m_ mappedIdStart+i, i == 0);
318 } 318 }
319 319
320 for (int i = 0; i < 100; ++i) { 320 for (int i = 0; i < 100; ++i) {
321 createAndCheckTouchEvent(WebPointerProperties::PointerType::Mouse, i, m_ expectedMouseId, true); 321 createAndCheckTouchEvent(WebPointerProperties::PointerType::Mouse, i, m_ expectedMouseId, true);
322 } 322 }
323 createAndCheckTouchCancel(WebPointerProperties::PointerType::Mouse, 0, m_exp ectedMouseId, true); 323 createAndCheckTouchCancel(WebPointerProperties::PointerType::Mouse, 0, m_exp ectedMouseId, true);
324 } 324 }
325 325
326 } // namespace blink 326 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698