Chromium Code Reviews| Index: Source/web/tests/WebInputEventConversionTest.cpp |
| diff --git a/Source/web/tests/WebInputEventConversionTest.cpp b/Source/web/tests/WebInputEventConversionTest.cpp |
| index 810a1e4b84c3560f4727fa81d4f3490ae1bb7133..b7249b2bc012b39e488db4b95ed6f0454669e24d 100644 |
| --- a/Source/web/tests/WebInputEventConversionTest.cpp |
| +++ b/Source/web/tests/WebInputEventConversionTest.cpp |
| @@ -713,4 +713,41 @@ TEST(WebInputEventConversionTest, PinchViewportOffset) |
| } |
| } |
| +TEST(WebInputEventConversionTest, CtrlWheelScroll) |
|
tdresser
2014/11/27 15:06:06
You should either modify an existing test, or add
Rick Byers
2014/11/27 15:55:15
Lan and I took a quick look together last night an
lanwei
2014/12/02 06:28:22
Done.
lanwei
2014/12/02 06:28:22
Done.
|
| +{ |
| + const std::string baseURL("http://www.test4.com/"); |
| + const std::string fileName("fixed_layout.html"); |
| + |
| + URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_str()), WebString::fromUTF8("fixed_layout.html")); |
| + FrameTestHelpers::WebViewHelper webViewHelper; |
| + WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(baseURL + fileName, true); |
| + int pageWidth = 640; |
| + int pageHeight = 480; |
| + webViewImpl->resize(WebSize(pageWidth, pageHeight)); |
| + webViewImpl->layout(); |
| + |
| + FrameView* view = toLocalFrame(webViewImpl->page()->mainFrame())->view(); |
| + |
| + { |
| + WebMouseWheelEvent webMouseWheelEvent; |
| + webMouseWheelEvent.type = WebInputEvent::MouseWheel; |
| + webMouseWheelEvent.x = 10; |
| + webMouseWheelEvent.y = 10; |
| + webMouseWheelEvent.deltaX = 5; |
| + webMouseWheelEvent.deltaY = 5; |
| + webMouseWheelEvent.modifiers = WebInputEvent::ControlKey; |
| + webMouseWheelEvent.hasPreciseScrollingDeltas = true; |
| + webMouseWheelEvent.suppressScroll = true; |
| + |
| + PlatformWheelEventBuilder platformWheelBuilder(view, webMouseWheelEvent); |
| + EXPECT_EQ(10, platformWheelBuilder.position().x()); |
| + EXPECT_EQ(10, platformWheelBuilder.position().y()); |
| + EXPECT_EQ(5, platformWheelBuilder.deltaX()); |
| + EXPECT_EQ(5, platformWheelBuilder.deltaY()); |
| + EXPECT_TRUE(platformWheelBuilder.hasPreciseScrollingDeltas()); |
| + EXPECT_TRUE(platformWheelBuilder.suppressScroll()); |
| + EXPECT_EQ(WebInputEvent::ControlKey, platformWheelBuilder.modifiers()); |
| + } |
| +} |
| + |
| } // anonymous namespace |