| 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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 WebViewImpl* webViewImpl = | 672 WebViewImpl* webViewImpl = |
| 673 webViewHelper.initializeAndLoad(baseURL + fileName, true); | 673 webViewHelper.initializeAndLoad(baseURL + fileName, true); |
| 674 int pageWidth = 640; | 674 int pageWidth = 640; |
| 675 int pageHeight = 480; | 675 int pageHeight = 480; |
| 676 webViewImpl->resize(WebSize(pageWidth, pageHeight)); | 676 webViewImpl->resize(WebSize(pageWidth, pageHeight)); |
| 677 webViewImpl->updateAllLifecyclePhases(); | 677 webViewImpl->updateAllLifecyclePhases(); |
| 678 | 678 |
| 679 webViewImpl->setPageScaleFactor(2); | 679 webViewImpl->setPageScaleFactor(2); |
| 680 | 680 |
| 681 IntPoint visualOffset(35, 60); | 681 IntPoint visualOffset(35, 60); |
| 682 webViewImpl->page()->frameHost().visualViewport().setLocation(visualOffset); | 682 webViewImpl->page()->visualViewport().setLocation(visualOffset); |
| 683 | 683 |
| 684 FrameView* view = toLocalFrame(webViewImpl->page()->mainFrame())->view(); | 684 FrameView* view = toLocalFrame(webViewImpl->page()->mainFrame())->view(); |
| 685 | 685 |
| 686 { | 686 { |
| 687 WebMouseEvent webMouseEvent(WebInputEvent::MouseMove, | 687 WebMouseEvent webMouseEvent(WebInputEvent::MouseMove, |
| 688 WebInputEvent::NoModifiers, | 688 WebInputEvent::NoModifiers, |
| 689 WebInputEvent::TimeStampForTesting); | 689 WebInputEvent::TimeStampForTesting); |
| 690 webMouseEvent.x = 10; | 690 webMouseEvent.x = 10; |
| 691 webMouseEvent.y = 10; | 691 webMouseEvent.y = 10; |
| 692 webMouseEvent.windowX = 10; | 692 webMouseEvent.windowX = 10; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 EXPECT_EQ(webMouseEvent.globalX, transformedMouseEvent.globalX); | 813 EXPECT_EQ(webMouseEvent.globalX, transformedMouseEvent.globalX); |
| 814 EXPECT_EQ(webMouseEvent.globalY, transformedMouseEvent.globalY); | 814 EXPECT_EQ(webMouseEvent.globalY, transformedMouseEvent.globalY); |
| 815 } | 815 } |
| 816 | 816 |
| 817 // Elastic overscroll and pinch-zoom (this doesn't actually ever happen, | 817 // Elastic overscroll and pinch-zoom (this doesn't actually ever happen, |
| 818 // but ensure that if it were to, the overscroll would be applied after the | 818 // but ensure that if it were to, the overscroll would be applied after the |
| 819 // pinch-zoom). | 819 // pinch-zoom). |
| 820 float pageScale = 2; | 820 float pageScale = 2; |
| 821 webViewImpl->setPageScaleFactor(pageScale); | 821 webViewImpl->setPageScaleFactor(pageScale); |
| 822 IntPoint visualOffset(35, 60); | 822 IntPoint visualOffset(35, 60); |
| 823 webViewImpl->page()->frameHost().visualViewport().setLocation(visualOffset); | 823 webViewImpl->page()->visualViewport().setLocation(visualOffset); |
| 824 { | 824 { |
| 825 WebMouseEvent webMouseEvent(WebInputEvent::MouseMove, | 825 WebMouseEvent webMouseEvent(WebInputEvent::MouseMove, |
| 826 WebInputEvent::NoModifiers, | 826 WebInputEvent::NoModifiers, |
| 827 WebInputEvent::TimeStampForTesting); | 827 WebInputEvent::TimeStampForTesting); |
| 828 webMouseEvent.x = 10; | 828 webMouseEvent.x = 10; |
| 829 webMouseEvent.y = 10; | 829 webMouseEvent.y = 10; |
| 830 webMouseEvent.windowX = 10; | 830 webMouseEvent.windowX = 10; |
| 831 webMouseEvent.windowY = 10; | 831 webMouseEvent.windowY = 10; |
| 832 webMouseEvent.globalX = 10; | 832 webMouseEvent.globalX = 10; |
| 833 webMouseEvent.globalY = 10; | 833 webMouseEvent.globalY = 10; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 flooredIntPoint(transformedMouseEvent.positionInRootFrame()); | 886 flooredIntPoint(transformedMouseEvent.positionInRootFrame()); |
| 887 | 887 |
| 888 EXPECT_EQ(webMouseEvent.x + elasticOverscroll.width(), position.x()); | 888 EXPECT_EQ(webMouseEvent.x + elasticOverscroll.width(), position.x()); |
| 889 EXPECT_EQ(webMouseEvent.y + elasticOverscroll.height(), position.y()); | 889 EXPECT_EQ(webMouseEvent.y + elasticOverscroll.height(), position.y()); |
| 890 EXPECT_EQ(webMouseEvent.globalX, transformedMouseEvent.globalX); | 890 EXPECT_EQ(webMouseEvent.globalX, transformedMouseEvent.globalX); |
| 891 EXPECT_EQ(webMouseEvent.globalY, transformedMouseEvent.globalY); | 891 EXPECT_EQ(webMouseEvent.globalY, transformedMouseEvent.globalY); |
| 892 } | 892 } |
| 893 } | 893 } |
| 894 | 894 |
| 895 } // namespace blink | 895 } // namespace blink |
| OLD | NEW |