summaryrefslogtreecommitdiffstats
path: root/cc/layers/nine_patch_layer_unittest.cc
diff options
context:
space:
mode:
authorclholgat@chromium.org <clholgat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-04 00:35:13 +0000
committerclholgat@chromium.org <clholgat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-04 00:35:13 +0000
commitefbdb3ac428aa1829161729189604865e606691b (patch)
treee2b465b299b54934d06c020c0ea514292841aa15 /cc/layers/nine_patch_layer_unittest.cc
parent18ae4320efce8e3342c3a5048569a25c4f2498ab (diff)
downloadchromium_src-efbdb3ac428aa1829161729189604865e606691b.zip
chromium_src-efbdb3ac428aa1829161729189604865e606691b.tar.gz
chromium_src-efbdb3ac428aa1829161729189604865e606691b.tar.bz2
Generic UIResourceLayer for shared resources.
Separated the UIResource management from the NinePatchLayer because we need it for other things as well. BUG=235290 Review URL: https://codereview.chromium.org/24716003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226908 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers/nine_patch_layer_unittest.cc')
-rw-r--r--cc/layers/nine_patch_layer_unittest.cc38
1 files changed, 3 insertions, 35 deletions
diff --git a/cc/layers/nine_patch_layer_unittest.cc b/cc/layers/nine_patch_layer_unittest.cc
index 101146c..f616560 100644
--- a/cc/layers/nine_patch_layer_unittest.cc
+++ b/cc/layers/nine_patch_layer_unittest.cc
@@ -56,40 +56,7 @@ class NinePatchLayerTest : public testing::Test {
FakeLayerTreeHostClient fake_client_;
};
-TEST_F(NinePatchLayerTest, SetBitmap) {
- scoped_refptr<NinePatchLayer> test_layer = NinePatchLayer::Create();
- ASSERT_TRUE(test_layer.get());
- test_layer->SetIsDrawable(true);
- test_layer->SetBounds(gfx::Size(100, 100));
-
- layer_tree_host_->SetRootLayer(test_layer);
- Mock::VerifyAndClearExpectations(layer_tree_host_.get());
- EXPECT_EQ(test_layer->layer_tree_host(), layer_tree_host_.get());
-
- layer_tree_host_->InitializeOutputSurfaceIfNeeded();
-
- ResourceUpdateQueue queue;
- OcclusionTracker occlusion_tracker(gfx::Rect(), false);
- test_layer->SavePaintProperties();
- test_layer->Update(&queue, &occlusion_tracker);
-
- EXPECT_FALSE(test_layer->DrawsContent());
-
- SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10);
- bitmap.allocPixels();
- bitmap.setImmutable();
-
- gfx::Rect aperture(5, 5, 1, 1);
- bool fill_center = false;
- test_layer->SetBitmap(bitmap, aperture);
- test_layer->SetFillCenter(fill_center);
- test_layer->Update(&queue, &occlusion_tracker);
-
- EXPECT_TRUE(test_layer->DrawsContent());
-}
-
-TEST_F(NinePatchLayerTest, SetUIResourceId) {
+TEST_F(NinePatchLayerTest, SetLayerProperties) {
scoped_refptr<NinePatchLayer> test_layer = NinePatchLayer::Create();
ASSERT_TRUE(test_layer.get());
test_layer->SetIsDrawable(true);
@@ -117,7 +84,8 @@ TEST_F(NinePatchLayerTest, SetUIResourceId) {
layer_tree_host_.get(), UIResourceBitmap(bitmap));
gfx::Rect aperture(5, 5, 1, 1);
bool fill_center = true;
- test_layer->SetUIResourceId(resource->id(), aperture);
+ test_layer->SetAperture(aperture);
+ test_layer->SetUIResourceId(resource->id());
test_layer->SetFillCenter(fill_center);
test_layer->Update(&queue, &occlusion_tracker);