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

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

Issue 2738813003: Ensure the scheduler always changes from UseCase LOADING to NONE. (Closed)
Patch Set: rename markFirstMeaningfulPaintCandidate to setFirstMeaningfulPaintCandidate. delete errant comment. Created 3 years, 9 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: 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 492362275fb51ef3b2822c301e5ee7ba6512793e..63527abd6e59752c1e253ad66720e9512081ed07 100644
--- a/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp
+++ b/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp
@@ -158,6 +158,23 @@ TEST_F(FirstMeaningfulPaintDetectorTest, FirstMeaningfulPaintCandidate) {
}
TEST_F(FirstMeaningfulPaintDetectorTest,
+ OnlyOneFirstMeaningfulPaintCandidateBeforeNetworkStable) {
+ paintTiming().markFirstContentfulPaint();
+ EXPECT_EQ(paintTiming().firstMeaningfulPaintCandidate(), 0.0);
+ double beforePaint = monotonicallyIncreasingTime();
+ simulateLayoutAndPaint(1);
+ // The first candidate is initially ignored.
+ EXPECT_EQ(paintTiming().firstMeaningfulPaintCandidate(), 0.0);
+ simulateNetworkStable();
+ // The networkStable then promotes the first candidate.
+ EXPECT_GT(paintTiming().firstMeaningfulPaintCandidate(), beforePaint);
+ double candidate = paintTiming().firstMeaningfulPaintCandidate();
+ // The second candidate is then ignored.
+ simulateLayoutAndPaint(10);
+ EXPECT_EQ(paintTiming().firstMeaningfulPaintCandidate(), candidate);
+}
+
+TEST_F(FirstMeaningfulPaintDetectorTest,
NetworkStableBeforeFirstContentfulPaint) {
paintTiming().markFirstPaint();
simulateLayoutAndPaint(1);

Powered by Google App Engine
This is Rietveld 408576698