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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
384 } | 384 } |
385 | 385 |
386 { | 386 { |
387 PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10) , NoButton, PlatformEvent::MouseMoved, 1, false, false, false, false, PlatformMo useEvent::RealOrIndistinguishable, 0); | 387 PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10) , NoButton, PlatformEvent::MouseMoved, 1, false, false, false, false, PlatformMo useEvent::RealOrIndistinguishable, 0); |
388 RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(EventType Names::mousemove, domWindow, platformMouseEvent, 0, document); | 388 RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(EventType Names::mousemove, domWindow, platformMouseEvent, 0, document); |
389 WebMouseEventBuilder webMouseBuilder(view, documentRenderView, *mouseEve nt); | 389 WebMouseEventBuilder webMouseBuilder(view, documentRenderView, *mouseEve nt); |
390 EXPECT_EQ(WebMouseEvent::ButtonNone, webMouseBuilder.button); | 390 EXPECT_EQ(WebMouseEvent::ButtonNone, webMouseBuilder.button); |
391 } | 391 } |
392 | 392 |
393 { | 393 { |
394 PlatformGestureEvent platformGestureEvent(PlatformEvent::GestureScrollUp date, IntPoint(10, 10), IntPoint(10, 10), IntSize(10, 10), 0, false, false, fals e, false, 10, 10, 10, 10); | 394 PlatformGestureEvent platformGestureEvent(PlatformEvent::GestureScrollUp date, IntPoint(10, 10), IntPoint(10, 10), IntSize(10, 10), 0, false, false, fals e, false, 10, 10, 10, 10, false); |
Rick Byers
2014/11/14 18:21:45
You can add a conversion unit test now that sets t
majidvp
2014/11/17 21:33:03
Good point. The conversion from PlatformGestureEve
| |
395 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(dom Window, platformGestureEvent); | 395 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(dom Window, platformGestureEvent); |
396 WebGestureEventBuilder webGestureBuilder(view, documentRenderView, *gest ureEvent); | 396 WebGestureEventBuilder webGestureBuilder(view, documentRenderView, *gest ureEvent); |
397 | 397 |
398 EXPECT_EQ(10, webGestureBuilder.x); | 398 EXPECT_EQ(10, webGestureBuilder.x); |
399 EXPECT_EQ(10, webGestureBuilder.y); | 399 EXPECT_EQ(10, webGestureBuilder.y); |
400 EXPECT_EQ(10, webGestureBuilder.globalX); | 400 EXPECT_EQ(10, webGestureBuilder.globalX); |
401 EXPECT_EQ(10, webGestureBuilder.globalY); | 401 EXPECT_EQ(10, webGestureBuilder.globalY); |
402 EXPECT_EQ(10, webGestureBuilder.data.scrollUpdate.deltaX); | 402 EXPECT_EQ(10, webGestureBuilder.data.scrollUpdate.deltaX); |
403 EXPECT_EQ(10, webGestureBuilder.data.scrollUpdate.deltaY); | 403 EXPECT_EQ(10, webGestureBuilder.data.scrollUpdate.deltaY); |
404 } | 404 } |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
707 | 707 |
708 PlatformTouchEventBuilder platformTouchBuilder(view, webTouchEvent); | 708 PlatformTouchEventBuilder platformTouchBuilder(view, webTouchEvent); |
709 EXPECT_FLOAT_EQ(10.6f, platformTouchBuilder.touchPoints()[0].screenPos() .x()); | 709 EXPECT_FLOAT_EQ(10.6f, platformTouchBuilder.touchPoints()[0].screenPos() .x()); |
710 EXPECT_FLOAT_EQ(10.4f, platformTouchBuilder.touchPoints()[0].screenPos() .y()); | 710 EXPECT_FLOAT_EQ(10.4f, platformTouchBuilder.touchPoints()[0].screenPos() .y()); |
711 EXPECT_FLOAT_EQ(5.3f + pinchOffset.x(), platformTouchBuilder.touchPoints ()[0].pos().x()); | 711 EXPECT_FLOAT_EQ(5.3f + pinchOffset.x(), platformTouchBuilder.touchPoints ()[0].pos().x()); |
712 EXPECT_FLOAT_EQ(5.2f + pinchOffset.y(), platformTouchBuilder.touchPoints ()[0].pos().y()); | 712 EXPECT_FLOAT_EQ(5.2f + pinchOffset.y(), platformTouchBuilder.touchPoints ()[0].pos().y()); |
713 } | 713 } |
714 } | 714 } |
715 | 715 |
716 } // anonymous namespace | 716 } // anonymous namespace |
OLD | NEW |