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

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

Issue 2622283007: Added DCHECK for monotonicTimeToDOMHighResTimeStamp in PerformanceBase (Closed)
Patch Set: added comments for monotonicTimeToDOMHighResTimeStamp in PerformanceBase 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.h » ('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..cc5a52c3dd5de71e30ffdb378921548bc1802583 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,14 @@ class FirstMeaningfulPaintDetectorTest : public testing::Test {
return s_timeElapsed;
}
+ double timeOrigin() {
+ Performance* performance = DOMWindowPerformance::performance(
+ *m_dummyPageHolder->frame().domWindow());
+ 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.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698