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

Side by Side Diff: content/common/input/touch_event_stream_validator_unittest.cc

Issue 788923002: Touch Events - changedTouches list includes non-changed touch points on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed trybots errors. Created 5 years, 11 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/input/touch_event_stream_validator.h" 5 #include "content/common/input/touch_event_stream_validator.h"
6 6
7 #include "content/common/input/synthetic_web_input_event_builders.h" 7 #include "content/common/input/synthetic_web_input_event_builders.h"
8 #include "content/common/input/web_touch_event_traits.h" 8 #include "content/common/input/web_touch_event_traits.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 EXPECT_TRUE(validator.Validate(start, &error_msg)); 152 EXPECT_TRUE(validator.Validate(start, &error_msg));
153 EXPECT_TRUE(error_msg.empty()); 153 EXPECT_TRUE(error_msg.empty());
154 154
155 WebTouchEvent event; 155 WebTouchEvent event;
156 event.touchesLength = 1; 156 event.touchesLength = 1;
157 event.type = kTouchTypes[i]; 157 event.type = kTouchTypes[i];
158 for (size_t j = WebTouchPoint::StateUndefined; 158 for (size_t j = WebTouchPoint::StateUndefined;
159 j <= WebTouchPoint::StateCancelled; 159 j <= WebTouchPoint::StateCancelled;
160 ++j) { 160 ++j) {
161 event.touches[0].state = static_cast<WebTouchPoint::State>(j); 161 event.touches[0].state = static_cast<WebTouchPoint::State>(j);
162 if (event.touches[0].state == kValidTouchPointStatesForType[i]) { 162 if (event.touches[0].state == kValidTouchPointStatesForType[i]
163 // TODO(): Remove this StateStationary workaround check for
jdduke (slow) 2015/01/26 16:18:13 Please make this TODO(jdduke), and at the end refe
USE s.singapati at gmail.com 2015/01/27 14:00:04 Done.
164 // TouchMove after implementing TouchMove events filtering
165 // based on corrected touches state in TouchEventQueue.
166 || (event.type == WebInputEvent::TouchMove
167 && event.touches[0].state == WebTouchPoint::StateStationary)) {
163 EXPECT_TRUE(validator.Validate(event, &error_msg)); 168 EXPECT_TRUE(validator.Validate(event, &error_msg));
164 EXPECT_TRUE(error_msg.empty()); 169 EXPECT_TRUE(error_msg.empty());
165 } else { 170 } else {
166 EXPECT_FALSE(validator.Validate(event, &error_msg)); 171 EXPECT_FALSE(validator.Validate(event, &error_msg));
167 EXPECT_FALSE(error_msg.empty()); 172 EXPECT_FALSE(error_msg.empty());
168 } 173 }
169 } 174 }
170 } 175 }
171 } 176 }
172 177
173 } // namespace content 178 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698