| 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 b5ee403534cec10fc0bbb2e4f38c184cdfc8bab9..c46186643984f90df6ab0cd44d4dfd50b6a2fd85 100644
|
| --- a/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp
|
| @@ -107,6 +107,24 @@ TEST_F(FirstMeaningfulPaintDetectorTest, FirstMeaningfulPaintCandidate) {
|
| }
|
|
|
| TEST_F(FirstMeaningfulPaintDetectorTest,
|
| + OnlyOneFirstMeaningfulPaintCandidateBeforeNetworkStable) {
|
| + paintTiming().markFirstContentfulPaint();
|
| + EXPECT_EQ(paintTiming().firstMeaningfulPaintCandidate(), 0.0);
|
| + simulateLayoutAndPaint(1);
|
| + // The first candidate gets ignored.
|
| + EXPECT_EQ(paintTiming().firstMeaningfulPaintCandidate(), 0.0);
|
| + double afterPaint = monotonicallyIncreasingTime();
|
| + simulateNetworkStable();
|
| + // The networkStable even creates a FMP candidate.
|
| + EXPECT_GT(paintTiming().firstMeaningfulPaintCandidate(), afterPaint);
|
| + double candidate = paintTiming().firstMeaningfulPaintCandidate();
|
| + // The second candidate gets ignored since "networkStable" created the second
|
| + // candidate.
|
| + simulateLayoutAndPaint(10);
|
| + EXPECT_EQ(paintTiming().firstMeaningfulPaintCandidate(), candidate);
|
| +}
|
| +
|
| +TEST_F(FirstMeaningfulPaintDetectorTest,
|
| NetworkStableBeforeFirstContentfulPaint) {
|
| paintTiming().markFirstPaint();
|
| simulateLayoutAndPaint(1);
|
|
|