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

Unified Diff: cc/test/fake_layer_tree_host_impl.cc

Issue 444053004: cc: Prevent unit tests from using Now() as the impl frame time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « cc/layers/picture_layer_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_layer_tree_host_impl.cc
diff --git a/cc/test/fake_layer_tree_host_impl.cc b/cc/test/fake_layer_tree_host_impl.cc
index 7361794e7b1aa707018c8fe3a0f6214f5863ada6..84f75e0016a60efa06fb2da30bcc4658137b0c37 100644
--- a/cc/test/fake_layer_tree_host_impl.cc
+++ b/cc/test/fake_layer_tree_host_impl.cc
@@ -19,6 +19,10 @@ FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(Proxy* proxy,
// Explicitly clear all debug settings.
SetDebugState(LayerTreeDebugState());
SetViewportSize(gfx::Size(100, 100));
+
+ // Avoid using Now() as the frame time in unit tests.
enne (OOO) 2014/08/06 23:49:38 Random thought: is this something we could/should
danakj 2014/08/07 03:36:11 Well. Its not the tests doing Now() explicitly. It
+ base::TimeTicks time_ticks = base::TimeTicks::FromInternalValue(1);
+ SetCurrentFrameTimeTicks(time_ticks);
}
FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings& settings,
@@ -32,6 +36,10 @@ FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(const LayerTreeSettings& settings,
0) {
// Explicitly clear all debug settings.
SetDebugState(LayerTreeDebugState());
+
+ // Avoid using Now() as the frame time in unit tests.
+ base::TimeTicks time_ticks = base::TimeTicks::FromInternalValue(1);
+ SetCurrentFrameTimeTicks(time_ticks);
}
FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {}
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698