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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 void registerMockedHttpURLLoad(const std::string& fileName) | 90 void registerMockedHttpURLLoad(const std::string& fileName) |
91 { | 91 { |
92 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseU
RL.c_str()), WebString::fromUTF8(fileName.c_str())); | 92 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseU
RL.c_str()), WebString::fromUTF8(fileName.c_str())); |
93 } | 93 } |
94 | 94 |
95 WebGestureEvent generateEvent(WebInputEvent::Type type, int deltaX = 0, int
deltaY = 0) | 95 WebGestureEvent generateEvent(WebInputEvent::Type type, int deltaX = 0, int
deltaY = 0) |
96 { | 96 { |
97 WebGestureEvent event; | 97 WebGestureEvent event; |
98 event.type = type; | 98 event.type = type; |
| 99 event.sourceDevice = WebGestureDeviceTouchscreen; |
99 event.x = 100; | 100 event.x = 100; |
100 event.y = 100; | 101 event.y = 100; |
101 if (type == WebInputEvent::GestureScrollUpdate) { | 102 if (type == WebInputEvent::GestureScrollUpdate) { |
102 event.data.scrollUpdate.deltaX = deltaX; | 103 event.data.scrollUpdate.deltaX = deltaX; |
103 event.data.scrollUpdate.deltaY = deltaY; | 104 event.data.scrollUpdate.deltaY = deltaY; |
104 } | 105 } |
105 return event; | 106 return event; |
106 } | 107 } |
107 | 108 |
108 void verticalScroll(float deltaY) | 109 void verticalScroll(float deltaY) |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 verticalScroll(50.f); | 545 verticalScroll(50.f); |
545 EXPECT_FLOAT_EQ(50, webView->topControls().contentOffset()); | 546 EXPECT_FLOAT_EQ(50, webView->topControls().contentOffset()); |
546 EXPECT_POINT_EQ(IntPoint(0, 90), frame()->view()->scrollPosition()); | 547 EXPECT_POINT_EQ(IntPoint(0, 90), frame()->view()->scrollPosition()); |
547 | 548 |
548 verticalScroll(-50.f); | 549 verticalScroll(-50.f); |
549 EXPECT_FLOAT_EQ(0, webView->topControls().contentOffset()); | 550 EXPECT_FLOAT_EQ(0, webView->topControls().contentOffset()); |
550 EXPECT_POINT_EQ(IntPoint(0, 90), frame()->view()->scrollPosition()); | 551 EXPECT_POINT_EQ(IntPoint(0, 90), frame()->view()->scrollPosition()); |
551 } | 552 } |
552 | 553 |
553 } // namespace blink | 554 } // namespace blink |
OLD | NEW |