| OLD | NEW |
| 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/browser/renderer_host/input/render_widget_host_latency_tracker
.h" | 5 #include "content/browser/renderer_host/input/render_widget_host_latency_tracker
.h" |
| 6 #include "base/metrics/metrics_hashes.h" | 6 #include "base/metrics/metrics_hashes.h" |
| 7 #include "base/test/histogram_tester.h" | 7 #include "base/test/histogram_tester.h" |
| 8 #include "components/metrics/proto/ukm/entry.pb.h" | 8 #include "components/metrics/proto/ukm/entry.pb.h" |
| 9 #include "components/rappor/public/rappor_utils.h" | 9 #include "components/rappor/public/rappor_utils.h" |
| 10 #include "components/rappor/test_rappor_service.h" | 10 #include "components/rappor/test_rappor_service.h" |
| 11 #include "components/ukm/test_ukm_recorder.h" | 11 #include "components/ukm/test_ukm_recorder.h" |
| 12 #include "components/ukm/ukm_source.h" | 12 #include "components/ukm/ukm_source.h" |
| 13 #include "content/common/input/synthetic_web_input_event_builders.h" | 13 #include "content/common/input/synthetic_web_input_event_builders.h" |
| 14 #include "content/public/browser/native_web_keyboard_event.h" | 14 #include "content/public/browser/native_web_keyboard_event.h" |
| 15 #include "content/test/test_content_browser_client.h" | 15 #include "content/test/test_content_browser_client.h" |
| 16 #include "content/test/test_render_view_host.h" | 16 #include "content/test/test_render_view_host.h" |
| 17 #include "content/test/test_web_contents.h" | 17 #include "content/test/test_web_contents.h" |
| 18 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 | 20 |
| 21 using base::Bucket; | 21 using base::Bucket; |
| 22 using blink::WebInputEvent; | 22 using blink::WebInputEvent; |
| 23 using testing::ElementsAre; | 23 using testing::ElementsAre; |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 // Trace ids are generated in sequence in practice, but in these tests, we don't |
| 29 // care about the value, so we'll just use a constant. |
| 30 const int kTraceEventId = 5; |
| 28 const char kUrl[] = "http://www.foo.bar.com/subpage/1"; | 31 const char kUrl[] = "http://www.foo.bar.com/subpage/1"; |
| 29 | 32 |
| 30 void AddFakeComponentsWithTimeStamp( | 33 void AddFakeComponentsWithTimeStamp( |
| 31 const RenderWidgetHostLatencyTracker& tracker, | 34 const RenderWidgetHostLatencyTracker& tracker, |
| 32 ui::LatencyInfo* latency, | 35 ui::LatencyInfo* latency, |
| 33 base::TimeTicks time_stamp) { | 36 base::TimeTicks time_stamp) { |
| 34 latency->AddLatencyNumberWithTimestamp(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, | 37 latency->AddLatencyNumberWithTimestamp(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, |
| 35 0, 0, time_stamp, 1); | 38 0, 0, time_stamp, 1); |
| 36 latency->AddLatencyNumberWithTimestamp( | 39 latency->AddLatencyNumberWithTimestamp( |
| 37 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0, time_stamp, | 40 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0, time_stamp, |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 SyntheticWebTouchEvent event; | 809 SyntheticWebTouchEvent event; |
| 807 { | 810 { |
| 808 // Touch start. | 811 // Touch start. |
| 809 event.PressPoint(1, 1); | 812 event.PressPoint(1, 1); |
| 810 | 813 |
| 811 ui::LatencyInfo latency; | 814 ui::LatencyInfo latency; |
| 812 latency.set_source_event_type(ui::SourceEventType::TOUCH); | 815 latency.set_source_event_type(ui::SourceEventType::TOUCH); |
| 813 tracker()->OnInputEvent(event, &latency); | 816 tracker()->OnInputEvent(event, &latency); |
| 814 | 817 |
| 815 ui::LatencyInfo fake_latency; | 818 ui::LatencyInfo fake_latency; |
| 819 fake_latency.set_trace_id(kTraceEventId); |
| 816 fake_latency.set_source_event_type(ui::SourceEventType::TOUCH); | 820 fake_latency.set_source_event_type(ui::SourceEventType::TOUCH); |
| 817 fake_latency.AddLatencyNumberWithTimestamp( | 821 fake_latency.AddLatencyNumberWithTimestamp( |
| 818 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, | 822 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, |
| 819 tracker()->latency_component_id(), 0, | 823 tracker()->latency_component_id(), 0, |
| 820 base::TimeTicks() + | 824 base::TimeTicks() + |
| 821 base::TimeDelta::FromMilliseconds(touchstart_timestamps_ms[0]), | 825 base::TimeDelta::FromMilliseconds(touchstart_timestamps_ms[0]), |
| 822 1); | 826 1); |
| 823 | 827 |
| 824 fake_latency.AddLatencyNumberWithTimestamp( | 828 fake_latency.AddLatencyNumberWithTimestamp( |
| 825 ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0, | 829 ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 852 | 856 |
| 853 EXPECT_TRUE(latency.FindLatency( | 857 EXPECT_TRUE(latency.FindLatency( |
| 854 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, nullptr)); | 858 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, nullptr)); |
| 855 EXPECT_TRUE( | 859 EXPECT_TRUE( |
| 856 latency.FindLatency(ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, | 860 latency.FindLatency(ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, |
| 857 tracker()->latency_component_id(), nullptr)); | 861 tracker()->latency_component_id(), nullptr)); |
| 858 | 862 |
| 859 EXPECT_EQ(2U, latency.latency_components().size()); | 863 EXPECT_EQ(2U, latency.latency_components().size()); |
| 860 | 864 |
| 861 ui::LatencyInfo fake_latency; | 865 ui::LatencyInfo fake_latency; |
| 866 fake_latency.set_trace_id(kTraceEventId); |
| 862 fake_latency.set_source_event_type(ui::SourceEventType::TOUCH); | 867 fake_latency.set_source_event_type(ui::SourceEventType::TOUCH); |
| 863 fake_latency.AddLatencyNumberWithTimestamp( | 868 fake_latency.AddLatencyNumberWithTimestamp( |
| 864 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, | 869 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, |
| 865 tracker()->latency_component_id(), 0, | 870 tracker()->latency_component_id(), 0, |
| 866 base::TimeTicks() + | 871 base::TimeTicks() + |
| 867 base::TimeDelta::FromMilliseconds(touchmove_timestamps_ms[0]), | 872 base::TimeDelta::FromMilliseconds(touchmove_timestamps_ms[0]), |
| 868 1); | 873 1); |
| 869 | 874 |
| 870 fake_latency.AddLatencyNumberWithTimestamp( | 875 fake_latency.AddLatencyNumberWithTimestamp( |
| 871 ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0, | 876 ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 895 | 900 |
| 896 EXPECT_TRUE(latency.FindLatency( | 901 EXPECT_TRUE(latency.FindLatency( |
| 897 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, nullptr)); | 902 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, nullptr)); |
| 898 EXPECT_TRUE( | 903 EXPECT_TRUE( |
| 899 latency.FindLatency(ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, | 904 latency.FindLatency(ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, |
| 900 tracker()->latency_component_id(), nullptr)); | 905 tracker()->latency_component_id(), nullptr)); |
| 901 | 906 |
| 902 EXPECT_EQ(2U, latency.latency_components().size()); | 907 EXPECT_EQ(2U, latency.latency_components().size()); |
| 903 | 908 |
| 904 ui::LatencyInfo fake_latency; | 909 ui::LatencyInfo fake_latency; |
| 910 fake_latency.set_trace_id(kTraceEventId); |
| 905 fake_latency.set_source_event_type(ui::SourceEventType::TOUCH); | 911 fake_latency.set_source_event_type(ui::SourceEventType::TOUCH); |
| 906 fake_latency.AddLatencyNumberWithTimestamp( | 912 fake_latency.AddLatencyNumberWithTimestamp( |
| 907 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, | 913 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, |
| 908 tracker()->latency_component_id(), 0, | 914 tracker()->latency_component_id(), 0, |
| 909 base::TimeTicks() + | 915 base::TimeTicks() + |
| 910 base::TimeDelta::FromMilliseconds(touchend_timestamps_ms[0]), | 916 base::TimeDelta::FromMilliseconds(touchend_timestamps_ms[0]), |
| 911 1); | 917 1); |
| 912 | 918 |
| 913 fake_latency.AddLatencyNumberWithTimestamp( | 919 fake_latency.AddLatencyNumberWithTimestamp( |
| 914 ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0, | 920 ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 {INPUT_EVENT_ACK_STATE_NOT_CONSUMED, INPUT_EVENT_ACK_STATE_CONSUMED}) { | 1003 {INPUT_EVENT_ACK_STATE_NOT_CONSUMED, INPUT_EVENT_ACK_STATE_CONSUMED}) { |
| 998 { | 1004 { |
| 999 NativeWebKeyboardEvent event(blink::WebKeyboardEvent::kRawKeyDown, | 1005 NativeWebKeyboardEvent event(blink::WebKeyboardEvent::kRawKeyDown, |
| 1000 blink::WebInputEvent::kNoModifiers, | 1006 blink::WebInputEvent::kNoModifiers, |
| 1001 base::TimeTicks::Now()); | 1007 base::TimeTicks::Now()); |
| 1002 ui::LatencyInfo latency_info; | 1008 ui::LatencyInfo latency_info; |
| 1003 latency_info.set_source_event_type(ui::SourceEventType::KEY_PRESS); | 1009 latency_info.set_source_event_type(ui::SourceEventType::KEY_PRESS); |
| 1004 tracker()->OnInputEvent(event, &latency_info); | 1010 tracker()->OnInputEvent(event, &latency_info); |
| 1005 | 1011 |
| 1006 ui::LatencyInfo fake_latency; | 1012 ui::LatencyInfo fake_latency; |
| 1013 fake_latency.set_trace_id(kTraceEventId); |
| 1007 fake_latency.set_source_event_type(ui::SourceEventType::KEY_PRESS); | 1014 fake_latency.set_source_event_type(ui::SourceEventType::KEY_PRESS); |
| 1008 fake_latency.AddLatencyNumberWithTimestamp( | 1015 fake_latency.AddLatencyNumberWithTimestamp( |
| 1009 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, | 1016 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, |
| 1010 tracker()->latency_component_id(), 0, | 1017 tracker()->latency_component_id(), 0, |
| 1011 base::TimeTicks() + | 1018 base::TimeTicks() + |
| 1012 base::TimeDelta::FromMilliseconds(event_timestamps_ms[0]), | 1019 base::TimeDelta::FromMilliseconds(event_timestamps_ms[0]), |
| 1013 1); | 1020 1); |
| 1014 | 1021 |
| 1015 fake_latency.AddLatencyNumberWithTimestamp( | 1022 fake_latency.AddLatencyNumberWithTimestamp( |
| 1016 ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0, | 1023 ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 } | 1060 } |
| 1054 | 1061 |
| 1055 TEST_F(RenderWidgetHostLatencyTrackerTest, KeyUILatency) { | 1062 TEST_F(RenderWidgetHostLatencyTrackerTest, KeyUILatency) { |
| 1056 // These numbers are sensitive to where the histogram buckets are. | 1063 // These numbers are sensitive to where the histogram buckets are. |
| 1057 int event_timestamps_microseconds[] = {100, 185}; | 1064 int event_timestamps_microseconds[] = {100, 185}; |
| 1058 | 1065 |
| 1059 NativeWebKeyboardEvent event(blink::WebKeyboardEvent::kChar, | 1066 NativeWebKeyboardEvent event(blink::WebKeyboardEvent::kChar, |
| 1060 blink::WebInputEvent::kNoModifiers, | 1067 blink::WebInputEvent::kNoModifiers, |
| 1061 base::TimeTicks::Now()); | 1068 base::TimeTicks::Now()); |
| 1062 ui::LatencyInfo latency_info; | 1069 ui::LatencyInfo latency_info; |
| 1070 latency_info.set_trace_id(kTraceEventId); |
| 1063 latency_info.set_source_event_type(ui::SourceEventType::KEY_PRESS); | 1071 latency_info.set_source_event_type(ui::SourceEventType::KEY_PRESS); |
| 1064 latency_info.AddLatencyNumberWithTimestamp( | 1072 latency_info.AddLatencyNumberWithTimestamp( |
| 1065 ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0, | 1073 ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0, |
| 1066 base::TimeTicks() + | 1074 base::TimeTicks() + |
| 1067 base::TimeDelta::FromMicroseconds(event_timestamps_microseconds[0]), | 1075 base::TimeDelta::FromMicroseconds(event_timestamps_microseconds[0]), |
| 1068 1); | 1076 1); |
| 1069 | 1077 |
| 1070 latency_info.AddLatencyNumberWithTimestamp( | 1078 latency_info.AddLatencyNumberWithTimestamp( |
| 1071 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, | 1079 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, |
| 1072 tracker()->latency_component_id(), 0, | 1080 tracker()->latency_component_id(), 0, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1085 } | 1093 } |
| 1086 | 1094 |
| 1087 TEST_F(RenderWidgetHostLatencyTrackerTest, KeyAckedLatency) { | 1095 TEST_F(RenderWidgetHostLatencyTrackerTest, KeyAckedLatency) { |
| 1088 // These numbers are sensitive to where the histogram buckets are. | 1096 // These numbers are sensitive to where the histogram buckets are. |
| 1089 int event_timestamps_microseconds[] = {11, 24}; | 1097 int event_timestamps_microseconds[] = {11, 24}; |
| 1090 | 1098 |
| 1091 NativeWebKeyboardEvent event(blink::WebKeyboardEvent::kRawKeyDown, | 1099 NativeWebKeyboardEvent event(blink::WebKeyboardEvent::kRawKeyDown, |
| 1092 blink::WebInputEvent::kNoModifiers, | 1100 blink::WebInputEvent::kNoModifiers, |
| 1093 base::TimeTicks::Now()); | 1101 base::TimeTicks::Now()); |
| 1094 ui::LatencyInfo latency_info; | 1102 ui::LatencyInfo latency_info; |
| 1103 latency_info.set_trace_id(kTraceEventId); |
| 1095 latency_info.set_source_event_type(ui::SourceEventType::KEY_PRESS); | 1104 latency_info.set_source_event_type(ui::SourceEventType::KEY_PRESS); |
| 1096 | 1105 |
| 1097 latency_info.AddLatencyNumberWithTimestamp( | 1106 latency_info.AddLatencyNumberWithTimestamp( |
| 1098 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, | 1107 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, |
| 1099 tracker()->latency_component_id(), 0, | 1108 tracker()->latency_component_id(), 0, |
| 1100 base::TimeTicks() + | 1109 base::TimeTicks() + |
| 1101 base::TimeDelta::FromMicroseconds(event_timestamps_microseconds[0]), | 1110 base::TimeDelta::FromMicroseconds(event_timestamps_microseconds[0]), |
| 1102 1); | 1111 1); |
| 1103 | 1112 |
| 1104 latency_info.AddLatencyNumberWithTimestamp( | 1113 latency_info.AddLatencyNumberWithTimestamp( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1119 ElementsAre(Bucket( | 1128 ElementsAre(Bucket( |
| 1120 event_timestamps_microseconds[1] - event_timestamps_microseconds[0], | 1129 event_timestamps_microseconds[1] - event_timestamps_microseconds[0], |
| 1121 1))); | 1130 1))); |
| 1122 } | 1131 } |
| 1123 | 1132 |
| 1124 TEST_F(RenderWidgetHostLatencyTrackerTest, KeyEndToEndLatency) { | 1133 TEST_F(RenderWidgetHostLatencyTrackerTest, KeyEndToEndLatency) { |
| 1125 // These numbers are sensitive to where the histogram buckets are. | 1134 // These numbers are sensitive to where the histogram buckets are. |
| 1126 int event_timestamps_microseconds[] = {11, 24}; | 1135 int event_timestamps_microseconds[] = {11, 24}; |
| 1127 | 1136 |
| 1128 ui::LatencyInfo latency_info; | 1137 ui::LatencyInfo latency_info; |
| 1138 latency_info.set_trace_id(kTraceEventId); |
| 1129 latency_info.set_source_event_type(ui::SourceEventType::KEY_PRESS); | 1139 latency_info.set_source_event_type(ui::SourceEventType::KEY_PRESS); |
| 1130 latency_info.AddLatencyNumberWithTimestamp( | 1140 latency_info.AddLatencyNumberWithTimestamp( |
| 1131 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, 0, | 1141 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, 0, |
| 1132 base::TimeTicks() + | 1142 base::TimeTicks() + |
| 1133 base::TimeDelta::FromMicroseconds(event_timestamps_microseconds[0]), | 1143 base::TimeDelta::FromMicroseconds(event_timestamps_microseconds[0]), |
| 1134 1); | 1144 1); |
| 1135 | 1145 |
| 1136 latency_info.AddLatencyNumberWithTimestamp( | 1146 latency_info.AddLatencyNumberWithTimestamp( |
| 1137 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, | 1147 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, |
| 1138 tracker()->latency_component_id(), 0, | 1148 tracker()->latency_component_id(), 0, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1178 | 1188 |
| 1179 { | 1189 { |
| 1180 // Additional touch start will be ignored for queueing and blocking time | 1190 // Additional touch start will be ignored for queueing and blocking time |
| 1181 // metrics. | 1191 // metrics. |
| 1182 int touchstart_timestamps_ms[] = {11, 25, 35}; | 1192 int touchstart_timestamps_ms[] = {11, 25, 35}; |
| 1183 ui::LatencyInfo latency; | 1193 ui::LatencyInfo latency; |
| 1184 event.PressPoint(1, 1); | 1194 event.PressPoint(1, 1); |
| 1185 tracker()->OnInputEvent(event, &latency); | 1195 tracker()->OnInputEvent(event, &latency); |
| 1186 | 1196 |
| 1187 ui::LatencyInfo fake_latency; | 1197 ui::LatencyInfo fake_latency; |
| 1198 fake_latency.set_trace_id(kTraceEventId); |
| 1188 fake_latency.AddLatencyNumberWithTimestamp( | 1199 fake_latency.AddLatencyNumberWithTimestamp( |
| 1189 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, | 1200 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, |
| 1190 tracker()->latency_component_id(), 0, | 1201 tracker()->latency_component_id(), 0, |
| 1191 base::TimeTicks() + | 1202 base::TimeTicks() + |
| 1192 base::TimeDelta::FromMilliseconds(touchstart_timestamps_ms[0]), | 1203 base::TimeDelta::FromMilliseconds(touchstart_timestamps_ms[0]), |
| 1193 1); | 1204 1); |
| 1194 | 1205 |
| 1195 fake_latency.AddLatencyNumberWithTimestamp( | 1206 fake_latency.AddLatencyNumberWithTimestamp( |
| 1196 ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0, | 1207 ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0, |
| 1197 base::TimeTicks() + | 1208 base::TimeTicks() + |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 // Wheel event. | 1258 // Wheel event. |
| 1248 ui::LatencyInfo latency; | 1259 ui::LatencyInfo latency; |
| 1249 latency.set_source_event_type(ui::SourceEventType::WHEEL); | 1260 latency.set_source_event_type(ui::SourceEventType::WHEEL); |
| 1250 // These numbers are sensitive to where the histogram buckets are. | 1261 // These numbers are sensitive to where the histogram buckets are. |
| 1251 int timestamps_ms[] = {11, 25, 35}; | 1262 int timestamps_ms[] = {11, 25, 35}; |
| 1252 auto wheel_event = SyntheticWebMouseWheelEventBuilder::Build( | 1263 auto wheel_event = SyntheticWebMouseWheelEventBuilder::Build( |
| 1253 blink::WebMouseWheelEvent::kPhaseChanged); | 1264 blink::WebMouseWheelEvent::kPhaseChanged); |
| 1254 tracker()->OnInputEvent(touch_event, &latency); | 1265 tracker()->OnInputEvent(touch_event, &latency); |
| 1255 | 1266 |
| 1256 ui::LatencyInfo fake_latency; | 1267 ui::LatencyInfo fake_latency; |
| 1268 fake_latency.set_trace_id(kTraceEventId); |
| 1257 fake_latency.set_source_event_type(ui::SourceEventType::TOUCH); | 1269 fake_latency.set_source_event_type(ui::SourceEventType::TOUCH); |
| 1258 fake_latency.AddLatencyNumberWithTimestamp( | 1270 fake_latency.AddLatencyNumberWithTimestamp( |
| 1259 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, | 1271 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, |
| 1260 tracker()->latency_component_id(), 0, | 1272 tracker()->latency_component_id(), 0, |
| 1261 base::TimeTicks() + base::TimeDelta::FromMilliseconds(timestamps_ms[0]), | 1273 base::TimeTicks() + base::TimeDelta::FromMilliseconds(timestamps_ms[0]), |
| 1262 1); | 1274 1); |
| 1263 | 1275 |
| 1264 fake_latency.AddLatencyNumberWithTimestamp( | 1276 fake_latency.AddLatencyNumberWithTimestamp( |
| 1265 ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0, | 1277 ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0, |
| 1266 base::TimeTicks() + base::TimeDelta::FromMilliseconds(timestamps_ms[1]), | 1278 base::TimeTicks() + base::TimeDelta::FromMilliseconds(timestamps_ms[1]), |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1279 | 1291 |
| 1280 tracker()->OnInputEventAck(wheel_event, &latency, ack_state); | 1292 tracker()->OnInputEventAck(wheel_event, &latency, ack_state); |
| 1281 } | 1293 } |
| 1282 | 1294 |
| 1283 EXPECT_THAT(histogram_tester().GetAllSamples( | 1295 EXPECT_THAT(histogram_tester().GetAllSamples( |
| 1284 "Event.Latency.QueueingTime.MouseWheelDefaultAllowed"), | 1296 "Event.Latency.QueueingTime.MouseWheelDefaultAllowed"), |
| 1285 ElementsAre(Bucket(14, 1))); | 1297 ElementsAre(Bucket(14, 1))); |
| 1286 } | 1298 } |
| 1287 | 1299 |
| 1288 } // namespace content | 1300 } // namespace content |
| OLD | NEW |