Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(403)

Side by Side Diff: third_party/WebKit/Source/web/tests/TopControlsTest.cpp

Issue 1403893003: Plumb gesture source value through Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add GestureEventStreamValidator source device compatibility check. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 = WebGestureDeviceTouchpad;
Rick Byers 2015/10/19 18:20:29 top controls test should presumably be primarily a
wjmaclean 2015/10/19 18:58:49 Done.
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698