| OLD | NEW |
| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].pos().x()); | 242 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].pos().x()); |
| 243 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].pos().y()); | 243 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].pos().y()); |
| 244 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].radiusX()); | 244 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].radiusX()); |
| 245 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].radiusY()); | 245 EXPECT_EQ(5, platformTouchBuilder.touchPoints()[0].radiusY()); |
| 246 } | 246 } |
| 247 | 247 |
| 248 // Reverse builders should *not* go back to physical pixels, as they are use
d for plugins | 248 // Reverse builders should *not* go back to physical pixels, as they are use
d for plugins |
| 249 // which expect CSS pixel coordinates. | 249 // which expect CSS pixel coordinates. |
| 250 { | 250 { |
| 251 PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10)
, LeftButton, PlatformEvent::MouseMoved, 1, false, false, false, false, 0); | 251 PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10)
, LeftButton, PlatformEvent::MouseMoved, 1, false, false, false, false, 0); |
| 252 RefPtr<MouseEvent> mouseEvent = MouseEvent::create(WebCore::EventTypeNam
es::mousemove, domWindow, platformMouseEvent, 0, document); | 252 RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(WebCore::
EventTypeNames::mousemove, domWindow, platformMouseEvent, 0, document); |
| 253 WebMouseEventBuilder webMouseBuilder(view, docRenderer, *mouseEvent); | 253 WebMouseEventBuilder webMouseBuilder(view, docRenderer, *mouseEvent); |
| 254 | 254 |
| 255 EXPECT_EQ(10, webMouseBuilder.x); | 255 EXPECT_EQ(10, webMouseBuilder.x); |
| 256 EXPECT_EQ(10, webMouseBuilder.y); | 256 EXPECT_EQ(10, webMouseBuilder.y); |
| 257 EXPECT_EQ(10, webMouseBuilder.globalX); | 257 EXPECT_EQ(10, webMouseBuilder.globalX); |
| 258 EXPECT_EQ(10, webMouseBuilder.globalY); | 258 EXPECT_EQ(10, webMouseBuilder.globalY); |
| 259 EXPECT_EQ(10, webMouseBuilder.windowX); | 259 EXPECT_EQ(10, webMouseBuilder.windowX); |
| 260 EXPECT_EQ(10, webMouseBuilder.windowY); | 260 EXPECT_EQ(10, webMouseBuilder.windowY); |
| 261 } | 261 } |
| 262 | 262 |
| 263 { | 263 { |
| 264 PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10)
, NoButton, PlatformEvent::MouseMoved, 1, false, false, false, false, 0); | 264 PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10)
, NoButton, PlatformEvent::MouseMoved, 1, false, false, false, false, 0); |
| 265 RefPtr<MouseEvent> mouseEvent = MouseEvent::create(WebCore::EventTypeNam
es::mousemove, domWindow, platformMouseEvent, 0, document); | 265 RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(WebCore::
EventTypeNames::mousemove, domWindow, platformMouseEvent, 0, document); |
| 266 WebMouseEventBuilder webMouseBuilder(view, docRenderer, *mouseEvent); | 266 WebMouseEventBuilder webMouseBuilder(view, docRenderer, *mouseEvent); |
| 267 EXPECT_EQ(WebMouseEvent::ButtonNone, webMouseBuilder.button); | 267 EXPECT_EQ(WebMouseEvent::ButtonNone, webMouseBuilder.button); |
| 268 } | 268 } |
| 269 | 269 |
| 270 { | 270 { |
| 271 PlatformGestureEvent platformGestureEvent(PlatformEvent::GestureScrollUp
date, IntPoint(10, 10), IntPoint(10, 10), IntSize(10, 10), 0, false, false, fals
e, false, 10, 10, 10, 10); | 271 PlatformGestureEvent platformGestureEvent(PlatformEvent::GestureScrollUp
date, IntPoint(10, 10), IntPoint(10, 10), IntSize(10, 10), 0, false, false, fals
e, false, 10, 10, 10, 10); |
| 272 RefPtr<GestureEvent> gestureEvent = GestureEvent::create(domWindow, plat
formGestureEvent); | 272 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(dom
Window, platformGestureEvent); |
| 273 WebGestureEventBuilder webGestureBuilder(view, docRenderer, *gestureEven
t); | 273 WebGestureEventBuilder webGestureBuilder(view, docRenderer, *gestureEven
t); |
| 274 | 274 |
| 275 EXPECT_EQ(10, webGestureBuilder.x); | 275 EXPECT_EQ(10, webGestureBuilder.x); |
| 276 EXPECT_EQ(10, webGestureBuilder.y); | 276 EXPECT_EQ(10, webGestureBuilder.y); |
| 277 EXPECT_EQ(10, webGestureBuilder.globalX); | 277 EXPECT_EQ(10, webGestureBuilder.globalX); |
| 278 EXPECT_EQ(10, webGestureBuilder.globalY); | 278 EXPECT_EQ(10, webGestureBuilder.globalY); |
| 279 EXPECT_EQ(10, webGestureBuilder.data.scrollUpdate.deltaX); | 279 EXPECT_EQ(10, webGestureBuilder.data.scrollUpdate.deltaX); |
| 280 EXPECT_EQ(10, webGestureBuilder.data.scrollUpdate.deltaY); | 280 EXPECT_EQ(10, webGestureBuilder.data.scrollUpdate.deltaY); |
| 281 } | 281 } |
| 282 | 282 |
| 283 { | 283 { |
| 284 RefPtrWillBeRawPtr<Touch> touch = Touch::create(webViewImpl->page()->mai
nFrame(), document.get(), 0, 10, 10, 10, 10, 10, 10, 0, 0); | 284 RefPtrWillBeRawPtr<Touch> touch = Touch::create(webViewImpl->page()->mai
nFrame(), document.get(), 0, 10, 10, 10, 10, 10, 10, 0, 0); |
| 285 RefPtrWillBeRawPtr<TouchList> touchList = TouchList::create(); | 285 RefPtrWillBeRawPtr<TouchList> touchList = TouchList::create(); |
| 286 touchList->append(touch); | 286 touchList->append(touch); |
| 287 RefPtr<TouchEvent> touchEvent = TouchEvent::create(touchList.get(), touc
hList.get(), touchList.get(), WebCore::EventTypeNames::touchmove, domWindow, 10,
10, 10, 10, false, false, false, false); | 287 RefPtrWillBeRawPtr<TouchEvent> touchEvent = TouchEvent::create(touchList
.get(), touchList.get(), touchList.get(), WebCore::EventTypeNames::touchmove, do
mWindow, 10, 10, 10, 10, false, false, false, false); |
| 288 | 288 |
| 289 WebTouchEventBuilder webTouchBuilder(view, docRenderer, *touchEvent); | 289 WebTouchEventBuilder webTouchBuilder(view, docRenderer, *touchEvent); |
| 290 ASSERT_EQ(1u, webTouchBuilder.touchesLength); | 290 ASSERT_EQ(1u, webTouchBuilder.touchesLength); |
| 291 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.x); | 291 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.x); |
| 292 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.y); | 292 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.y); |
| 293 EXPECT_EQ(10, webTouchBuilder.touches[0].position.x); | 293 EXPECT_EQ(10, webTouchBuilder.touches[0].position.x); |
| 294 EXPECT_EQ(10, webTouchBuilder.touches[0].position.y); | 294 EXPECT_EQ(10, webTouchBuilder.touches[0].position.y); |
| 295 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusX); | 295 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusX); |
| 296 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusY); | 296 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusY); |
| 297 } | 297 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 EXPECT_EQ(webGestureEvent.type, recreatedWebGestureEvent.type); | 486 EXPECT_EQ(webGestureEvent.type, recreatedWebGestureEvent.type); |
| 487 EXPECT_EQ(webGestureEvent.x, recreatedWebGestureEvent.x); | 487 EXPECT_EQ(webGestureEvent.x, recreatedWebGestureEvent.x); |
| 488 EXPECT_EQ(webGestureEvent.y, recreatedWebGestureEvent.y); | 488 EXPECT_EQ(webGestureEvent.y, recreatedWebGestureEvent.y); |
| 489 EXPECT_EQ(webGestureEvent.globalX, recreatedWebGestureEvent.globalX); | 489 EXPECT_EQ(webGestureEvent.globalX, recreatedWebGestureEvent.globalX); |
| 490 EXPECT_EQ(webGestureEvent.globalY, recreatedWebGestureEvent.globalY); | 490 EXPECT_EQ(webGestureEvent.globalY, recreatedWebGestureEvent.globalY); |
| 491 EXPECT_EQ(webGestureEvent.data.tap.tapCount, recreatedWebGestureEvent.da
ta.tap.tapCount); | 491 EXPECT_EQ(webGestureEvent.data.tap.tapCount, recreatedWebGestureEvent.da
ta.tap.tapCount); |
| 492 } | 492 } |
| 493 } | 493 } |
| 494 | 494 |
| 495 } // anonymous namespace | 495 } // anonymous namespace |
| OLD | NEW |