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

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

Issue 2233543002: Make first TouchStart and first TouchMove events on a flinging layer non-blocking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename Created 4 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/event_with_latency_info.h" 5 #include "content/common/input/event_with_latency_info.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "third_party/WebKit/public/web/WebInputEvent.h" 10 #include "third_party/WebKit/public/web/WebInputEvent.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 touch0.event.touches[0] = touch1.event.touches[1] = 231 touch0.event.touches[0] = touch1.event.touches[1] =
232 CreateTouchPoint(WebTouchPoint::StateMoved, 1); 232 CreateTouchPoint(WebTouchPoint::StateMoved, 1);
233 touch0.event.touches[1] = touch1.event.touches[0] = 233 touch0.event.touches[1] = touch1.event.touches[0] =
234 CreateTouchPoint(WebTouchPoint::StateMoved, 0); 234 CreateTouchPoint(WebTouchPoint::StateMoved, 0);
235 EXPECT_TRUE(CanCoalesce(touch0, touch1)); 235 EXPECT_TRUE(CanCoalesce(touch0, touch1));
236 Coalesce(touch0, &touch1); 236 Coalesce(touch0, &touch1);
237 ASSERT_EQ(WebInputEvent::DispatchType::Blocking, touch1.event.dispatchType); 237 ASSERT_EQ(WebInputEvent::DispatchType::Blocking, touch1.event.dispatchType);
238 238
239 touch0 = CreateTouch(WebInputEvent::TouchMove, 2); 239 touch0 = CreateTouch(WebInputEvent::TouchMove, 2);
240 touch0.event.dispatchType = 240 touch0.event.dispatchType =
241 WebInputEvent::DispatchType::ListenersForcedNonBlockingPassive; 241 WebInputEvent::DispatchType::ListenersForcedNonBlockingDueToFling;
242 touch1 = CreateTouch(WebInputEvent::TouchMove, 2); 242 touch1 = CreateTouch(WebInputEvent::TouchMove, 2);
243 touch1.event.dispatchType = 243 touch1.event.dispatchType =
244 WebInputEvent::DispatchType::ListenersNonBlockingPassive; 244 WebInputEvent::DispatchType::ListenersNonBlockingPassive;
245 touch0.event.touches[0] = touch1.event.touches[1] = 245 touch0.event.touches[0] = touch1.event.touches[1] =
246 CreateTouchPoint(WebTouchPoint::StateMoved, 1); 246 CreateTouchPoint(WebTouchPoint::StateMoved, 1);
247 touch0.event.touches[1] = touch1.event.touches[0] = 247 touch0.event.touches[1] = touch1.event.touches[0] =
248 CreateTouchPoint(WebTouchPoint::StateMoved, 0); 248 CreateTouchPoint(WebTouchPoint::StateMoved, 0);
249 EXPECT_TRUE(CanCoalesce(touch0, touch1)); 249 EXPECT_TRUE(CanCoalesce(touch0, touch1));
250 Coalesce(touch0, &touch1); 250 Coalesce(touch0, &touch1);
251 ASSERT_EQ(WebInputEvent::DispatchType::ListenersNonBlockingPassive, 251 ASSERT_EQ(WebInputEvent::DispatchType::ListenersNonBlockingPassive,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 MouseWheelEventWithLatencyInfo mouse_wheel_1 = CreateMouseWheel(2, 2); 322 MouseWheelEventWithLatencyInfo mouse_wheel_1 = CreateMouseWheel(2, 2);
323 mouse_wheel_1.event.timeStampSeconds = 10.0; 323 mouse_wheel_1.event.timeStampSeconds = 10.0;
324 324
325 EXPECT_TRUE(CanCoalesce(mouse_wheel_0, mouse_wheel_1)); 325 EXPECT_TRUE(CanCoalesce(mouse_wheel_0, mouse_wheel_1));
326 Coalesce(mouse_wheel_1, &mouse_wheel_0); 326 Coalesce(mouse_wheel_1, &mouse_wheel_0);
327 EXPECT_EQ(10.0, mouse_wheel_0.event.timeStampSeconds); 327 EXPECT_EQ(10.0, mouse_wheel_0.event.timeStampSeconds);
328 } 328 }
329 329
330 } // namespace 330 } // namespace
331 } // namespace content 331 } // namespace content
OLDNEW
« no previous file with comments | « content/common/input/event_with_latency_info.cc ('k') | content/renderer/input/main_thread_event_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698