OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2015 Google Inc. All rights reserved. | 2 * Copyright (C) 2015 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 void registerMockedHttpURLLoad(const std::string& fileName) { | 95 void registerMockedHttpURLLoad(const std::string& fileName) { |
96 URLTestHelpers::registerMockedURLFromBaseURL( | 96 URLTestHelpers::registerMockedURLFromBaseURL( |
97 WebString::fromUTF8(m_baseURL.c_str()), | 97 WebString::fromUTF8(m_baseURL.c_str()), |
98 WebString::fromUTF8(fileName.c_str())); | 98 WebString::fromUTF8(fileName.c_str())); |
99 } | 99 } |
100 | 100 |
101 WebGestureEvent generateEvent(WebInputEvent::Type type, | 101 WebGestureEvent generateEvent(WebInputEvent::Type type, |
102 int deltaX = 0, | 102 int deltaX = 0, |
103 int deltaY = 0) { | 103 int deltaY = 0) { |
104 WebGestureEvent event; | 104 WebGestureEvent event(type, WebInputEvent::NoModifiers, |
105 event.type = type; | 105 WebInputEvent::TimeStampForTesting); |
106 event.sourceDevice = WebGestureDeviceTouchscreen; | 106 event.sourceDevice = WebGestureDeviceTouchscreen; |
107 event.x = 100; | 107 event.x = 100; |
108 event.y = 100; | 108 event.y = 100; |
109 if (type == WebInputEvent::GestureScrollUpdate) { | 109 if (type == WebInputEvent::GestureScrollUpdate) { |
110 event.data.scrollUpdate.deltaX = deltaX; | 110 event.data.scrollUpdate.deltaX = deltaX; |
111 event.data.scrollUpdate.deltaY = deltaY; | 111 event.data.scrollUpdate.deltaY = deltaY; |
112 } | 112 } |
113 return event; | 113 return event; |
114 } | 114 } |
115 | 115 |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 view->setScrollOffset(view->getScrollOffset(), ProgrammaticScroll); | 919 view->setScrollOffset(view->getScrollOffset(), ProgrammaticScroll); |
920 | 920 |
921 ASSERT_EQ(80.f, webView->browserControls().contentOffset()); | 921 ASSERT_EQ(80.f, webView->browserControls().contentOffset()); |
922 EXPECT_EQ(expectedRootOffset, rootViewport->getScrollOffset().height()); | 922 EXPECT_EQ(expectedRootOffset, rootViewport->getScrollOffset().height()); |
923 | 923 |
924 webView->handleInputEvent(generateEvent(WebInputEvent::GestureScrollEnd)); | 924 webView->handleInputEvent(generateEvent(WebInputEvent::GestureScrollEnd)); |
925 } | 925 } |
926 } | 926 } |
927 | 927 |
928 } // namespace blink | 928 } // namespace blink |
OLD | NEW |