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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 23702023: Unit test for freeing tiles when going invisible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 1e73b313a501209e3efaa76edcbe985baaa0dbfd..28c59c99cb0a4279d20ef5682f2493f10ce89eb1 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -34,6 +34,7 @@
#include "cc/quads/tile_draw_quad.h"
#include "cc/resources/layer_tiling_data.h"
#include "cc/test/animation_test_common.h"
+#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_output_surface_client.h"
#include "cc/test/fake_proxy.h"
@@ -6428,6 +6429,28 @@ TEST_F(LayerTreeHostImplTest, MemoryPolicy) {
EXPECT_EQ(visible_cutoff_value, current_priority_cutoff_value_);
}
+class LayerTreeHostImplTestManageTiles : public LayerTreeHostImplTest {
+ public:
+ virtual void SetUp() OVERRIDE {
+ LayerTreeSettings settings;
+ settings.impl_side_painting = true;
+
+ fake_host_impl_ = new FakeLayerTreeHostImpl(settings, &proxy_);
+ host_impl_.reset(fake_host_impl_);
+ host_impl_->InitializeRenderer(CreateOutputSurface());
+ host_impl_->SetViewportSize(gfx::Size(10, 10));
+ }
+
+ FakeLayerTreeHostImpl* fake_host_impl_;
+};
+
+TEST_F(LayerTreeHostImplTestManageTiles, ManageTilesWhenInvisible) {
+ fake_host_impl_->SetNeedsManageTiles();
+ EXPECT_TRUE(fake_host_impl_->manage_tiles_needed());
+ fake_host_impl_->SetVisible(false);
+ EXPECT_FALSE(fake_host_impl_->manage_tiles_needed());
+}
+
TEST_F(LayerTreeHostImplTest, UIResourceManagement) {
scoped_ptr<TestWebGraphicsContext3D> context =
TestWebGraphicsContext3D::Create();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698