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

Unified Diff: cc/layer_tree_host_unittest.cc

Issue 11644036: cc: Don't let invalidations that we're going to handle immediately cause an extra commit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ignoreSetNeedsCommit Created 8 years 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.cc ('k') | cc/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_unittest.cc
diff --git a/cc/layer_tree_host_unittest.cc b/cc/layer_tree_host_unittest.cc
index cb0c6e9fc3ed95f562bce113cd3df337e32fbb8d..3a19af663414cf86058cf5819c872fef39ecfe15 100644
--- a/cc/layer_tree_host_unittest.cc
+++ b/cc/layer_tree_host_unittest.cc
@@ -278,6 +278,47 @@ TEST_F(LayerTreeHostTestSetNeedsRedraw, runMultiThread)
runTest(true);
}
+class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest {
+public:
+ LayerTreeHostTestNoExtraCommitFromInvalidate()
+ : m_rootLayer(ContentLayer::create(&m_client))
+ {
+ }
+
+ virtual void beginTest() OVERRIDE
+ {
+ m_rootLayer->setAutomaticallyComputeRasterScale(false);
+ m_rootLayer->setIsDrawable(true);
+ m_rootLayer->setBounds(gfx::Size(1, 1));
+ m_layerTreeHost->setRootLayer(m_rootLayer);
+ postSetNeedsCommitToMainThread();
+ }
+
+ virtual void didCommit() OVERRIDE
+ {
+ switch (m_layerTreeHost->commitNumber()) {
+ case 1:
+ // Changing the content bounds will cause a single commit!
+ m_rootLayer->setRasterScale(4.0f);
+ break;
+ default:
+ // No extra commits.
+ EXPECT_EQ(2, m_layerTreeHost->commitNumber());
+ endTest();
+ }
+ }
+
+ virtual void afterTest() OVERRIDE
+ {
+ }
+
+private:
+ FakeContentLayerClient m_client;
+ scoped_refptr<ContentLayer> m_rootLayer;
+};
+
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoExtraCommitFromInvalidate)
+
class LayerTreeHostTestCompositeAndReadback : public LayerTreeHostTest {
public:
LayerTreeHostTestCompositeAndReadback()
« no previous file with comments | « cc/layer.cc ('k') | cc/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698