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