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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 723713003: cc: Add SetChildrenNeedBeginFrames() & SendBeginFramesToChildren() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 6 years, 1 month 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/trees/layer_tree_host_client.h ('k') | cc/trees/proxy.h » ('j') | 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 e6c489fe7d43fac1c110ada865689426a89eef4d..b9096937c9b9c32fcbb1e54195be0d4b3004c0cc 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -5221,6 +5221,82 @@ class LayerTreeHostTestContinuousPainting : public LayerTreeHostTest {
MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting);
+class LayerTreeHostTestSendBeginFramesToChildren : public LayerTreeHostTest {
+ public:
+ LayerTreeHostTestSendBeginFramesToChildren()
+ : begin_frame_sent_to_children_(false) {
+ }
+
+ void InitializeSettings(LayerTreeSettings* settings) override {
+ settings->forward_begin_frames_to_children = true;
+ }
+
+ void BeginTest() override {
+ // Kick off the test with a commit.
+ PostSetNeedsCommitToMainThread();
+ }
+
+ void SendBeginFramesToChildren(const BeginFrameArgs& args) override {
+ begin_frame_sent_to_children_ = true;
+ EndTest();
+ }
+
+ void DidBeginMainFrame() override {
+ // Children requested BeginFrames.
+ layer_tree_host()->SetChildrenNeedBeginFrames(true);
+ }
+
+ void AfterTest() override {
+ // Ensure that BeginFrame message is sent to children during parent
+ // scheduler handles its BeginFrame.
+ EXPECT_TRUE(begin_frame_sent_to_children_);
+ }
+
+ private:
+ bool begin_frame_sent_to_children_;
+};
+
+SINGLE_THREAD_TEST_F(LayerTreeHostTestSendBeginFramesToChildren);
+
+class LayerTreeHostTestSendBeginFramesToChildrenWithExternalBFS
+ : public LayerTreeHostTest {
+ public:
+ LayerTreeHostTestSendBeginFramesToChildrenWithExternalBFS()
+ : begin_frame_sent_to_children_(false) {
+ }
+
+ void InitializeSettings(LayerTreeSettings* settings) override {
+ settings->use_external_begin_frame_source = true;
+ settings->forward_begin_frames_to_children = true;
+ }
+
+ void BeginTest() override {
+ // Kick off the test with a commit.
+ PostSetNeedsCommitToMainThread();
+ }
+
+ void SendBeginFramesToChildren(const BeginFrameArgs& args) override {
+ begin_frame_sent_to_children_ = true;
+ EndTest();
+ }
+
+ void DidBeginMainFrame() override {
+ // Children requested BeginFrames.
+ layer_tree_host()->SetChildrenNeedBeginFrames(true);
+ }
+
+ void AfterTest() override {
+ // Ensure that BeginFrame message is sent to children during parent
+ // scheduler handles its BeginFrame.
+ EXPECT_TRUE(begin_frame_sent_to_children_);
+ }
+
+ private:
+ bool begin_frame_sent_to_children_;
+};
+
+SINGLE_THREAD_TEST_F(LayerTreeHostTestSendBeginFramesToChildrenWithExternalBFS);
+
class LayerTreeHostTestActivateOnInvisible : public LayerTreeHostTest {
public:
LayerTreeHostTestActivateOnInvisible()
« no previous file with comments | « cc/trees/layer_tree_host_client.h ('k') | cc/trees/proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698