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

Unified Diff: cc/layers/nine_patch_layer_unittest.cc

Issue 21839004: cc: Push valid property values when CalcDrawProps skips layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pushpaintprops: Call SavePaintProps when needed in tests Created 7 years, 4 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/layers/nine_patch_layer.cc ('k') | cc/layers/paint_properties.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/nine_patch_layer_unittest.cc
diff --git a/cc/layers/nine_patch_layer_unittest.cc b/cc/layers/nine_patch_layer_unittest.cc
index 73dd317e2a22a9aacd9afaaae32a80b1a267782a..5268d02472f086d1aae2d1a53625a9c18ca8407e 100644
--- a/cc/layers/nine_patch_layer_unittest.cc
+++ b/cc/layers/nine_patch_layer_unittest.cc
@@ -71,6 +71,7 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) {
OcclusionTracker occlusion_tracker(gfx::Rect(), false);
// No bitmap set should not trigger any uploads.
+ test_layer->SavePaintProperties();
test_layer->SetTexturePriorities(calculator);
test_layer->Update(&queue, &occlusion_tracker);
EXPECT_EQ(0u, queue.FullUploadSize());
@@ -81,6 +82,7 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) {
bitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10);
bitmap.allocPixels();
test_layer->SetBitmap(bitmap, gfx::Rect(5, 5, 1, 1));
+ test_layer->SavePaintProperties();
test_layer->SetTexturePriorities(calculator);
test_layer->Update(&queue, &occlusion_tracker);
EXPECT_EQ(1u, queue.FullUploadSize());
@@ -105,6 +107,7 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) {
}
// Nothing changed, so no repeated upload.
+ test_layer->SavePaintProperties();
test_layer->SetTexturePriorities(calculator);
test_layer->Update(&queue, &occlusion_tracker);
EXPECT_EQ(0u, queue.FullUploadSize());
@@ -117,6 +120,7 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) {
}
// Reupload after eviction
+ test_layer->SavePaintProperties();
test_layer->SetTexturePriorities(calculator);
test_layer->Update(&queue, &occlusion_tracker);
EXPECT_EQ(1u, queue.FullUploadSize());
@@ -126,6 +130,7 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) {
layer_tree_host_->contents_texture_manager()->UnregisterTexture(
params.texture);
EXPECT_EQ(NULL, params.texture->resource_manager());
+ test_layer->SavePaintProperties();
test_layer->SetTexturePriorities(calculator);
ResourceUpdateQueue queue2;
test_layer->Update(&queue2, &occlusion_tracker);
« no previous file with comments | « cc/layers/nine_patch_layer.cc ('k') | cc/layers/paint_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698