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 25 matching lines...) Expand all Loading... |
36 #include "core/events/KeyboardEvent.h" | 36 #include "core/events/KeyboardEvent.h" |
37 #include "core/events/MouseEvent.h" | 37 #include "core/events/MouseEvent.h" |
38 #include "core/events/TouchEvent.h" | 38 #include "core/events/TouchEvent.h" |
39 #include "core/events/WheelEvent.h" | 39 #include "core/events/WheelEvent.h" |
40 #include "core/frame/FrameHost.h" | 40 #include "core/frame/FrameHost.h" |
41 #include "core/frame/FrameView.h" | 41 #include "core/frame/FrameView.h" |
42 #include "core/frame/LocalFrame.h" | 42 #include "core/frame/LocalFrame.h" |
43 #include "core/frame/VisualViewport.h" | 43 #include "core/frame/VisualViewport.h" |
44 #include "core/layout/api/LayoutViewItem.h" | 44 #include "core/layout/api/LayoutViewItem.h" |
45 #include "core/page/Page.h" | 45 #include "core/page/Page.h" |
| 46 #include "platform/geometry/IntSize.h" |
46 #include "platform/testing/URLTestHelpers.h" | 47 #include "platform/testing/URLTestHelpers.h" |
47 #include "public/web/WebFrame.h" | 48 #include "public/web/WebFrame.h" |
48 #include "public/web/WebSettings.h" | 49 #include "public/web/WebSettings.h" |
49 #include "testing/gtest/include/gtest/gtest.h" | 50 #include "testing/gtest/include/gtest/gtest.h" |
| 51 #include "web/WebLocalFrameImpl.h" |
50 #include "web/WebViewImpl.h" | 52 #include "web/WebViewImpl.h" |
51 #include "web/tests/FrameTestHelpers.h" | 53 #include "web/tests/FrameTestHelpers.h" |
52 | 54 |
53 namespace blink { | 55 namespace blink { |
54 | 56 |
55 KeyboardEvent* createKeyboardEventWithLocation(KeyboardEvent::KeyLocationCode lo
cation) | 57 KeyboardEvent* createKeyboardEventWithLocation(KeyboardEvent::KeyLocationCode lo
cation) |
56 { | 58 { |
57 return KeyboardEvent::create("keydown", true, true, 0, "", "", location, Pla
tformEvent::NoModifiers, 0); | 59 return KeyboardEvent::create("keydown", true, true, 0, "", "", location, Pla
tformEvent::NoModifiers, 0); |
58 } | 60 } |
59 | 61 |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_s
tr()), WebString::fromUTF8("fixed_layout.html")); | 507 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_s
tr()), WebString::fromUTF8("fixed_layout.html")); |
506 FrameTestHelpers::WebViewHelper webViewHelper; | 508 FrameTestHelpers::WebViewHelper webViewHelper; |
507 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(baseURL + fileNam
e, true); | 509 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(baseURL + fileNam
e, true); |
508 webViewImpl->settings()->setViewportEnabled(true); | 510 webViewImpl->settings()->setViewportEnabled(true); |
509 int pageWidth = 640; | 511 int pageWidth = 640; |
510 int pageHeight = 480; | 512 int pageHeight = 480; |
511 webViewImpl->resize(WebSize(pageWidth, pageHeight)); | 513 webViewImpl->resize(WebSize(pageWidth, pageHeight)); |
512 webViewImpl->updateAllLifecyclePhases(); | 514 webViewImpl->updateAllLifecyclePhases(); |
513 | 515 |
514 webViewImpl->setPageScaleFactor(2); | 516 webViewImpl->setPageScaleFactor(2); |
515 webViewImpl->setRootLayerTransform(WebSize(10, 20), 1.5); | 517 webViewImpl->mainFrameImpl()->setInputEventsTransformForEmulation(IntSize(10
, 20), 1.5); |
516 | 518 |
517 FrameView* view = toLocalFrame(webViewImpl->page()->mainFrame())->view(); | 519 FrameView* view = toLocalFrame(webViewImpl->page()->mainFrame())->view(); |
518 | 520 |
519 { | 521 { |
520 WebMouseEvent webMouseEvent; | 522 WebMouseEvent webMouseEvent; |
521 webMouseEvent.type = WebInputEvent::MouseMove; | 523 webMouseEvent.type = WebInputEvent::MouseMove; |
522 webMouseEvent.x = 100; | 524 webMouseEvent.x = 100; |
523 webMouseEvent.y = 110; | 525 webMouseEvent.y = 110; |
524 webMouseEvent.windowX = 100; | 526 webMouseEvent.windowX = 100; |
525 webMouseEvent.windowY = 110; | 527 webMouseEvent.windowY = 110; |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 EXPECT_EQ(10, platformGestureBuilder.globalPosition().x()); | 1084 EXPECT_EQ(10, platformGestureBuilder.globalPosition().x()); |
1083 EXPECT_EQ(15, platformGestureBuilder.globalPosition().y()); | 1085 EXPECT_EQ(15, platformGestureBuilder.globalPosition().y()); |
1084 EXPECT_EQ(ScrollInertialPhaseNonMomentum, platformGestureBuilder.inertia
lPhase()); | 1086 EXPECT_EQ(ScrollInertialPhaseNonMomentum, platformGestureBuilder.inertia
lPhase()); |
1085 EXPECT_TRUE(platformGestureBuilder.synthetic()); | 1087 EXPECT_TRUE(platformGestureBuilder.synthetic()); |
1086 EXPECT_EQ(ScrollGranularity::ScrollByPage, platformGestureBuilder.deltaU
nits()); | 1088 EXPECT_EQ(ScrollGranularity::ScrollByPage, platformGestureBuilder.deltaU
nits()); |
1087 EXPECT_EQ(12345U, platformGestureBuilder.uniqueTouchEventId()); | 1089 EXPECT_EQ(12345U, platformGestureBuilder.uniqueTouchEventId()); |
1088 } | 1090 } |
1089 } | 1091 } |
1090 | 1092 |
1091 } // namespace blink | 1093 } // namespace blink |
OLD | NEW |