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

Side by Side Diff: third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp

Issue 2710623002: Enforce FirstContentfulPaint <= FirstMeaningfulPaint (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/FirstMeaningfulPaintDetector.h" 5 #include "core/paint/FirstMeaningfulPaintDetector.h"
6 6
7 #include "core/paint/PaintTiming.h" 7 #include "core/paint/PaintTiming.h"
8 #include "core/testing/DummyPageHolder.h" 8 #include "core/testing/DummyPageHolder.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 NetworkStableBeforeFirstContentfulPaint) { 109 NetworkStableBeforeFirstContentfulPaint) {
110 paintTiming().markFirstPaint(); 110 paintTiming().markFirstPaint();
111 simulateLayoutAndPaint(1); 111 simulateLayoutAndPaint(1);
112 simulateNetworkStable(); 112 simulateNetworkStable();
113 EXPECT_EQ(paintTiming().firstMeaningfulPaint(), 0.0); 113 EXPECT_EQ(paintTiming().firstMeaningfulPaint(), 0.0);
114 paintTiming().markFirstContentfulPaint(); 114 paintTiming().markFirstContentfulPaint();
115 simulateNetworkStable(); 115 simulateNetworkStable();
116 EXPECT_NE(paintTiming().firstMeaningfulPaint(), 0.0); 116 EXPECT_NE(paintTiming().firstMeaningfulPaint(), 0.0);
117 } 117 }
118 118
119 TEST_F(FirstMeaningfulPaintDetectorTest,
120 FirstMeaningfulPaintShouldNotBeBeforeFirstContentfulPaint) {
121 paintTiming().markFirstPaint();
122 simulateLayoutAndPaint(10);
123 paintTiming().markFirstContentfulPaint();
124 simulateNetworkStable();
125 EXPECT_GE(paintTiming().firstMeaningfulPaint(),
126 paintTiming().firstContentfulPaint());
127 }
128
119 } // namespace blink 129 } // namespace blink
OLDNEW
« 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