| 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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 webMouseWheelEvent.modifiers = WebInputEvent::ControlKey; | 933 webMouseWheelEvent.modifiers = WebInputEvent::ControlKey; |
| 934 webMouseWheelEvent.hasPreciseScrollingDeltas = true; | 934 webMouseWheelEvent.hasPreciseScrollingDeltas = true; |
| 935 webMouseWheelEvent.canScroll = true; | 935 webMouseWheelEvent.canScroll = true; |
| 936 webMouseWheelEvent.railsMode = WebInputEvent::RailsModeHorizontal; | 936 webMouseWheelEvent.railsMode = WebInputEvent::RailsModeHorizontal; |
| 937 | 937 |
| 938 PlatformWheelEventBuilder platformWheelBuilder(view, webMouseWheelEvent)
; | 938 PlatformWheelEventBuilder platformWheelBuilder(view, webMouseWheelEvent)
; |
| 939 EXPECT_EQ(0, platformWheelBuilder.position().x()); | 939 EXPECT_EQ(0, platformWheelBuilder.position().x()); |
| 940 EXPECT_EQ(5, platformWheelBuilder.position().y()); | 940 EXPECT_EQ(5, platformWheelBuilder.position().y()); |
| 941 EXPECT_EQ(10, platformWheelBuilder.deltaX()); | 941 EXPECT_EQ(10, platformWheelBuilder.deltaX()); |
| 942 EXPECT_EQ(15, platformWheelBuilder.deltaY()); | 942 EXPECT_EQ(15, platformWheelBuilder.deltaY()); |
| 943 EXPECT_EQ(PlatformEvent::CtrlKey, platformWheelBuilder.modifiers()); | 943 EXPECT_EQ(PlatformEvent::CtrlKey, platformWheelBuilder.getModifiers()); |
| 944 EXPECT_TRUE(platformWheelBuilder.hasPreciseScrollingDeltas()); | 944 EXPECT_TRUE(platformWheelBuilder.hasPreciseScrollingDeltas()); |
| 945 EXPECT_TRUE(platformWheelBuilder.canScroll()); | 945 EXPECT_TRUE(platformWheelBuilder.canScroll()); |
| 946 EXPECT_EQ(platformWheelBuilder.getRailsMode(), PlatformEvent::RailsModeH
orizontal); | 946 EXPECT_EQ(platformWheelBuilder.getRailsMode(), PlatformEvent::RailsModeH
orizontal); |
| 947 } | 947 } |
| 948 | 948 |
| 949 { | 949 { |
| 950 WebMouseWheelEvent webMouseWheelEvent; | 950 WebMouseWheelEvent webMouseWheelEvent; |
| 951 webMouseWheelEvent.type = WebInputEvent::MouseWheel; | 951 webMouseWheelEvent.type = WebInputEvent::MouseWheel; |
| 952 webMouseWheelEvent.x = 5; | 952 webMouseWheelEvent.x = 5; |
| 953 webMouseWheelEvent.y = 0; | 953 webMouseWheelEvent.y = 0; |
| 954 webMouseWheelEvent.deltaX = 15; | 954 webMouseWheelEvent.deltaX = 15; |
| 955 webMouseWheelEvent.deltaY = 10; | 955 webMouseWheelEvent.deltaY = 10; |
| 956 webMouseWheelEvent.modifiers = WebInputEvent::ShiftKey; | 956 webMouseWheelEvent.modifiers = WebInputEvent::ShiftKey; |
| 957 webMouseWheelEvent.hasPreciseScrollingDeltas = false; | 957 webMouseWheelEvent.hasPreciseScrollingDeltas = false; |
| 958 webMouseWheelEvent.canScroll = false; | 958 webMouseWheelEvent.canScroll = false; |
| 959 webMouseWheelEvent.railsMode = WebInputEvent::RailsModeFree; | 959 webMouseWheelEvent.railsMode = WebInputEvent::RailsModeFree; |
| 960 | 960 |
| 961 PlatformWheelEventBuilder platformWheelBuilder(view, webMouseWheelEvent)
; | 961 PlatformWheelEventBuilder platformWheelBuilder(view, webMouseWheelEvent)
; |
| 962 EXPECT_EQ(5, platformWheelBuilder.position().x()); | 962 EXPECT_EQ(5, platformWheelBuilder.position().x()); |
| 963 EXPECT_EQ(0, platformWheelBuilder.position().y()); | 963 EXPECT_EQ(0, platformWheelBuilder.position().y()); |
| 964 EXPECT_EQ(15, platformWheelBuilder.deltaX()); | 964 EXPECT_EQ(15, platformWheelBuilder.deltaX()); |
| 965 EXPECT_EQ(10, platformWheelBuilder.deltaY()); | 965 EXPECT_EQ(10, platformWheelBuilder.deltaY()); |
| 966 EXPECT_EQ(PlatformEvent::ShiftKey, platformWheelBuilder.modifiers()); | 966 EXPECT_EQ(PlatformEvent::ShiftKey, platformWheelBuilder.getModifiers()); |
| 967 EXPECT_FALSE(platformWheelBuilder.hasPreciseScrollingDeltas()); | 967 EXPECT_FALSE(platformWheelBuilder.hasPreciseScrollingDeltas()); |
| 968 EXPECT_FALSE(platformWheelBuilder.canScroll()); | 968 EXPECT_FALSE(platformWheelBuilder.canScroll()); |
| 969 EXPECT_EQ(platformWheelBuilder.getRailsMode(), PlatformEvent::RailsModeF
ree); | 969 EXPECT_EQ(platformWheelBuilder.getRailsMode(), PlatformEvent::RailsModeF
ree); |
| 970 } | 970 } |
| 971 | 971 |
| 972 { | 972 { |
| 973 WebMouseWheelEvent webMouseWheelEvent; | 973 WebMouseWheelEvent webMouseWheelEvent; |
| 974 webMouseWheelEvent.type = WebInputEvent::MouseWheel; | 974 webMouseWheelEvent.type = WebInputEvent::MouseWheel; |
| 975 webMouseWheelEvent.x = 5; | 975 webMouseWheelEvent.x = 5; |
| 976 webMouseWheelEvent.y = 0; | 976 webMouseWheelEvent.y = 0; |
| 977 webMouseWheelEvent.deltaX = 15; | 977 webMouseWheelEvent.deltaX = 15; |
| 978 webMouseWheelEvent.deltaY = 10; | 978 webMouseWheelEvent.deltaY = 10; |
| 979 webMouseWheelEvent.modifiers = WebInputEvent::AltKey; | 979 webMouseWheelEvent.modifiers = WebInputEvent::AltKey; |
| 980 webMouseWheelEvent.hasPreciseScrollingDeltas = true; | 980 webMouseWheelEvent.hasPreciseScrollingDeltas = true; |
| 981 webMouseWheelEvent.canScroll = false; | 981 webMouseWheelEvent.canScroll = false; |
| 982 webMouseWheelEvent.railsMode = WebInputEvent::RailsModeVertical; | 982 webMouseWheelEvent.railsMode = WebInputEvent::RailsModeVertical; |
| 983 | 983 |
| 984 PlatformWheelEventBuilder platformWheelBuilder(view, webMouseWheelEvent)
; | 984 PlatformWheelEventBuilder platformWheelBuilder(view, webMouseWheelEvent)
; |
| 985 EXPECT_EQ(5, platformWheelBuilder.position().x()); | 985 EXPECT_EQ(5, platformWheelBuilder.position().x()); |
| 986 EXPECT_EQ(0, platformWheelBuilder.position().y()); | 986 EXPECT_EQ(0, platformWheelBuilder.position().y()); |
| 987 EXPECT_EQ(15, platformWheelBuilder.deltaX()); | 987 EXPECT_EQ(15, platformWheelBuilder.deltaX()); |
| 988 EXPECT_EQ(10, platformWheelBuilder.deltaY()); | 988 EXPECT_EQ(10, platformWheelBuilder.deltaY()); |
| 989 EXPECT_EQ(PlatformEvent::AltKey, platformWheelBuilder.modifiers()); | 989 EXPECT_EQ(PlatformEvent::AltKey, platformWheelBuilder.getModifiers()); |
| 990 EXPECT_TRUE(platformWheelBuilder.hasPreciseScrollingDeltas()); | 990 EXPECT_TRUE(platformWheelBuilder.hasPreciseScrollingDeltas()); |
| 991 EXPECT_FALSE(platformWheelBuilder.canScroll()); | 991 EXPECT_FALSE(platformWheelBuilder.canScroll()); |
| 992 EXPECT_EQ(platformWheelBuilder.getRailsMode(), PlatformEvent::RailsModeV
ertical); | 992 EXPECT_EQ(platformWheelBuilder.getRailsMode(), PlatformEvent::RailsModeV
ertical); |
| 993 } | 993 } |
| 994 } | 994 } |
| 995 | 995 |
| 996 } // namespace blink | 996 } // namespace blink |
| OLD | NEW |