Chromium Code Reviews| 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..14c05fb8cd031930d071058cfb90c43188eae52a 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); |
| + 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. |
| + // candidate. |
|
Kunihiko Sakamoto
2017/03/15 01:59:19
Remove this line
Dan Elphick
2017/03/15 09:25:07
Done.
|
| + simulateLayoutAndPaint(10); |
| + EXPECT_EQ(paintTiming().firstMeaningfulPaintCandidate(), candidate); |
| +} |
| + |
| +TEST_F(FirstMeaningfulPaintDetectorTest, |
| NetworkStableBeforeFirstContentfulPaint) { |
| paintTiming().markFirstPaint(); |
| simulateLayoutAndPaint(1); |