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

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

Issue 134623005: Make SingleThreadProxy a SchedulerClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Post task for ScheduledActionBeginOutputSurfaceCreation Created 6 years, 6 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 | Annotate | Revision Log
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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 num_draws_++; 84 num_draws_++;
85 if (!impl->active_tree()->source_frame_number()) 85 if (!impl->active_tree()->source_frame_number())
86 EndTest(); 86 EndTest();
87 } 87 }
88 88
89 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { 89 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
90 num_commits_++; 90 num_commits_++;
91 } 91 }
92 92
93 virtual void AfterTest() OVERRIDE { 93 virtual void AfterTest() OVERRIDE {
94 EXPECT_GE(1, num_commits_); 94 EXPECT_LE(1, num_commits_);
95 EXPECT_GE(1, num_draws_); 95 EXPECT_LE(1, num_draws_);
96 } 96 }
97 97
98 private: 98 private:
99 int num_commits_; 99 int num_commits_;
100 int num_draws_; 100 int num_draws_;
101 }; 101 };
102 102
103 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsCommit1); 103 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsCommit1);
104 104
105 // A SetNeedsCommit should lead to 1 commit. Issuing a second commit after that 105 // A SetNeedsCommit should lead to 1 commit. Issuing a second commit after that
(...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 virtual void AfterTest() OVERRIDE { 1959 virtual void AfterTest() OVERRIDE {
1960 EXPECT_EQ(1, num_commits_deferred_); 1960 EXPECT_EQ(1, num_commits_deferred_);
1961 EXPECT_EQ(2, num_complete_commits_); 1961 EXPECT_EQ(2, num_complete_commits_);
1962 } 1962 }
1963 1963
1964 private: 1964 private:
1965 int num_commits_deferred_; 1965 int num_commits_deferred_;
1966 int num_complete_commits_; 1966 int num_complete_commits_;
1967 }; 1967 };
1968 1968
1969 MULTI_THREAD_TEST_F(LayerTreeHostTestDeferCommits); 1969 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDeferCommits);
1970 1970
1971 class LayerTreeHostWithProxy : public LayerTreeHost { 1971 class LayerTreeHostWithProxy : public LayerTreeHost {
1972 public: 1972 public:
1973 LayerTreeHostWithProxy(FakeLayerTreeHostClient* client, 1973 LayerTreeHostWithProxy(FakeLayerTreeHostClient* client,
1974 const LayerTreeSettings& settings, 1974 const LayerTreeSettings& settings,
1975 scoped_ptr<FakeProxy> proxy) 1975 scoped_ptr<FakeProxy> proxy)
1976 : LayerTreeHost(client, NULL, settings) { 1976 : LayerTreeHost(client, NULL, settings) {
1977 proxy->SetLayerTreeHost(this); 1977 proxy->SetLayerTreeHost(this);
1978 InitializeForTesting(proxy.PassAs<Proxy>()); 1978 InitializeForTesting(proxy.PassAs<Proxy>());
1979 } 1979 }
(...skipping 2912 matching lines...) Expand 10 before | Expand all | Expand 10 after
4892 const gfx::Size bounds_; 4892 const gfx::Size bounds_;
4893 FakeContentLayerClient client_; 4893 FakeContentLayerClient client_;
4894 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_; 4894 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_;
4895 scoped_refptr<FakePictureLayer> picture_layer_; 4895 scoped_refptr<FakePictureLayer> picture_layer_;
4896 Layer* child_layer_; 4896 Layer* child_layer_;
4897 }; 4897 };
4898 4898
4899 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting); 4899 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting);
4900 4900
4901 } // namespace cc 4901 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698