| 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 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 FrameTestHelpers::WebViewHelper webViewHelper; | 799 FrameTestHelpers::WebViewHelper webViewHelper; |
| 800 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(baseURL + fileNam
e, true); | 800 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(baseURL + fileNam
e, true); |
| 801 int pageWidth = 640; | 801 int pageWidth = 640; |
| 802 int pageHeight = 480; | 802 int pageHeight = 480; |
| 803 webViewImpl->resize(WebSize(pageWidth, pageHeight)); | 803 webViewImpl->resize(WebSize(pageWidth, pageHeight)); |
| 804 webViewImpl->layout(); | 804 webViewImpl->layout(); |
| 805 | 805 |
| 806 RefPtrWillBeRawPtr<Document> document = toLocalFrame(webViewImpl->page()->ma
inFrame())->document(); | 806 RefPtrWillBeRawPtr<Document> document = toLocalFrame(webViewImpl->page()->ma
inFrame())->document(); |
| 807 RefPtrWillBeRawPtr<WheelEvent> event = WheelEvent::create(FloatPoint(1, 3),
FloatPoint(5, 10), | 807 RefPtrWillBeRawPtr<WheelEvent> event = WheelEvent::create(FloatPoint(1, 3),
FloatPoint(5, 10), |
| 808 WheelEvent::DOM_DELTA_PAGE, document.get()->domWindow(), IntPoint(2, 6)
, IntPoint(10, 30), | 808 WheelEvent::DOM_DELTA_PAGE, document.get()->domWindow(), IntPoint(2, 6)
, IntPoint(10, 30), |
| 809 true, false, false, false, 0, true); | 809 true, false, false, false, 0, true, true); |
| 810 WebMouseWheelEventBuilder webMouseWheel(toLocalFrame(webViewImpl->page()->ma
inFrame())->view(), document.get()->renderView(), *event); | 810 WebMouseWheelEventBuilder webMouseWheel(toLocalFrame(webViewImpl->page()->ma
inFrame())->view(), document.get()->renderView(), *event); |
| 811 EXPECT_EQ(1, webMouseWheel.wheelTicksX); | 811 EXPECT_EQ(1, webMouseWheel.wheelTicksX); |
| 812 EXPECT_EQ(3, webMouseWheel.wheelTicksY); | 812 EXPECT_EQ(3, webMouseWheel.wheelTicksY); |
| 813 EXPECT_EQ(5, webMouseWheel.deltaX); | 813 EXPECT_EQ(5, webMouseWheel.deltaX); |
| 814 EXPECT_EQ(10, webMouseWheel.deltaY); | 814 EXPECT_EQ(10, webMouseWheel.deltaY); |
| 815 EXPECT_EQ(2, webMouseWheel.globalX); | 815 EXPECT_EQ(2, webMouseWheel.globalX); |
| 816 EXPECT_EQ(6, webMouseWheel.globalY); | 816 EXPECT_EQ(6, webMouseWheel.globalY); |
| 817 EXPECT_EQ(10, webMouseWheel.windowX); | 817 EXPECT_EQ(10, webMouseWheel.windowX); |
| 818 EXPECT_EQ(30, webMouseWheel.windowY); | 818 EXPECT_EQ(30, webMouseWheel.windowY); |
| 819 EXPECT_TRUE(webMouseWheel.scrollByPage); | 819 EXPECT_TRUE(webMouseWheel.scrollByPage); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 EXPECT_EQ(5, platformWheelBuilder.position().y()); | 852 EXPECT_EQ(5, platformWheelBuilder.position().y()); |
| 853 EXPECT_EQ(10, platformWheelBuilder.deltaX()); | 853 EXPECT_EQ(10, platformWheelBuilder.deltaX()); |
| 854 EXPECT_EQ(15, platformWheelBuilder.deltaY()); | 854 EXPECT_EQ(15, platformWheelBuilder.deltaY()); |
| 855 EXPECT_EQ(WebInputEvent::ControlKey, platformWheelBuilder.modifiers()); | 855 EXPECT_EQ(WebInputEvent::ControlKey, platformWheelBuilder.modifiers()); |
| 856 EXPECT_TRUE(platformWheelBuilder.hasPreciseScrollingDeltas()); | 856 EXPECT_TRUE(platformWheelBuilder.hasPreciseScrollingDeltas()); |
| 857 EXPECT_TRUE(platformWheelBuilder.canScroll()); | 857 EXPECT_TRUE(platformWheelBuilder.canScroll()); |
| 858 } | 858 } |
| 859 } | 859 } |
| 860 | 860 |
| 861 } // anonymous namespace | 861 } // anonymous namespace |
| OLD | NEW |