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

Unified Diff: cc/layer_tree_host_unittest_context.cc

Issue 11883030: cc: Fix lost context handling when using impl-side painting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add unit test Created 7 years, 11 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
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/picture_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_unittest_context.cc
diff --git a/cc/layer_tree_host_unittest_context.cc b/cc/layer_tree_host_unittest_context.cc
index ac267c0254997363f75f3b4ca1cad80fb3f89676..3e0e35ccfda8bb5607a2998a8c5e331edfd49c01 100644
--- a/cc/layer_tree_host_unittest_context.cc
+++ b/cc/layer_tree_host_unittest_context.cc
@@ -13,6 +13,7 @@
#include "cc/layer_impl.h"
#include "cc/layer_tree_host_impl.h"
#include "cc/layer_tree_impl.h"
+#include "cc/picture_layer.h"
#include "cc/scrollbar_layer.h"
#include "cc/single_thread_proxy.h"
#include "cc/test/fake_content_layer.h"
@@ -812,5 +813,50 @@ class LayerTreeHostContextTestFailsImmediately :
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestFailsImmediately);
+class ImplSidePaintingLayerTreeHostContextTest
enne (OOO) 2013/01/15 22:35:41 How would this test fail before your patch? I was
reveman 2013/01/15 23:16:26 The DCHECK(tiles_.size() == 0) in the tile manager
+ : public LayerTreeHostContextTest {
+ public:
+ virtual void initializeSettings(LayerTreeSettings& settings) OVERRIDE {
+ settings.implSidePainting = true;
+ }
+};
+
+class LayerTreeHostContextTestImplSidePainting :
+ public ImplSidePaintingLayerTreeHostContextTest {
+ public:
+ virtual void setupTree() OVERRIDE {
+ scoped_refptr<Layer> root = Layer::create();
+ root->setBounds(gfx::Size(10, 10));
+ root->setAnchorPoint(gfx::PointF());
+ root->setIsDrawable(true);
+
+ scoped_refptr<PictureLayer> picture = PictureLayer::create(&client_);
+ picture->setBounds(gfx::Size(10, 10));
+ picture->setAnchorPoint(gfx::PointF());
+ picture->setIsDrawable(true);
+ root->addChild(picture);
+
+ m_layerTreeHost->setRootLayer(root);
+ LayerTreeHostContextTest::setupTree();
+ }
+
+ virtual void beginTest() OVERRIDE {
+ times_to_lose_during_commit_ = 1;
+ postSetNeedsCommitToMainThread();
+ }
+
+ virtual void afterTest() OVERRIDE {}
+
+ virtual void didRecreateOutputSurface(bool succeeded) OVERRIDE {
+ EXPECT_TRUE(succeeded);
+ endTest();
+ }
+
+ private:
+ FakeContentLayerClient client_;
+};
+
+MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting)
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/picture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698