| 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;
|
|
|