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

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

Issue 2622283007: Added DCHECK for monotonicTimeToDOMHighResTimeStamp in PerformanceBase (Closed)
Patch Set: keep mockTime and set s_timeElapsed as timeOrigin Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/timing/PerformanceBase.cpp » ('j') | 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 b28b460f85ef86d715936af54fdb218d3b279eff..9a53ae4ff4ae7d97827899856070af9a3d628ff9 100644
--- a/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp
+++ b/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp
@@ -6,6 +6,8 @@
#include "core/paint/PaintTiming.h"
#include "core/testing/DummyPageHolder.h"
+#include "core/timing/DOMWindowPerformance.h"
+#include "core/timing/Performance.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
@@ -14,7 +16,7 @@ class FirstMeaningfulPaintDetectorTest : public testing::Test {
protected:
void SetUp() override {
m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
- s_timeElapsed = 0.0;
+ s_timeElapsed = timeOrigin();
m_originalTimeFunction = setTimeFunctionsForTesting(returnMockTime);
}
@@ -24,6 +26,7 @@ class FirstMeaningfulPaintDetectorTest : public testing::Test {
Document& document() { return m_dummyPageHolder->document(); }
PaintTiming& paintTiming() { return PaintTiming::from(document()); }
+
FirstMeaningfulPaintDetector& detector() {
return paintTiming().firstMeaningfulPaintDetector();
}
@@ -45,6 +48,13 @@ class FirstMeaningfulPaintDetectorTest : public testing::Test {
return s_timeElapsed;
}
+ double timeOrigin() {
panicker 2017/01/13 19:11:59 Update CL description mentioning why this file is
sunjian 2017/01/13 19:49:33 Done.
+ Performance* performance = DOMWindowPerformance::performance(*m_dummyPageHolder->frame().domWindow());
panicker 2017/01/13 19:11:59 Nit: did you run git cl format?
sunjian 2017/01/13 19:49:33 Done.
+ if (!performance)
+ return 0.0;
+ return performance->timeOrigin();
+ }
+
std::unique_ptr<DummyPageHolder> m_dummyPageHolder;
TimeFunction m_originalTimeFunction;
static double s_timeElapsed;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/timing/PerformanceBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698