| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "content/common/input/synthetic_web_input_event_builders.h" | 7 #include "content/common/input/synthetic_web_input_event_builders.h" |
| 8 #include "content/renderer/pepper/event_conversion.h" | 8 #include "content/renderer/pepper/event_conversion.h" |
| 9 #include "ppapi/shared_impl/ppb_input_event_shared.h" | 9 #include "ppapi/shared_impl/ppb_input_event_shared.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 ASSERT_NE(j, actual.touchesLength); | 26 ASSERT_NE(j, actual.touchesLength); |
| 27 EXPECT_EQ(expected.touches[i].id, actual.touches[j].id); | 27 EXPECT_EQ(expected.touches[i].id, actual.touches[j].id); |
| 28 EXPECT_EQ(expected.touches[i].state, actual.touches[j].state); | 28 EXPECT_EQ(expected.touches[i].state, actual.touches[j].state); |
| 29 EXPECT_EQ(expected.touches[i].position.x, actual.touches[j].position.x); | 29 EXPECT_EQ(expected.touches[i].position.x, actual.touches[j].position.x); |
| 30 EXPECT_EQ(expected.touches[i].position.y, actual.touches[j].position.y); | 30 EXPECT_EQ(expected.touches[i].position.y, actual.touches[j].position.y); |
| 31 EXPECT_EQ(expected.touches[i].radiusX, actual.touches[j].radiusX); | 31 EXPECT_EQ(expected.touches[i].radiusX, actual.touches[j].radiusX); |
| 32 EXPECT_EQ(expected.touches[i].radiusY, actual.touches[j].radiusY); | 32 EXPECT_EQ(expected.touches[i].radiusY, actual.touches[j].radiusY); |
| 33 EXPECT_EQ(expected.touches[i].rotationAngle, | 33 EXPECT_EQ(expected.touches[i].rotationAngle, |
| 34 actual.touches[j].rotationAngle); | 34 actual.touches[j].rotationAngle); |
| 35 EXPECT_EQ(expected.touches[i].tilt, actual.touches[j].tilt); |
| 35 EXPECT_EQ(expected.touches[i].force, actual.touches[j].force); | 36 EXPECT_EQ(expected.touches[i].force, actual.touches[j].force); |
| 36 } | 37 } |
| 37 } | 38 } |
| 38 }; | 39 }; |
| 39 | 40 |
| 40 TEST_F(EventConversionTest, TouchStart) { | 41 TEST_F(EventConversionTest, TouchStart) { |
| 41 SyntheticWebTouchEvent touch; | 42 SyntheticWebTouchEvent touch; |
| 42 touch.PressPoint(1.f, 2.f); | 43 touch.PressPoint(1.f, 2.f); |
| 43 | 44 |
| 44 std::vector<ppapi::InputEventData> pp_events; | 45 std::vector<ppapi::InputEventData> pp_events; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 scoped_ptr<blink::WebInputEvent> event_out(CreateWebInputEvent(pp_event)); | 137 scoped_ptr<blink::WebInputEvent> event_out(CreateWebInputEvent(pp_event)); |
| 137 const blink::WebTouchEvent* touch_out = | 138 const blink::WebTouchEvent* touch_out = |
| 138 static_cast<const blink::WebTouchEvent*>(event_out.get()); | 139 static_cast<const blink::WebTouchEvent*>(event_out.get()); |
| 139 ASSERT_TRUE(touch_out); | 140 ASSERT_TRUE(touch_out); |
| 140 EXPECT_EQ(touch.type, touch_out->type); | 141 EXPECT_EQ(touch.type, touch_out->type); |
| 141 EXPECT_EQ(touch.touchesLength, touch_out->touchesLength); | 142 EXPECT_EQ(touch.touchesLength, touch_out->touchesLength); |
| 142 CompareWebTouchEvents(touch, *touch_out); | 143 CompareWebTouchEvents(touch, *touch_out); |
| 143 } | 144 } |
| 144 | 145 |
| 145 } // namespace content | 146 } // namespace content |
| OLD | NEW |