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

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

Issue 14772021: cc::OutputSurfaceClient::InitializeForGL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do not drop resources since coming from resourceless software mode 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 | 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/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "cc/animation/timing_function.h" 10 #include "cc/animation/timing_function.h"
(...skipping 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after
2871 }; 2871 };
2872 2872
2873 TEST_F(LayerTreeHostTestNumFramesPending, DelegatingRenderer) { 2873 TEST_F(LayerTreeHostTestNumFramesPending, DelegatingRenderer) {
2874 RunTest(true, true, true); 2874 RunTest(true, true, true);
2875 } 2875 }
2876 2876
2877 TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) { 2877 TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) {
2878 RunTest(true, false, true); 2878 RunTest(true, false, true);
2879 } 2879 }
2880 2880
2881 class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
2882 public:
2883 virtual void BeginTest() OVERRIDE {
2884 layer_tree_host()->SetNeedsRedraw();
danakj 2013/06/05 21:53:32 normally we PostSetNeedsCommitToMainThread() here
2885 }
2886
2887 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE {
2888 return FakeOutputSurface::CreateDeferredGL(
2889 scoped_ptr<WebKit::WebGraphicsContext3D>(
2890 TestWebGraphicsContext3D::Create(
danakj 2013/06/05 21:53:32 nit: You could just use Create() instead of making
2891 WebKit::WebGraphicsContext3D::Attributes())),
2892 scoped_ptr<SoftwareOutputDevice>(new SoftwareOutputDevice))
2893 .PassAs<OutputSurface>();
2894 }
2895
2896 virtual void InitializedRendererOnThread(LayerTreeHostImpl* host_impl,
2897 bool success) OVERRIDE {
2898 EXPECT_TRUE(success);
2899 EXPECT_TRUE(
2900 host_impl->DeferredInitialize(scoped_refptr<ContextProvider>()));
danakj 2013/06/05 21:53:32 Maybe it would be worth testing that we actually d
2901
2902 PostSetNeedsCommitToMainThread();
2903 }
2904
2905 virtual void DidCommitAndDrawFrame() OVERRIDE {
2906 EndTest();
2907 }
2908
2909 virtual void AfterTest() OVERRIDE {}
2910 };
2911
2912 MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitialize);
2913
2881 } // namespace 2914 } // namespace
2882 } // namespace cc 2915 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698