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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1124733003: Add test for begin frames when using SingleThreadProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index be879af1384d097e5b7d9ef53ec4ea1603c10248..95f9b753812bba6cdc6715c23cb16fd899087030 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -2776,6 +2776,39 @@ class LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor
MULTI_THREAD_TEST_F(
LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor);
+class LayerTreeHostTestBeginFrameNotificationSynchronousCompositor
+ : public LayerTreeHostTest {
+ protected:
+ void BeginTest() override {
+ saw_will_begin_impl_frame_ = false;
+ PostCompositeImmediatelyToMainThread();
+ }
+
+ void InitializeSettings(LayerTreeSettings* settings) override {
+ settings->using_synchronous_renderer_compositor = true;
+ settings->single_thread_proxy_scheduler = false;
+ }
+
+ void WillBeginImplFrameOnThread(LayerTreeHostImpl* impl,
+ const BeginFrameArgs& args) override {
+ EXPECT_EQ(base::TimeTicks(), args.deadline);
+ EXPECT_EQ(BeginFrameArgs::DefaultInterval(), args.interval);
+ saw_will_begin_impl_frame_ = true;
enne (OOO) 2015/05/04 22:30:27 I guess it was my understanding that it was also t
+ }
+
+ void DidCommitAndDrawFrame() override { EndTest(); }
+
+ void AfterTest() override { EXPECT_TRUE(saw_will_begin_impl_frame_); }
+
+ private:
+ bool saw_will_begin_impl_frame_;
+};
+
+TEST_F(LayerTreeHostTestBeginFrameNotificationSynchronousCompositor,
+ BeginFrameReceived) {
+ RunTest(false, true, true);
+}
+
class LayerTreeHostTestAbortedCommitDoesntStallDisabledVsync
: public LayerTreeHostTestAbortedCommitDoesntStall {
void InitializeSettings(LayerTreeSettings* settings) override {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698