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

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

Issue 2581633002: [FirstMeaningfulPaint] Do not stop observing layouts before FirstContentfulPaint (Closed)
Patch Set: fix&add test 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 780c293978d1bb6da6d43c48d90512f127dea408..b28b460f85ef86d715936af54fdb218d3b279eff 100644
--- a/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp
+++ b/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp
@@ -59,7 +59,7 @@ TEST_F(FirstMeaningfulPaintDetectorTest, NoFirstPaint) {
}
TEST_F(FirstMeaningfulPaintDetectorTest, OneLayout) {
- paintTiming().markFirstPaint();
+ paintTiming().markFirstContentfulPaint();
simulateLayoutAndPaint(1);
double afterPaint = monotonicallyIncreasingTime();
EXPECT_EQ(paintTiming().firstMeaningfulPaint(), 0.0);
@@ -69,7 +69,7 @@ TEST_F(FirstMeaningfulPaintDetectorTest, OneLayout) {
}
TEST_F(FirstMeaningfulPaintDetectorTest, TwoLayoutsSignificantSecond) {
- paintTiming().markFirstPaint();
+ paintTiming().markFirstContentfulPaint();
simulateLayoutAndPaint(1);
double afterLayout1 = monotonicallyIncreasingTime();
simulateLayoutAndPaint(10);
@@ -80,7 +80,7 @@ TEST_F(FirstMeaningfulPaintDetectorTest, TwoLayoutsSignificantSecond) {
}
TEST_F(FirstMeaningfulPaintDetectorTest, TwoLayoutsSignificantFirst) {
- paintTiming().markFirstPaint();
+ paintTiming().markFirstContentfulPaint();
simulateLayoutAndPaint(10);
double afterLayout1 = monotonicallyIncreasingTime();
simulateLayoutAndPaint(1);
@@ -90,7 +90,7 @@ TEST_F(FirstMeaningfulPaintDetectorTest, TwoLayoutsSignificantFirst) {
}
TEST_F(FirstMeaningfulPaintDetectorTest, FirstMeaningfulPaintCandidate) {
- paintTiming().markFirstPaint();
+ paintTiming().markFirstContentfulPaint();
EXPECT_EQ(paintTiming().firstMeaningfulPaintCandidate(), 0.0);
simulateLayoutAndPaint(1);
double afterPaint = monotonicallyIncreasingTime();
@@ -105,4 +105,15 @@ TEST_F(FirstMeaningfulPaintDetectorTest, FirstMeaningfulPaintCandidate) {
EXPECT_EQ(paintTiming().firstMeaningfulPaintCandidate(), candidate);
}
+TEST_F(FirstMeaningfulPaintDetectorTest,
+ NetworkStableBeforeFirstContentfulPaint) {
+ paintTiming().markFirstPaint();
+ simulateLayoutAndPaint(1);
+ simulateNetworkStable();
+ EXPECT_EQ(paintTiming().firstMeaningfulPaint(), 0.0);
+ paintTiming().markFirstContentfulPaint();
+ simulateNetworkStable();
+ EXPECT_NE(paintTiming().firstMeaningfulPaint(), 0.0);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698