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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 EXPECT_FLOAT_EQ(10.4f, platformTouchBuilder.touchPoints()[0].screenPos()
.y()); | 243 EXPECT_FLOAT_EQ(10.4f, platformTouchBuilder.touchPoints()[0].screenPos()
.y()); |
244 EXPECT_FLOAT_EQ(5.3f, platformTouchBuilder.touchPoints()[0].pos().x()); | 244 EXPECT_FLOAT_EQ(5.3f, platformTouchBuilder.touchPoints()[0].pos().x()); |
245 EXPECT_FLOAT_EQ(5.2f, platformTouchBuilder.touchPoints()[0].pos().y()); | 245 EXPECT_FLOAT_EQ(5.2f, platformTouchBuilder.touchPoints()[0].pos().y()); |
246 EXPECT_FLOAT_EQ(5.3f, platformTouchBuilder.touchPoints()[0].radius().wid
th()); | 246 EXPECT_FLOAT_EQ(5.3f, platformTouchBuilder.touchPoints()[0].radius().wid
th()); |
247 EXPECT_FLOAT_EQ(5.2f, platformTouchBuilder.touchPoints()[0].radius().hei
ght()); | 247 EXPECT_FLOAT_EQ(5.2f, platformTouchBuilder.touchPoints()[0].radius().hei
ght()); |
248 } | 248 } |
249 | 249 |
250 // Reverse builders should *not* go back to physical pixels, as they are use
d for plugins | 250 // Reverse builders should *not* go back to physical pixels, as they are use
d for plugins |
251 // which expect CSS pixel coordinates. | 251 // which expect CSS pixel coordinates. |
252 { | 252 { |
253 PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10)
, LeftButton, PlatformEvent::MouseMoved, 1, false, false, false, false, 0); | 253 PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10)
, LeftButton, PlatformEvent::MouseMoved, 1, false, false, false, false, Platform
MouseEvent::RealOrIndistinguishable, 0); |
254 RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(blink::Ev
entTypeNames::mousemove, domWindow, platformMouseEvent, 0, document); | 254 RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(blink::Ev
entTypeNames::mousemove, domWindow, platformMouseEvent, 0, document); |
255 WebMouseEventBuilder webMouseBuilder(view, documentRenderView, *mouseEve
nt); | 255 WebMouseEventBuilder webMouseBuilder(view, documentRenderView, *mouseEve
nt); |
256 | 256 |
257 EXPECT_EQ(10, webMouseBuilder.x); | 257 EXPECT_EQ(10, webMouseBuilder.x); |
258 EXPECT_EQ(10, webMouseBuilder.y); | 258 EXPECT_EQ(10, webMouseBuilder.y); |
259 EXPECT_EQ(10, webMouseBuilder.globalX); | 259 EXPECT_EQ(10, webMouseBuilder.globalX); |
260 EXPECT_EQ(10, webMouseBuilder.globalY); | 260 EXPECT_EQ(10, webMouseBuilder.globalY); |
261 EXPECT_EQ(10, webMouseBuilder.windowX); | 261 EXPECT_EQ(10, webMouseBuilder.windowX); |
262 EXPECT_EQ(10, webMouseBuilder.windowY); | 262 EXPECT_EQ(10, webMouseBuilder.windowY); |
263 } | 263 } |
264 | 264 |
265 { | 265 { |
266 PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10)
, NoButton, PlatformEvent::MouseMoved, 1, false, false, false, false, 0); | 266 PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10)
, NoButton, PlatformEvent::MouseMoved, 1, false, false, false, false, PlatformMo
useEvent::RealOrIndistinguishable, 0); |
267 RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(blink::Ev
entTypeNames::mousemove, domWindow, platformMouseEvent, 0, document); | 267 RefPtrWillBeRawPtr<MouseEvent> mouseEvent = MouseEvent::create(blink::Ev
entTypeNames::mousemove, domWindow, platformMouseEvent, 0, document); |
268 WebMouseEventBuilder webMouseBuilder(view, documentRenderView, *mouseEve
nt); | 268 WebMouseEventBuilder webMouseBuilder(view, documentRenderView, *mouseEve
nt); |
269 EXPECT_EQ(WebMouseEvent::ButtonNone, webMouseBuilder.button); | 269 EXPECT_EQ(WebMouseEvent::ButtonNone, webMouseBuilder.button); |
270 } | 270 } |
271 | 271 |
272 { | 272 { |
273 PlatformGestureEvent platformGestureEvent(PlatformEvent::GestureScrollUp
date, IntPoint(10, 10), IntPoint(10, 10), IntSize(10, 10), 0, false, false, fals
e, false, 10, 10, 10, 10); | 273 PlatformGestureEvent platformGestureEvent(PlatformEvent::GestureScrollUp
date, IntPoint(10, 10), IntPoint(10, 10), IntSize(10, 10), 0, false, false, fals
e, false, 10, 10, 10, 10); |
274 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(dom
Window, platformGestureEvent); | 274 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(dom
Window, platformGestureEvent); |
275 WebGestureEventBuilder webGestureBuilder(view, documentRenderView, *gest
ureEvent); | 275 WebGestureEventBuilder webGestureBuilder(view, documentRenderView, *gest
ureEvent); |
276 | 276 |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 | 586 |
587 PlatformTouchEventBuilder platformTouchBuilder(view, webTouchEvent); | 587 PlatformTouchEventBuilder platformTouchBuilder(view, webTouchEvent); |
588 EXPECT_FLOAT_EQ(10.6f, platformTouchBuilder.touchPoints()[0].screenPos()
.x()); | 588 EXPECT_FLOAT_EQ(10.6f, platformTouchBuilder.touchPoints()[0].screenPos()
.x()); |
589 EXPECT_FLOAT_EQ(10.4f, platformTouchBuilder.touchPoints()[0].screenPos()
.y()); | 589 EXPECT_FLOAT_EQ(10.4f, platformTouchBuilder.touchPoints()[0].screenPos()
.y()); |
590 EXPECT_FLOAT_EQ(5.3f + pinchOffset.x(), platformTouchBuilder.touchPoints
()[0].pos().x()); | 590 EXPECT_FLOAT_EQ(5.3f + pinchOffset.x(), platformTouchBuilder.touchPoints
()[0].pos().x()); |
591 EXPECT_FLOAT_EQ(5.2f + pinchOffset.y(), platformTouchBuilder.touchPoints
()[0].pos().y()); | 591 EXPECT_FLOAT_EQ(5.2f + pinchOffset.y(), platformTouchBuilder.touchPoints
()[0].pos().y()); |
592 } | 592 } |
593 } | 593 } |
594 | 594 |
595 } // anonymous namespace | 595 } // anonymous namespace |
OLD | NEW |