OLD | NEW |
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 PlatformTouchPoint::State state) | 79 PlatformTouchPoint::State 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( |
89 PassRefPtrWillBeRawPtr<PointerEvent> pointerEvent, | 89 PassRefPtrWillBeRawPtr<PointerEvent> prpPointerEvent, |
90 const AtomicString& type) | 90 const AtomicString& type) |
91 { | 91 { |
| 92 RefPtrWillBeRawPtr<PointerEvent> pointerEvent = prpPointerEvent; |
92 RefPtrWillBeRawPtr<PointerEvent> clonePointerEvent = | 93 RefPtrWillBeRawPtr<PointerEvent> clonePointerEvent = |
93 m_pointerEventFactory.create(pointerEvent, type, nullptr); | 94 m_pointerEventFactory.create(pointerEvent, type, nullptr); |
94 EXPECT_EQ(clonePointerEvent->pointerType(), pointerEvent->pointerType()); | 95 EXPECT_EQ(clonePointerEvent->pointerType(), pointerEvent->pointerType()); |
95 EXPECT_EQ(clonePointerEvent->pointerId(), pointerEvent->pointerId()); | 96 EXPECT_EQ(clonePointerEvent->pointerId(), pointerEvent->pointerId()); |
96 EXPECT_EQ(clonePointerEvent->isPrimary(), pointerEvent->isPrimary()); | 97 EXPECT_EQ(clonePointerEvent->isPrimary(), pointerEvent->isPrimary()); |
97 EXPECT_EQ(clonePointerEvent->type(), type); | 98 EXPECT_EQ(clonePointerEvent->type(), type); |
98 } | 99 } |
99 | 100 |
100 PassRefPtrWillBeRawPtr<PointerEvent> PointerEventFactoryTest::createAndCheckTouc
hEvent( | 101 PassRefPtrWillBeRawPtr<PointerEvent> PointerEventFactoryTest::createAndCheckTouc
hEvent( |
101 WebPointerProperties::PointerType pointerType, | 102 WebPointerProperties::PointerType pointerType, |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 createAndCheckMouseEvent(WebPointerProperties::PointerType::Touch, i, m_
mappedIdStart+i, i == 0); | 317 createAndCheckMouseEvent(WebPointerProperties::PointerType::Touch, i, m_
mappedIdStart+i, i == 0); |
317 } | 318 } |
318 | 319 |
319 for (int i = 0; i < 100; ++i) { | 320 for (int i = 0; i < 100; ++i) { |
320 createAndCheckTouchEvent(WebPointerProperties::PointerType::Mouse, i, m_
expectedMouseId, true); | 321 createAndCheckTouchEvent(WebPointerProperties::PointerType::Mouse, i, m_
expectedMouseId, true); |
321 } | 322 } |
322 createAndCheckTouchCancel(WebPointerProperties::PointerType::Mouse, 0, m_exp
ectedMouseId, true); | 323 createAndCheckTouchCancel(WebPointerProperties::PointerType::Mouse, 0, m_exp
ectedMouseId, true); |
323 } | 324 } |
324 | 325 |
325 } // namespace blink | 326 } // namespace blink |
OLD | NEW |