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

Unified Diff: ui/latency/latency_info_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: ui/latency/latency_info_unittest.cc
diff --git a/ui/latency/latency_info_unittest.cc b/ui/latency/latency_info_unittest.cc
index 16e4abd3681b91882e7b8cadc1f438b453a8d843..43f4b3c14a5908415afb0055e0b39478c7da4c12 100644
--- a/ui/latency/latency_info_unittest.cc
+++ b/ui/latency/latency_info_unittest.cc
@@ -16,13 +16,11 @@ TEST(LatencyInfoTest, AddTwoSeparateEvent) {
EXPECT_FALSE(info.began());
info.AddLatencyNumberWithTimestamp(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
0,
- 1,
base::TimeTicks::FromInternalValue(100),
1);
EXPECT_TRUE(info.began());
info.AddLatencyNumberWithTimestamp(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
1,
- 5,
base::TimeTicks::FromInternalValue(1000),
2);
@@ -34,12 +32,10 @@ TEST(LatencyInfoTest, AddTwoSeparateEvent) {
info.FindLatency(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 1, &component));
EXPECT_TRUE(
info.FindLatency(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 0, &component));
- EXPECT_EQ(component.sequence_number, 1);
EXPECT_EQ(component.event_count, 1u);
EXPECT_EQ(component.event_time.ToInternalValue(), 100);
EXPECT_TRUE(
info.FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 1, &component));
- EXPECT_EQ(component.sequence_number, 5);
EXPECT_EQ(component.event_count, 2u);
EXPECT_EQ(component.event_time.ToInternalValue(), 1000);
}
@@ -49,12 +45,10 @@ TEST(LatencyInfoTest, AddTwoSameEvent) {
info.set_trace_id(1);
info.AddLatencyNumberWithTimestamp(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
0,
- 30,
base::TimeTicks::FromInternalValue(100),
2);
info.AddLatencyNumberWithTimestamp(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
0,
- 13,
base::TimeTicks::FromInternalValue(200),
3);
@@ -66,7 +60,6 @@ TEST(LatencyInfoTest, AddTwoSameEvent) {
info.FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 1, &component));
EXPECT_TRUE(
info.FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, &component));
- EXPECT_EQ(component.sequence_number, 30);
EXPECT_EQ(component.event_count, 5u);
EXPECT_EQ(component.event_time.ToInternalValue(), (100 * 2 + 200 * 3) / 5);
}
@@ -74,15 +67,17 @@ TEST(LatencyInfoTest, AddTwoSameEvent) {
TEST(LatencyInfoTest, RemoveLatency) {
LatencyInfo info;
info.set_trace_id(1);
- info.AddLatencyNumber(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, 0);
- info.AddLatencyNumber(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 1, 0);
- info.AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
+ info.AddLatencyNumber(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0);
+ info.AddLatencyNumber(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 1);
+ info.AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0);
info.RemoveLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT);
- EXPECT_FALSE(info.FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, 0));
- EXPECT_FALSE(info.FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 1, 0));
- EXPECT_TRUE(info.FindLatency(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0));
+ EXPECT_FALSE(
+ info.FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, nullptr));
+ EXPECT_FALSE(
+ info.FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, nullptr));
+ EXPECT_TRUE(info.FindLatency(INPUT_EVENT_LATENCY_UI_COMPONENT, nullptr));
}
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698