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