summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-05 03:53:19 +0000
committerepenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-05 03:53:19 +0000
commita8febcd1f51e84f2442199dbc029d38014935a63 (patch)
treeaadeed578116e65971196315fac7e2498b0bb0cb
parent6c6eff93eebf7290f9b1d5d1ff9e4628bece472b (diff)
downloadchromium_src-a8febcd1f51e84f2442199dbc029d38014935a63.zip
chromium_src-a8febcd1f51e84f2442199dbc029d38014935a63.tar.gz
chromium_src-a8febcd1f51e84f2442199dbc029d38014935a63.tar.bz2
CC: Test for completely filled contents.
Follow up to: https://codereview.chromium.org/222823004/ BUG=357117 TBR=enne@chromium.org Review URL: https://codereview.chromium.org/224883003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261968 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--cc/resources/picture_pile_impl_unittest.cc15
-rw-r--r--cc/test/fake_picture_pile_impl.h4
2 files changed, 17 insertions, 2 deletions
diff --git a/cc/resources/picture_pile_impl_unittest.cc b/cc/resources/picture_pile_impl_unittest.cc
index c60bce3..40d1615 100644
--- a/cc/resources/picture_pile_impl_unittest.cc
+++ b/cc/resources/picture_pile_impl_unittest.cc
@@ -634,11 +634,17 @@ TEST(PicturePileImplTest, PixelRefIteratorDiscardableRefsBaseNonDiscardable) {
}
}
-TEST(PicturePileImpl, RasterContentsOpaque) {
+class FullContentsTest : public ::testing::TestWithParam<bool> {};
+
+TEST_P(FullContentsTest, RasterFullContents) {
gfx::Size tile_size(1000, 1000);
gfx::Size layer_bounds(3, 5);
float contents_scale = 1.5f;
float raster_divisions = 2.f;
+ // Param in this case is whether the content is fully opaque
+ // or just filled completely. For this test they should behave the same.
+ bool contents_opaque = GetParam();
+ bool fills_content = !GetParam();
scoped_refptr<FakePicturePileImpl> pile =
FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
@@ -650,7 +656,8 @@ TEST(PicturePileImpl, RasterContentsOpaque) {
pile->SetMinContentsScale(contents_scale);
pile->set_background_color(SK_ColorBLACK);
- pile->set_contents_opaque(true);
+ pile->set_contents_opaque(contents_opaque);
+ pile->set_contents_fill_bounds_completely(fills_content);
pile->set_clear_canvas_with_debug_color(false);
pile->RerecordPile();
@@ -703,6 +710,10 @@ TEST(PicturePileImpl, RasterContentsOpaque) {
}
}
+INSTANTIATE_TEST_CASE_P(PicturePileImpl,
+ FullContentsTest,
+ ::testing::Values(false, true));
+
TEST(PicturePileImpl, RasterContentsTransparent) {
gfx::Size tile_size(1000, 1000);
gfx::Size layer_bounds(5, 3);
diff --git a/cc/test/fake_picture_pile_impl.h b/cc/test/fake_picture_pile_impl.h
index 6bf1b88..9b7bdb7 100644
--- a/cc/test/fake_picture_pile_impl.h
+++ b/cc/test/fake_picture_pile_impl.h
@@ -60,6 +60,10 @@ class FakePicturePileImpl : public PicturePileImpl {
contents_opaque_ = contents_opaque;
}
+ void set_contents_fill_bounds_completely(bool fills) {
+ contents_fill_bounds_completely_ = fills;
+ }
+
void set_clear_canvas_with_debug_color(bool clear) {
clear_canvas_with_debug_color_ = clear;
}