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

Unified Diff: content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc

Issue 2914023002: Remove LatencyInfo::sequence_number. (May break metrics).
Patch Set: Rebase Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc
diff --git a/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc b/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc
index 492319d7a6e91dae2af2186b5f4645a9118b2bdc..e6e9e879008f242c26c478a173363d96520ab3bc 100644
--- a/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc
+++ b/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc
@@ -35,23 +35,23 @@ void AddFakeComponentsWithTimeStamp(
ui::LatencyInfo* latency,
base::TimeTicks time_stamp) {
latency->AddLatencyNumberWithTimestamp(ui::INPUT_EVENT_LATENCY_UI_COMPONENT,
- 0, 0, time_stamp, 1);
+ 0, time_stamp, 1);
latency->AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0, time_stamp,
+ ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, time_stamp,
1);
latency->AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0, time_stamp, 1);
+ ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, time_stamp, 1);
latency->AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, 0, 0, time_stamp, 1);
+ ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, 0, time_stamp, 1);
latency->AddLatencyNumberWithTimestamp(
- ui::DISPLAY_COMPOSITOR_RECEIVED_FRAME_COMPONENT, 0, 0, time_stamp, 1);
+ ui::DISPLAY_COMPOSITOR_RECEIVED_FRAME_COMPONENT, 0, time_stamp, 1);
}
void AddFakeComponents(const RenderWidgetHostLatencyTracker& tracker,
ui::LatencyInfo* latency) {
latency->AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT,
- tracker.latency_component_id(), 0, base::TimeTicks::Now(), 1);
+ tracker.latency_component_id(), base::TimeTicks::Now(), 1);
AddFakeComponentsWithTimeStamp(tracker, latency, base::TimeTicks::Now());
}
@@ -60,12 +60,12 @@ void AddRenderingScheduledComponent(ui::LatencyInfo* latency,
base::TimeTicks time_stamp) {
if (main) {
latency->AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT, 0,
time_stamp, 1);
} else {
latency->AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT, 0,
time_stamp, 1);
}
}
@@ -242,7 +242,7 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, TestWheelToFirstScrollHistograms) {
ui::LatencyInfo wheel_latency(ui::SourceEventType::WHEEL);
wheel_latency.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT,
- tracker()->latency_component_id(), 0, now, 1);
+ tracker()->latency_component_id(), now, 1);
AddFakeComponentsWithTimeStamp(*tracker(), &wheel_latency, now);
AddRenderingScheduledComponent(&wheel_latency, rendering_on_main, now);
tracker()->OnInputEvent(wheel, &wheel_latency);
@@ -342,7 +342,7 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, TestWheelToScrollHistograms) {
ui::LatencyInfo wheel_latency(ui::SourceEventType::WHEEL);
wheel_latency.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT,
- tracker()->latency_component_id(), 0, now, 1);
+ tracker()->latency_component_id(), now, 1);
AddFakeComponentsWithTimeStamp(*tracker(), &wheel_latency, now);
AddRenderingScheduledComponent(&wheel_latency, rendering_on_main, now);
tracker()->OnInputEvent(wheel, &wheel_latency);
@@ -418,7 +418,7 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, TestTouchToFirstScrollHistograms) {
ui::LatencyInfo scroll_latency;
scroll_latency.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT,
- tracker()->latency_component_id(), 0, now, 1);
+ tracker()->latency_component_id(), now, 1);
AddFakeComponentsWithTimeStamp(*tracker(), &scroll_latency, now);
AddRenderingScheduledComponent(&scroll_latency, rendering_on_main, now);
tracker()->OnInputEvent(scroll, &scroll_latency);
@@ -439,7 +439,7 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, TestTouchToFirstScrollHistograms) {
base::TimeTicks now = base::TimeTicks::Now();
touch_latency.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT,
- tracker()->latency_component_id(), 0, now, 1);
+ tracker()->latency_component_id(), now, 1);
AddFakeComponentsWithTimeStamp(*tracker(), &touch_latency, now);
AddRenderingScheduledComponent(&touch_latency, rendering_on_main, now);
tracker()->OnInputEvent(touch, &touch_latency);
@@ -546,7 +546,7 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, TestTouchToScrollHistograms) {
ui::LatencyInfo scroll_latency;
scroll_latency.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT,
- tracker()->latency_component_id(), 0, now, 1);
+ tracker()->latency_component_id(), now, 1);
AddFakeComponentsWithTimeStamp(*tracker(), &scroll_latency, now);
AddRenderingScheduledComponent(&scroll_latency, rendering_on_main, now);
tracker()->OnInputEvent(scroll, &scroll_latency);
@@ -567,7 +567,7 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, TestTouchToScrollHistograms) {
base::TimeTicks now = base::TimeTicks::Now();
touch_latency.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT,
- tracker()->latency_component_id(), 0, now, 1);
+ tracker()->latency_component_id(), now, 1);
AddFakeComponentsWithTimeStamp(*tracker(), &touch_latency, now);
AddRenderingScheduledComponent(&touch_latency, rendering_on_main, now);
tracker()->OnInputEvent(touch, &touch_latency);
@@ -751,7 +751,7 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, ScrollLatency) {
auto scroll_begin = SyntheticWebGestureEventBuilder::BuildScrollBegin(
5, -5, blink::kWebGestureDeviceTouchscreen);
ui::LatencyInfo scroll_latency;
- scroll_latency.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0,
+ scroll_latency.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
0);
tracker()->OnInputEvent(scroll_begin, &scroll_latency);
EXPECT_TRUE(
@@ -764,7 +764,7 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, ScrollLatency) {
auto first_scroll_update = SyntheticWebGestureEventBuilder::BuildScrollUpdate(
5.f, -5.f, 0, blink::kWebGestureDeviceTouchscreen);
scroll_latency = ui::LatencyInfo();
- scroll_latency.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0,
+ scroll_latency.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
0);
tracker()->OnInputEvent(first_scroll_update, &scroll_latency);
EXPECT_TRUE(
@@ -783,7 +783,7 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, ScrollLatency) {
auto scroll_update = SyntheticWebGestureEventBuilder::BuildScrollUpdate(
-5.f, 5.f, 0, blink::kWebGestureDeviceTouchscreen);
scroll_latency = ui::LatencyInfo();
- scroll_latency.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0,
+ scroll_latency.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
0);
tracker()->OnInputEvent(scroll_update, &scroll_latency);
EXPECT_TRUE(
@@ -820,19 +820,19 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, TouchBlockingAndQueueingTime) {
fake_latency.set_source_event_type(ui::SourceEventType::TOUCH);
fake_latency.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
- tracker()->latency_component_id(), 0,
+ tracker()->latency_component_id(),
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(touchstart_timestamps_ms[0]),
1);
fake_latency.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(touchstart_timestamps_ms[1]),
1);
fake_latency.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(touchstart_timestamps_ms[2]),
1);
@@ -867,19 +867,19 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, TouchBlockingAndQueueingTime) {
fake_latency.set_source_event_type(ui::SourceEventType::TOUCH);
fake_latency.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
- tracker()->latency_component_id(), 0,
+ tracker()->latency_component_id(),
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(touchmove_timestamps_ms[0]),
1);
fake_latency.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(touchmove_timestamps_ms[1]),
1);
fake_latency.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(touchmove_timestamps_ms[2]),
1);
@@ -911,19 +911,19 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, TouchBlockingAndQueueingTime) {
fake_latency.set_source_event_type(ui::SourceEventType::TOUCH);
fake_latency.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
- tracker()->latency_component_id(), 0,
+ tracker()->latency_component_id(),
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(touchend_timestamps_ms[0]),
1);
fake_latency.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(touchend_timestamps_ms[1]),
1);
fake_latency.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(touchend_timestamps_ms[2]),
1);
@@ -1014,19 +1014,19 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, KeyBlockingAndQueueingTime) {
fake_latency.set_source_event_type(ui::SourceEventType::KEY_PRESS);
fake_latency.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
- tracker()->latency_component_id(), 0,
+ tracker()->latency_component_id(),
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(event_timestamps_ms[0]),
1);
fake_latency.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(event_timestamps_ms[1]),
1);
fake_latency.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(event_timestamps_ms[2]),
1);
@@ -1070,14 +1070,14 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, KeyUILatency) {
latency_info.set_trace_id(kTraceEventId);
latency_info.set_source_event_type(ui::SourceEventType::KEY_PRESS);
latency_info.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMicroseconds(event_timestamps_microseconds[0]),
1);
latency_info.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
- tracker()->latency_component_id(), 0,
+ tracker()->latency_component_id(),
base::TimeTicks() +
base::TimeDelta::FromMicroseconds(event_timestamps_microseconds[1]),
1);
@@ -1105,13 +1105,13 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, KeyAckedLatency) {
latency_info.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
- tracker()->latency_component_id(), 0,
+ tracker()->latency_component_id(),
base::TimeTicks() +
base::TimeDelta::FromMicroseconds(event_timestamps_microseconds[0]),
1);
latency_info.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMicroseconds(event_timestamps_microseconds[1]),
1);
@@ -1138,26 +1138,26 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, KeyEndToEndLatency) {
latency_info.set_trace_id(kTraceEventId);
latency_info.set_source_event_type(ui::SourceEventType::KEY_PRESS);
latency_info.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMicroseconds(event_timestamps_microseconds[0]),
1);
latency_info.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
- tracker()->latency_component_id(), 0,
+ tracker()->latency_component_id(),
base::TimeTicks() +
base::TimeDelta::FromMicroseconds(event_timestamps_microseconds[0]),
1);
latency_info.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMicroseconds(event_timestamps_microseconds[1]),
1);
latency_info.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMicroseconds(event_timestamps_microseconds[1]),
1);
@@ -1198,19 +1198,19 @@ TEST_F(RenderWidgetHostLatencyTrackerTest,
fake_latency.set_trace_id(kTraceEventId);
fake_latency.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
- tracker()->latency_component_id(), 0,
+ tracker()->latency_component_id(),
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(touchstart_timestamps_ms[0]),
1);
fake_latency.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(touchstart_timestamps_ms[1]),
1);
fake_latency.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0,
base::TimeTicks() +
base::TimeDelta::FromMilliseconds(touchstart_timestamps_ms[2]),
1);
@@ -1269,17 +1269,17 @@ TEST_F(RenderWidgetHostLatencyTrackerTest, WheelDuringMultiFingerTouch) {
fake_latency.set_source_event_type(ui::SourceEventType::TOUCH);
fake_latency.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
- tracker()->latency_component_id(), 0,
+ tracker()->latency_component_id(),
base::TimeTicks() + base::TimeDelta::FromMilliseconds(timestamps_ms[0]),
1);
fake_latency.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0,
base::TimeTicks() + base::TimeDelta::FromMilliseconds(timestamps_ms[1]),
1);
fake_latency.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0, 0,
+ ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0,
base::TimeTicks() + base::TimeDelta::FromMilliseconds(timestamps_ms[2]),
1);

Powered by Google App Engine
This is Rietveld 408576698