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

Side by Side Diff: content/renderer/pepper/event_conversion_unittest.cc

Issue 755403006: Added experimental Touch.tilt, Touch.tiltDirection support for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused code (event_sender.cc) Created 5 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 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
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);
36 EXPECT_EQ(expected.touches[i].tiltDirection,
37 actual.touches[j].tiltDirection);
35 EXPECT_EQ(expected.touches[i].force, actual.touches[j].force); 38 EXPECT_EQ(expected.touches[i].force, actual.touches[j].force);
36 } 39 }
37 } 40 }
38 }; 41 };
39 42
40 TEST_F(EventConversionTest, TouchStart) { 43 TEST_F(EventConversionTest, TouchStart) {
41 SyntheticWebTouchEvent touch; 44 SyntheticWebTouchEvent touch;
42 touch.PressPoint(1.f, 2.f); 45 touch.PressPoint(1.f, 2.f);
43 46
44 std::vector<ppapi::InputEventData> pp_events; 47 std::vector<ppapi::InputEventData> pp_events;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 scoped_ptr<blink::WebInputEvent> event_out(CreateWebInputEvent(pp_event)); 139 scoped_ptr<blink::WebInputEvent> event_out(CreateWebInputEvent(pp_event));
137 const blink::WebTouchEvent* touch_out = 140 const blink::WebTouchEvent* touch_out =
138 static_cast<const blink::WebTouchEvent*>(event_out.get()); 141 static_cast<const blink::WebTouchEvent*>(event_out.get());
139 ASSERT_TRUE(touch_out); 142 ASSERT_TRUE(touch_out);
140 EXPECT_EQ(touch.type, touch_out->type); 143 EXPECT_EQ(touch.type, touch_out->type);
141 EXPECT_EQ(touch.touchesLength, touch_out->touchesLength); 144 EXPECT_EQ(touch.touchesLength, touch_out->touchesLength);
142 CompareWebTouchEvents(touch, *touch_out); 145 CompareWebTouchEvents(touch, *touch_out);
143 } 146 }
144 147
145 } // namespace content 148 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/event_conversion.cc ('k') | content/shell/renderer/test_runner/event_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698