| 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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 } | 393 } |
| 394 | 394 |
| 395 { | 395 { |
| 396 PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10)
, NoButton, PlatformEvent::MouseMoved, 1, false, false, false, false, PlatformMo
useEvent::RealOrIndistinguishable, 0); | 396 PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10)
, NoButton, PlatformEvent::MouseMoved, 1, false, false, false, false, PlatformMo
useEvent::RealOrIndistinguishable, 0); |
| 397 RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(EventType
Names::mousemove, domWindow, platformMouseEvent, 0, document); | 397 RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(EventType
Names::mousemove, domWindow, platformMouseEvent, 0, document); |
| 398 WebMouseEventBuilder webMouseBuilder(view, documentLayoutView, *mouseEve
nt); | 398 WebMouseEventBuilder webMouseBuilder(view, documentLayoutView, *mouseEve
nt); |
| 399 EXPECT_EQ(WebMouseEvent::ButtonNone, webMouseBuilder.button); | 399 EXPECT_EQ(WebMouseEvent::ButtonNone, webMouseBuilder.button); |
| 400 } | 400 } |
| 401 | 401 |
| 402 { | 402 { |
| 403 PlatformGestureEvent platformGestureEvent(PlatformEvent::GestureScrollUp
date, IntPoint(10, 12), IntPoint(20, 22), IntSize(25, 27), 0, false, false, fals
e, false, 30, 32, 40, 42, true); | 403 PlatformGestureEvent platformGestureEvent(PlatformEvent::GestureScrollUp
date, IntPoint(10, 12), IntPoint(20, 22), IntSize(25, 27), 0, |
| 404 // TODO: GestureEvent does not preserve velocityX, velocityY, and | 404 false, false, false, false, 30, 32, 40, 42, true, false); |
| 405 // preventPropagation. It also fails to scale coordinates (x,y, deltaX, | 405 // FIXME: GestureEvent does not preserve velocityX, velocityY, and |
| 406 // preventPropagation. It also fails to scale coordinates (x, y, deltaX, |
| 406 // deltaY) to the page scale. This may lead to unexpected bugs if a | 407 // deltaY) to the page scale. This may lead to unexpected bugs if a |
| 407 // PlatformGestureEvent is transformed into WebGestureEvent and back. | 408 // PlatformGestureEvent is transformed into WebGestureEvent and back. |
| 408 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(dom
Window, platformGestureEvent); | 409 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(dom
Window, platformGestureEvent); |
| 409 WebGestureEventBuilder webGestureBuilder(view, documentLayoutView, *gest
ureEvent); | 410 WebGestureEventBuilder webGestureBuilder(view, documentLayoutView, *gest
ureEvent); |
| 410 | 411 |
| 411 EXPECT_EQ(10, webGestureBuilder.x); | 412 EXPECT_EQ(10, webGestureBuilder.x); |
| 412 EXPECT_EQ(12, webGestureBuilder.y); | 413 EXPECT_EQ(12, webGestureBuilder.y); |
| 413 EXPECT_EQ(20, webGestureBuilder.globalX); | 414 EXPECT_EQ(20, webGestureBuilder.globalX); |
| 414 EXPECT_EQ(22, webGestureBuilder.globalY); | 415 EXPECT_EQ(22, webGestureBuilder.globalY); |
| 415 EXPECT_EQ(30, webGestureBuilder.data.scrollUpdate.deltaX); | 416 EXPECT_EQ(30, webGestureBuilder.data.scrollUpdate.deltaX); |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 EXPECT_EQ(5, platformWheelBuilder.position().y()); | 853 EXPECT_EQ(5, platformWheelBuilder.position().y()); |
| 853 EXPECT_EQ(10, platformWheelBuilder.deltaX()); | 854 EXPECT_EQ(10, platformWheelBuilder.deltaX()); |
| 854 EXPECT_EQ(15, platformWheelBuilder.deltaY()); | 855 EXPECT_EQ(15, platformWheelBuilder.deltaY()); |
| 855 EXPECT_EQ(WebInputEvent::ControlKey, platformWheelBuilder.modifiers()); | 856 EXPECT_EQ(WebInputEvent::ControlKey, platformWheelBuilder.modifiers()); |
| 856 EXPECT_TRUE(platformWheelBuilder.hasPreciseScrollingDeltas()); | 857 EXPECT_TRUE(platformWheelBuilder.hasPreciseScrollingDeltas()); |
| 857 EXPECT_TRUE(platformWheelBuilder.canScroll()); | 858 EXPECT_TRUE(platformWheelBuilder.canScroll()); |
| 858 } | 859 } |
| 859 } | 860 } |
| 860 | 861 |
| 861 } // anonymous namespace | 862 } // anonymous namespace |
| OLD | NEW |