Chromium Code Reviews| Index: cc/layer_tree_host_unittest.cc |
| diff --git a/cc/layer_tree_host_unittest.cc b/cc/layer_tree_host_unittest.cc |
| index 1e1334dfd28af283638bbaa8af466b8416bf87c7..db6f984c47e8346211161adf0b8d6afd68da3aab 100644 |
| --- a/cc/layer_tree_host_unittest.cc |
| +++ b/cc/layer_tree_host_unittest.cc |
| @@ -11,6 +11,7 @@ |
| #include "cc/layer_tree_host_impl.h" |
| #include "cc/layer_tree_impl.h" |
| #include "cc/output_surface.h" |
| +#include "cc/resource_update_queue.h" |
| #include "cc/single_thread_proxy.h" |
| #include "cc/test/fake_content_layer.h" |
| #include "cc/test/fake_content_layer_client.h" |
| @@ -20,8 +21,8 @@ |
| #include "cc/test/fake_scrollbar_layer.h" |
| #include "cc/test/geometry_test_utils.h" |
| #include "cc/test/layer_tree_test_common.h" |
| -#include "cc/resource_update_queue.h" |
| #include "cc/test/occlusion_tracker_test_common.h" |
| +#include "cc/thread_proxy.h" |
| #include "cc/timing_function.h" |
| #include "testing/gmock/include/gmock/gmock.h" |
| #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
| @@ -2250,5 +2251,48 @@ TEST(LayerTreeHostTest, PartialUpdatesWithDelegatingRendererAndSoftwareContent) |
| EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates); |
| } |
| +class LayerTreeHostTestMaxPendingFrames : public LayerTreeHostTest { |
| +public: |
| + LayerTreeHostTestMaxPendingFrames(bool delegatingRenderer) |
| + : LayerTreeHostTest() |
| + , m_delegatingRenderer(delegatingRenderer) |
| + { |
| + } |
| + |
| + virtual scoped_ptr<OutputSurface> createOutputSurface() OVERRIDE |
| + { |
| + if (m_delegatingRenderer) |
| + return FakeOutputSurface::CreateDelegating3d().PassAs<OutputSurface>(); |
| + return FakeOutputSurface::Create3d().PassAs<OutputSurface>(); |
| + } |
| + |
| + virtual void beginTest() OVERRIDE |
| + { |
| + postSetNeedsCommitToMainThread(); |
| + } |
| + |
| + virtual void drawLayersOnThread(LayerTreeHostImpl* hostImpl) OVERRIDE |
| + { |
| + DCHECK(hostImpl->proxy()->hasImplThread()); |
| + |
| + const ThreadProxy* proxy = static_cast<ThreadProxy*>(hostImpl->proxy()); |
| + if (m_delegatingRenderer) |
| + EXPECT_EQ(1, proxy->maxFramesPendingForTesting()); |
| + else |
| + EXPECT_LT(1, proxy->maxFramesPendingForTesting()); |
|
enne (OOO)
2013/01/04 21:42:05
Why does the initialization get skipped and this i
danakj
2013/01/04 21:44:45
No it's 2. 1 < maxFramesPending.
enne (OOO)
2013/01/04 21:56:43
So really:
EXPECT_EQ(FrameRateController::default
danakj
2013/01/04 22:24:07
Done.
|
| + endTest(); |
| + } |
| + |
| + virtual void afterTest() OVERRIDE |
| + { |
| + } |
| + |
| +private: |
| + bool m_delegatingRenderer; |
| +}; |
| + |
| +MULTI_THREAD_TEST_P1(LayerTreeHostTestMaxPendingFrames, DelegatingRenderer, true) |
| +MULTI_THREAD_TEST_P1(LayerTreeHostTestMaxPendingFrames, GLRenderer, false) |
| + |
| } // namespace |
| } // namespace cc |