Chromium Code Reviews| 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; |