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

Unified Diff: third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp

Issue 2746223003: Enable control over frame time in SimTests (Closed)
Patch Set: assert Created 3 years, 9 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
Index: third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp
diff --git a/third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp b/third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp
index 23a105cd9670e131486ec65b5917a79e8cf10f9a..bb3a8ac2a24b5617c63d68310afa09ac73d69027 100644
--- a/third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp
+++ b/third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp
@@ -80,13 +80,17 @@ void SimCompositor::clearSelection() {
}
SimDisplayItemList SimCompositor::beginFrame() {
+ beginFrame(m_lastFrameTimeMonotonic + 0.016);
+}
+
+SimDisplayItemList SimCompositor::beginFrame(double timeInSeconds) {
DCHECK(m_webViewImpl);
DCHECK(!m_deferCommits);
DCHECK(m_needsBeginFrame);
+ DCHECK_GT(m_lastFrameTimeMonotonic, timeInSeconds);
m_needsBeginFrame = false;
- // Always advance the time as if the compositor was running at 60fps.
- m_lastFrameTimeMonotonic = monotonicallyIncreasingTime() + 0.016;
+ m_lastFrameTimeMonotonic = timeInSeconds;
m_webViewImpl->beginFrame(m_lastFrameTimeMonotonic);
m_webViewImpl->updateAllLifecyclePhases();

Powered by Google App Engine
This is Rietveld 408576698