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

Side by Side Diff: Source/web/tests/WebInputEventConversionTest.cpp

Issue 149053002: Blink WebTouchPoint stores its location as WebFloatPoint, instead of WebPoint. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Rebase / minor fixes. Created 6 years, 10 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 PlatformGestureEventBuilder platformGestureBuilder(view, webGestureEvent ); 215 PlatformGestureEventBuilder platformGestureBuilder(view, webGestureEvent );
216 EXPECT_EQ(5, platformGestureBuilder.area().width()); 216 EXPECT_EQ(5, platformGestureBuilder.area().width());
217 EXPECT_EQ(5, platformGestureBuilder.area().height()); 217 EXPECT_EQ(5, platformGestureBuilder.area().height());
218 } 218 }
219 219
220 { 220 {
221 WebTouchEvent webTouchEvent; 221 WebTouchEvent webTouchEvent;
222 webTouchEvent.type = WebInputEvent::TouchMove; 222 webTouchEvent.type = WebInputEvent::TouchMove;
223 webTouchEvent.touchesLength = 1; 223 webTouchEvent.touchesLength = 1;
224 webTouchEvent.touches[0].state = WebTouchPoint::StateMoved; 224 webTouchEvent.touches[0].state = WebTouchPoint::StateMoved;
225 webTouchEvent.touches[0].screenPosition.x = 10; 225 webTouchEvent.touches[0].screenPosition.x = 10.6f;
226 webTouchEvent.touches[0].screenPosition.y = 10; 226 webTouchEvent.touches[0].screenPosition.y = 10.4f;
227 webTouchEvent.touches[0].position.x = 10; 227 webTouchEvent.touches[0].position.x = 10.6f;
228 webTouchEvent.touches[0].position.y = 10; 228 webTouchEvent.touches[0].position.y = 10.4f;
229 webTouchEvent.touches[0].radiusX = 10; 229 webTouchEvent.touches[0].radiusX = 10.6f;
230 webTouchEvent.touches[0].radiusY = 10; 230 webTouchEvent.touches[0].radiusY = 10.4f;
231
232 EXPECT_FLOAT_EQ(10.6f, webTouchEvent.touches[0].screenPosition.x);
233 EXPECT_FLOAT_EQ(10.4f, webTouchEvent.touches[0].screenPosition.y);
234 EXPECT_FLOAT_EQ(10.6f, webTouchEvent.touches[0].position.x);
235 EXPECT_FLOAT_EQ(10.4f, webTouchEvent.touches[0].position.y);
236 EXPECT_FLOAT_EQ(10.6f, webTouchEvent.touches[0].radiusX);
237 EXPECT_FLOAT_EQ(10.4f, webTouchEvent.touches[0].radiusY);
231 238
232 PlatformTouchEventBuilder platformTouchBuilder(view, webTouchEvent); 239 PlatformTouchEventBuilder platformTouchBuilder(view, webTouchEvent);
233 EXPECT_EQ(10, platformTouchBuilder.touchPoints()[0].screenPos().x()); 240 EXPECT_EQ(10, platformTouchBuilder.touchPoints()[0].screenPos().x());
234 EXPECT_EQ(10, platformTouchBuilder.touchPoints()[0].screenPos().y()); 241 EXPECT_EQ(10, platformTouchBuilder.touchPoints()[0].screenPos().y());
235 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].pos().x()); 242 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].pos().x());
236 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].pos().y()); 243 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].pos().y());
237 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].radiusX()); 244 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].radiusX());
238 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].radiusY()); 245 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].radiusY());
239 } 246 }
240 247
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 EXPECT_EQ(webGestureEvent.type, recreatedWebGestureEvent.type); 486 EXPECT_EQ(webGestureEvent.type, recreatedWebGestureEvent.type);
480 EXPECT_EQ(webGestureEvent.x, recreatedWebGestureEvent.x); 487 EXPECT_EQ(webGestureEvent.x, recreatedWebGestureEvent.x);
481 EXPECT_EQ(webGestureEvent.y, recreatedWebGestureEvent.y); 488 EXPECT_EQ(webGestureEvent.y, recreatedWebGestureEvent.y);
482 EXPECT_EQ(webGestureEvent.globalX, recreatedWebGestureEvent.globalX); 489 EXPECT_EQ(webGestureEvent.globalX, recreatedWebGestureEvent.globalX);
483 EXPECT_EQ(webGestureEvent.globalY, recreatedWebGestureEvent.globalY); 490 EXPECT_EQ(webGestureEvent.globalY, recreatedWebGestureEvent.globalY);
484 EXPECT_EQ(webGestureEvent.data.tap.tapCount, recreatedWebGestureEvent.da ta.tap.tapCount); 491 EXPECT_EQ(webGestureEvent.data.tap.tapCount, recreatedWebGestureEvent.da ta.tap.tapCount);
485 } 492 }
486 } 493 }
487 494
488 } // anonymous namespace 495 } // anonymous namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698