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

Unified Diff: third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp

Issue 2397753006: scheduler: Detect load RAIL mode (Closed)
Patch Set: Rebased Created 4 years 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: third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp b/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp
index 3e0540f0e22716d61efe963303b82fa93d6d29f2..780c293978d1bb6da6d43c48d90512f127dea408 100644
--- a/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp
+++ b/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp
@@ -89,4 +89,20 @@ TEST_F(FirstMeaningfulPaintDetectorTest, TwoLayoutsSignificantFirst) {
EXPECT_LT(paintTiming().firstMeaningfulPaint(), afterLayout1);
}
+TEST_F(FirstMeaningfulPaintDetectorTest, FirstMeaningfulPaintCandidate) {
+ paintTiming().markFirstPaint();
+ EXPECT_EQ(paintTiming().firstMeaningfulPaintCandidate(), 0.0);
+ simulateLayoutAndPaint(1);
+ double afterPaint = monotonicallyIncreasingTime();
+ // The first candidate gets ignored.
+ EXPECT_EQ(paintTiming().firstMeaningfulPaintCandidate(), 0.0);
+ simulateLayoutAndPaint(10);
+ // The second candidate gets reported.
+ EXPECT_GT(paintTiming().firstMeaningfulPaintCandidate(), afterPaint);
+ double candidate = paintTiming().firstMeaningfulPaintCandidate();
+ // The third candidate gets ignored since we already saw the first candidate.
+ simulateLayoutAndPaint(10);
+ EXPECT_EQ(paintTiming().firstMeaningfulPaintCandidate(), candidate);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698