#include "components/input/event_with_latency_info.h"
#include <limits>
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/input/web_input_event.h"
WebGestureEvent;
WebInputEvent;
WebMouseEvent;
WebMouseWheelEvent;
WebTouchEvent;
WebTouchPoint;
numeric_limits;
namespace input {
namespace {
EventWithLatencyInfoTest;
TouchEventWithLatencyInfo CreateTouchEvent(WebInputEvent::Type type,
double timestamp,
unsigned touch_count = 1) { … }
MouseEventWithLatencyInfo CreateMouseEvent(WebInputEvent::Type type,
double timestamp) { … }
MouseWheelEventWithLatencyInfo CreateMouseWheelEvent(
double timestamp,
float deltaX = 0.0f,
float deltaY = 0.0f,
int modifiers = WebInputEvent::kNoModifiers) { … }
GestureEventWithLatencyInfo CreateGestureEvent(WebInputEvent::Type type,
double timestamp,
float x = 0.0f,
float y = 0.0f) { … }
TEST_F(EventWithLatencyInfoTest, TimestampCoalescingForMouseEvent) { … }
TEST_F(EventWithLatencyInfoTest, TimestampCoalescingForMouseWheelEvent) { … }
TEST_F(EventWithLatencyInfoTest, TimestampCoalescingForTouchEvent) { … }
TEST_F(EventWithLatencyInfoTest, TimestampCoalescingForGestureEvent) { … }
TEST_F(EventWithLatencyInfoTest, LatencyInfoCoalescing) { … }
WebTouchPoint CreateTouchPoint(WebTouchPoint::State state, int id) { … }
TouchEventWithLatencyInfo CreateTouch(WebInputEvent::Type type,
unsigned touch_count = 1) { … }
GestureEventWithLatencyInfo CreateGesture(WebInputEvent::Type type,
float x,
float y) { … }
MouseWheelEventWithLatencyInfo CreateMouseWheel(float deltaX, float deltaY) { … }
template <class T>
bool CanCoalesce(const T& event_to_coalesce, const T& event) { … }
template <class T>
void Coalesce(const T& event_to_coalesce, T* event) { … }
TEST_F(EventWithLatencyInfoTest, TouchEventCoalescing) { … }
TEST_F(EventWithLatencyInfoTest, PinchEventCoalescing) { … }
TEST_F(EventWithLatencyInfoTest, WebMouseWheelEventCoalescing) { … }
TEST_F(EventWithLatencyInfoTest, TimestampCoalescing) { … }
}
}