| 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 <gtest/gtest.h> | 7 #include <gtest/gtest.h> |
| 8 #include <climits> | 8 #include <climits> |
| 9 #include "core/frame/LocalFrameView.h" | 9 #include "core/frame/LocalFrameView.h" |
| 10 #include "core/page/Page.h" | 10 #include "core/page/Page.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 return "touch"; | 23 return "touch"; |
| 24 case WebPointerProperties::PointerType::kPen: | 24 case WebPointerProperties::PointerType::kPen: |
| 25 return "pen"; | 25 return "pen"; |
| 26 case WebPointerProperties::PointerType::kMouse: | 26 case WebPointerProperties::PointerType::kMouse: |
| 27 return "mouse"; | 27 return "mouse"; |
| 28 default: | 28 default: |
| 29 NOTREACHED(); | 29 NOTREACHED(); |
| 30 return ""; | 30 return ""; |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 } | 33 } // namespace |
| 34 | 34 |
| 35 class PointerEventFactoryTest : public ::testing::Test { | 35 class PointerEventFactoryTest : public ::testing::Test { |
| 36 protected: | 36 protected: |
| 37 void SetUp() override; | 37 void SetUp() override; |
| 38 PointerEvent* CreateAndCheckTouchCancel(WebPointerProperties::PointerType, | 38 PointerEvent* CreateAndCheckTouchCancel(WebPointerProperties::PointerType, |
| 39 int raw_id, | 39 int raw_id, |
| 40 int unique_id, | 40 int unique_id, |
| 41 bool is_primary); | 41 bool is_primary); |
| 42 PointerEvent* CreateAndCheckTouchEvent( | 42 PointerEvent* CreateAndCheckTouchEvent( |
| 43 WebPointerProperties::PointerType, | 43 WebPointerProperties::PointerType, |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 TEST_F(PointerEventFactoryTest, CoalescedEvents) { | 473 TEST_F(PointerEventFactoryTest, CoalescedEvents) { |
| 474 CreateAndCheckMouseEvent(WebPointerProperties::PointerType::kMouse, 0, | 474 CreateAndCheckMouseEvent(WebPointerProperties::PointerType::kMouse, 0, |
| 475 expected_mouse_id_, true, | 475 expected_mouse_id_, true, |
| 476 WebInputEvent::kNoModifiers, 4); | 476 WebInputEvent::kNoModifiers, 4); |
| 477 CreateAndCheckTouchEvent(WebPointerProperties::PointerType::kTouch, 0, | 477 CreateAndCheckTouchEvent(WebPointerProperties::PointerType::kTouch, 0, |
| 478 mapped_id_start_, true, WebTouchPoint::kStateMoved, | 478 mapped_id_start_, true, WebTouchPoint::kStateMoved, |
| 479 3); | 479 3); |
| 480 } | 480 } |
| 481 | 481 |
| 482 } // namespace blink | 482 } // namespace blink |
| OLD | NEW |