Commit 2023b991 authored by Liquan(Max) Gu's avatar Liquan(Max) Gu Committed by Commit Bot

[FCP++] Fix test flakiness due to time clamping

The test LastTextPaint_ReportFirstPaintTime is flaky because it used
EXPECT_GT for time comparison. This is an issue because time is clamped. We
should use EXPECT_GE instead.

Bug: 885123
Change-Id: I519eeb23dcd9a1376cf91ecdc288fbf6d7b40daa
Reviewed-on: https://chromium-review.googlesource.com/1230436Reviewed-by: default avatarSteve Kobes <skobes@chromium.org>
Commit-Queue: Liquan (Max) Gǔ <maxlg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592073}
parent 8c2d5748
......@@ -97,8 +97,8 @@ TEST_F(TextPaintTimingDetectorTest, LargestTextPaint_ReportFirstPaintTime) {
.FindLargestPaintCandidate();
EXPECT_EQ(record->text, "a long-long-long-long moving text");
TimeTicks firing_time = record->first_paint_time;
EXPECT_GT(firing_time, time1);
EXPECT_GT(time2, firing_time);
EXPECT_GE(firing_time, time1);
EXPECT_GE(time2, firing_time);
}
TEST_F(TextPaintTimingDetectorTest,
......@@ -238,8 +238,8 @@ TEST_F(TextPaintTimingDetectorTest, LastTextPaint_ReportFirstPaintTime) {
GetPaintTracker().GetTextPaintTimingDetector().FindLastPaintCandidate();
EXPECT_EQ(record->text, "latest text");
TimeTicks firing_time = record->first_paint_time;
EXPECT_GT(firing_time, time1);
EXPECT_GT(time2, firing_time);
EXPECT_GE(firing_time, time1);
EXPECT_GE(time2, firing_time);
}
TEST_F(TextPaintTimingDetectorTest, LastTextPaint_IgnoreRemovedText) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment