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

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1841083007: Remove SendBeginFramesToChildren plumbing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scheduler_output_surface_client_set_beginframesource
Patch Set: Remove some comments Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 4925 matching lines...) Expand 10 before | Expand all | Expand 10 after
4936 std::vector<BeginFrameArgs> impl_frame_args_; 4936 std::vector<BeginFrameArgs> impl_frame_args_;
4937 int will_begin_impl_frame_count_; 4937 int will_begin_impl_frame_count_;
4938 }; 4938 };
4939 4939
4940 // TODO(mithro): Re-enable the multi-threaded version of this test 4940 // TODO(mithro): Re-enable the multi-threaded version of this test
4941 // http://crbug.com/537621 4941 // http://crbug.com/537621
4942 // SINGLE_AND_MULTI_THREAD_TEST_F( 4942 // SINGLE_AND_MULTI_THREAD_TEST_F(
4943 // LayerTreeHostTestBeginMainFrameTimeIsAlsoImplTime); 4943 // LayerTreeHostTestBeginMainFrameTimeIsAlsoImplTime);
4944 SINGLE_THREAD_TEST_F(LayerTreeHostTestBeginMainFrameTimeIsAlsoImplTime); 4944 SINGLE_THREAD_TEST_F(LayerTreeHostTestBeginMainFrameTimeIsAlsoImplTime);
4945 4945
4946 class LayerTreeHostTestSendBeginFramesToChildren : public LayerTreeHostTest {
4947 public:
4948 LayerTreeHostTestSendBeginFramesToChildren()
4949 : begin_frame_sent_to_children_(false) {
4950 }
4951
4952 void BeginTest() override {
4953 // Kick off the test with a commit.
4954 PostSetNeedsCommitToMainThread();
4955 }
4956
4957 void SendBeginFramesToChildren(const BeginFrameArgs& args) override {
4958 begin_frame_sent_to_children_ = true;
4959 EndTest();
4960 }
4961
4962 void DidBeginMainFrame() override {
4963 // Children requested BeginFrames.
4964 layer_tree_host()->SetChildrenNeedBeginFrames(true);
4965 }
4966
4967 void AfterTest() override {
4968 // Ensure that BeginFrame message is sent to children during parent
4969 // scheduler handles its BeginFrame.
4970 EXPECT_TRUE(begin_frame_sent_to_children_);
4971 }
4972
4973 private:
4974 bool begin_frame_sent_to_children_;
4975 };
4976
4977 SINGLE_THREAD_TEST_F(LayerTreeHostTestSendBeginFramesToChildren);
4978
4979 class LayerTreeHostTestSendBeginFramesToChildrenWithExternalBFS
4980 : public LayerTreeHostTest {
4981 public:
4982 LayerTreeHostTestSendBeginFramesToChildrenWithExternalBFS()
4983 : begin_frame_sent_to_children_(false) {
4984 }
4985
4986 void InitializeSettings(LayerTreeSettings* settings) override {
4987 settings->use_external_begin_frame_source = true;
4988 }
4989
4990 void BeginTest() override {
4991 // Kick off the test with a commit.
4992 PostSetNeedsCommitToMainThread();
4993 }
4994
4995 void SendBeginFramesToChildren(const BeginFrameArgs& args) override {
4996 begin_frame_sent_to_children_ = true;
4997 EndTest();
4998 }
4999
5000 void DidBeginMainFrame() override {
5001 // Children requested BeginFrames.
5002 layer_tree_host()->SetChildrenNeedBeginFrames(true);
5003 }
5004
5005 void AfterTest() override {
5006 // Ensure that BeginFrame message is sent to children during parent
5007 // scheduler handles its BeginFrame.
5008 EXPECT_TRUE(begin_frame_sent_to_children_);
5009 }
5010
5011 private:
5012 bool begin_frame_sent_to_children_;
5013 };
5014
5015 SINGLE_THREAD_TEST_F(LayerTreeHostTestSendBeginFramesToChildrenWithExternalBFS);
5016
5017 class LayerTreeHostTestActivateOnInvisible : public LayerTreeHostTest { 4946 class LayerTreeHostTestActivateOnInvisible : public LayerTreeHostTest {
5018 public: 4947 public:
5019 LayerTreeHostTestActivateOnInvisible() 4948 LayerTreeHostTestActivateOnInvisible()
5020 : activation_count_(0), visible_(true) {} 4949 : activation_count_(0), visible_(true) {}
5021 4950
5022 void BeginTest() override { 4951 void BeginTest() override {
5023 // Kick off the test with a commit. 4952 // Kick off the test with a commit.
5024 PostSetNeedsCommitToMainThread(); 4953 PostSetNeedsCommitToMainThread();
5025 } 4954 }
5026 4955
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
6596 EndTest(); 6525 EndTest();
6597 } 6526 }
6598 6527
6599 void AfterTest() override {} 6528 void AfterTest() override {}
6600 }; 6529 };
6601 6530
6602 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); 6531 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
6603 6532
6604 } // namespace 6533 } // namespace
6605 } // namespace cc 6534 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698