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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 65b8e2454a8254e9a14021b3cb72d6d40016c70f..2817182b13edfc87aeda6eace3d1dbdde9877392 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -2878,5 +2878,38 @@ TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) {
RunTest(true, false, true);
}
+class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
+ public:
+ virtual void BeginTest() OVERRIDE {
+ layer_tree_host()->SetNeedsRedraw();
danakj 2013/06/05 21:53:32 normally we PostSetNeedsCommitToMainThread() here
+ }
+
+ virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE {
+ return FakeOutputSurface::CreateDeferredGL(
+ scoped_ptr<WebKit::WebGraphicsContext3D>(
+ TestWebGraphicsContext3D::Create(
danakj 2013/06/05 21:53:32 nit: You could just use Create() instead of making
+ WebKit::WebGraphicsContext3D::Attributes())),
+ scoped_ptr<SoftwareOutputDevice>(new SoftwareOutputDevice))
+ .PassAs<OutputSurface>();
+ }
+
+ virtual void InitializedRendererOnThread(LayerTreeHostImpl* host_impl,
+ bool success) OVERRIDE {
+ EXPECT_TRUE(success);
+ EXPECT_TRUE(
+ host_impl->DeferredInitialize(scoped_refptr<ContextProvider>()));
danakj 2013/06/05 21:53:32 Maybe it would be worth testing that we actually d
+
+ PostSetNeedsCommitToMainThread();
+ }
+
+ virtual void DidCommitAndDrawFrame() OVERRIDE {
+ EndTest();
+ }
+
+ virtual void AfterTest() OVERRIDE {}
+};
+
+MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitialize);
+
} // namespace
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698