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

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

Issue 15836005: cc: Emulate BeginFrame in OutputSurfaces that don't support it natively (Closed) Base URL: http://git.chromium.org/chromium/src.git@nofrc
Patch Set: Ignore last patch set: bad upload. Created 7 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
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/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "cc/animation/timing_function.h" 10 #include "cc/animation/timing_function.h"
(...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after
2051 public: 2051 public:
2052 LayerTreeHostTestMaxPendingFrames() : LayerTreeHostTest() {} 2052 LayerTreeHostTestMaxPendingFrames() : LayerTreeHostTest() {}
2053 2053
2054 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } 2054 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
2055 2055
2056 virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { 2056 virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
2057 DCHECK(host_impl->proxy()->HasImplThread()); 2057 DCHECK(host_impl->proxy()->HasImplThread());
2058 2058
2059 const ThreadProxy* proxy = static_cast<ThreadProxy*>(host_impl->proxy()); 2059 const ThreadProxy* proxy = static_cast<ThreadProxy*>(host_impl->proxy());
2060 if (delegating_renderer()) { 2060 if (delegating_renderer()) {
2061 EXPECT_EQ(1, proxy->MaxFramesPendingForTesting()); 2061 EXPECT_EQ(1, proxy->MaxSwapsPendingForTesting());
2062 } else { 2062 } else {
2063 EXPECT_EQ(FrameRateController::DEFAULT_MAX_FRAMES_PENDING, 2063 EXPECT_EQ(FrameRateController::DEFAULT_MAX_FRAMES_PENDING,
2064 proxy->MaxFramesPendingForTesting()); 2064 proxy->MaxSwapsPendingForTesting());
2065 } 2065 }
2066 EndTest(); 2066 EndTest();
2067 } 2067 }
2068 2068
2069 virtual void AfterTest() OVERRIDE {} 2069 virtual void AfterTest() OVERRIDE {}
2070 }; 2070 };
2071 2071
2072 TEST_F(LayerTreeHostTestMaxPendingFrames, DelegatingRenderer) { 2072 TEST_F(LayerTreeHostTestMaxPendingFrames, DelegatingRenderer) {
2073 RunTest(true, true, true); 2073 RunTest(true, true, true);
2074 } 2074 }
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
2817 case 3: 2817 case 3:
2818 // Round 5 done. 2818 // Round 5 done.
2819 EXPECT_EQ(5, commit); 2819 EXPECT_EQ(5, commit);
2820 EndTest(); 2820 EndTest();
2821 break; 2821 break;
2822 } 2822 }
2823 } 2823 }
2824 2824
2825 virtual void SwapBuffersCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { 2825 virtual void SwapBuffersCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
2826 const ThreadProxy* proxy = static_cast<ThreadProxy*>(impl->proxy()); 2826 const ThreadProxy* proxy = static_cast<ThreadProxy*>(impl->proxy());
2827 EXPECT_EQ(0, proxy->NumFramesPendingForTesting()); 2827 EXPECT_EQ(0, proxy->NumSwapsPendingForTesting());
2828 } 2828 }
2829 2829
2830 virtual void AfterTest() OVERRIDE {} 2830 virtual void AfterTest() OVERRIDE {}
2831 2831
2832 protected: 2832 protected:
2833 int frame_; 2833 int frame_;
2834 }; 2834 };
2835 2835
2836 TEST_F(LayerTreeHostTestNumFramesPending, DelegatingRenderer) { 2836 TEST_F(LayerTreeHostTestNumFramesPending, DelegatingRenderer) {
2837 RunTest(true, true, true); 2837 RunTest(true, true, true);
2838 } 2838 }
2839 2839
2840 TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) { 2840 TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) {
2841 RunTest(true, false, true); 2841 RunTest(true, false, true);
2842 } 2842 }
2843 2843
2844 } // namespace 2844 } // namespace
2845 } // namespace cc 2845 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698