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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 webViewImpl->settings()->setViewportEnabled(true); | 103 webViewImpl->settings()->setViewportEnabled(true); |
104 int pageWidth = 640; | 104 int pageWidth = 640; |
105 int pageHeight = 480; | 105 int pageHeight = 480; |
106 webViewImpl->resize(WebSize(pageWidth, pageHeight)); | 106 webViewImpl->resize(WebSize(pageWidth, pageHeight)); |
107 webViewImpl->layout(); | 107 webViewImpl->layout(); |
108 | 108 |
109 webViewImpl->setPageScaleFactor(2); | 109 webViewImpl->setPageScaleFactor(2); |
110 | 110 |
111 FrameView* view = toLocalFrame(webViewImpl->page()->mainFrame())->view(); | 111 FrameView* view = toLocalFrame(webViewImpl->page()->mainFrame())->view(); |
112 RefPtrWillBeRawPtr<Document> document = toLocalFrame(webViewImpl->page()->ma
inFrame())->document(); | 112 RefPtrWillBeRawPtr<Document> document = toLocalFrame(webViewImpl->page()->ma
inFrame())->document(); |
113 DOMWindow* domWindow = document->domWindow(); | 113 LocalDOMWindow* domWindow = document->domWindow(); |
114 RenderView* documentRenderView = document->renderView(); | 114 RenderView* documentRenderView = document->renderView(); |
115 | 115 |
116 { | 116 { |
117 WebMouseEvent webMouseEvent; | 117 WebMouseEvent webMouseEvent; |
118 webMouseEvent.type = WebInputEvent::MouseMove; | 118 webMouseEvent.type = WebInputEvent::MouseMove; |
119 webMouseEvent.x = 10; | 119 webMouseEvent.x = 10; |
120 webMouseEvent.y = 10; | 120 webMouseEvent.y = 10; |
121 webMouseEvent.windowX = 10; | 121 webMouseEvent.windowX = 10; |
122 webMouseEvent.windowY = 10; | 122 webMouseEvent.windowY = 10; |
123 webMouseEvent.globalX = 10; | 123 webMouseEvent.globalX = 10; |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_s
tr()), WebString::fromUTF8("fixed_layout.html")); | 455 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_s
tr()), WebString::fromUTF8("fixed_layout.html")); |
456 FrameTestHelpers::WebViewHelper webViewHelper; | 456 FrameTestHelpers::WebViewHelper webViewHelper; |
457 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(baseURL + fileNam
e, true); | 457 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(baseURL + fileNam
e, true); |
458 int pageWidth = 640; | 458 int pageWidth = 640; |
459 int pageHeight = 480; | 459 int pageHeight = 480; |
460 webViewImpl->resize(WebSize(pageWidth, pageHeight)); | 460 webViewImpl->resize(WebSize(pageWidth, pageHeight)); |
461 webViewImpl->layout(); | 461 webViewImpl->layout(); |
462 | 462 |
463 FrameView* view = toLocalFrame(webViewImpl->page()->mainFrame())->view(); | 463 FrameView* view = toLocalFrame(webViewImpl->page()->mainFrame())->view(); |
464 RefPtrWillBeRawPtr<Document> document = toLocalFrame(webViewImpl->page()->ma
inFrame())->document(); | 464 RefPtrWillBeRawPtr<Document> document = toLocalFrame(webViewImpl->page()->ma
inFrame())->document(); |
465 DOMWindow* domWindow = document->domWindow(); | 465 LocalDOMWindow* domWindow = document->domWindow(); |
466 RenderView* documentRenderView = document->renderView(); | 466 RenderView* documentRenderView = document->renderView(); |
467 | 467 |
468 { | 468 { |
469 WebGestureEvent webGestureEvent; | 469 WebGestureEvent webGestureEvent; |
470 webGestureEvent.type = WebInputEvent::GestureTap; | 470 webGestureEvent.type = WebInputEvent::GestureTap; |
471 webGestureEvent.x = 10; | 471 webGestureEvent.x = 10; |
472 webGestureEvent.y = 10; | 472 webGestureEvent.y = 10; |
473 webGestureEvent.globalX = 10; | 473 webGestureEvent.globalX = 10; |
474 webGestureEvent.globalY = 10; | 474 webGestureEvent.globalY = 10; |
475 webGestureEvent.data.tap.tapCount = 1; | 475 webGestureEvent.data.tap.tapCount = 1; |
(...skipping 110 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 |