Chromium Code Reviews| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |