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

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: Android working 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 2645 matching lines...) Expand 10 before | Expand all | Expand 10 after
4625 } 4625 }
4626 } 4626 }
4627 4627
4628 virtual void AfterTest() OVERRIDE {} 4628 virtual void AfterTest() OVERRIDE {}
4629 4629
4630 FakeContentLayerClient client_; 4630 FakeContentLayerClient client_;
4631 scoped_ptr<FakeScopedUIResource> ui_resource_; 4631 scoped_ptr<FakeScopedUIResource> ui_resource_;
4632 }; 4632 };
4633 4633
4634 // This test is flaky, see http://crbug.com/386199 4634 // This test is flaky, see http://crbug.com/386199
4635 //MULTI_THREAD_TEST_F(LayerTreeHostTestHighResRequiredAfterEvictingUIResources); 4635 // MULTI_THREAD_TEST_F(
enne (OOO) 2014/06/18 21:03:42 This is just a presubmit error introduced by anoth
4636 // LayerTreeHostTestHighResRequiredAfterEvictingUIResources);
4636 4637
4637 class LayerTreeHostTestGpuRasterizationDefault : public LayerTreeHostTest { 4638 class LayerTreeHostTestGpuRasterizationDefault : public LayerTreeHostTest {
4638 protected: 4639 protected:
4639 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { 4640 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
4640 settings->impl_side_painting = true; 4641 settings->impl_side_painting = true;
4641 4642
4642 EXPECT_FALSE(settings->gpu_rasterization_enabled); 4643 EXPECT_FALSE(settings->gpu_rasterization_enabled);
4643 EXPECT_FALSE(settings->gpu_rasterization_forced); 4644 EXPECT_FALSE(settings->gpu_rasterization_forced);
4644 } 4645 }
4645 4646
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
4893 const gfx::Size bounds_; 4894 const gfx::Size bounds_;
4894 FakeContentLayerClient client_; 4895 FakeContentLayerClient client_;
4895 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_; 4896 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_;
4896 scoped_refptr<FakePictureLayer> picture_layer_; 4897 scoped_refptr<FakePictureLayer> picture_layer_;
4897 Layer* child_layer_; 4898 Layer* child_layer_;
4898 }; 4899 };
4899 4900
4900 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting); 4901 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting);
4901 4902
4902 } // namespace cc 4903 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698