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

Unified Diff: cc/contents_scaling_layer_unittest.cc

Issue 11503005: cc: Refactor content scale/bounds into draw properties (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix shadowing 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
Index: cc/contents_scaling_layer_unittest.cc
diff --git a/cc/contents_scaling_layer_unittest.cc b/cc/contents_scaling_layer_unittest.cc
index 1825641643e9ee57618efde9dcac8bd780a41c0d..9dee5f342f30fb4e5ed02de6a3cecf87836e9384 100644
--- a/cc/contents_scaling_layer_unittest.cc
+++ b/cc/contents_scaling_layer_unittest.cc
@@ -46,7 +46,7 @@ TEST(ContentsScalingLayerTest, checkContentsBounds) {
EXPECT_EQ(320, testLayer->contentBounds().width());
EXPECT_EQ(240, testLayer->contentBounds().height());
- testLayer->setContentsScale(2.0f);
+ testLayer->updateContentsScale(2.0f);
danakj 2012/12/14 20:37:23 If you make this method return the scale/bounds it
enne (OOO) 2012/12/14 22:06:05 Added updateContentsScale to FakeTiledLayer as a h
EXPECT_EQ(640, testLayer->contentBounds().width());
EXPECT_EQ(480, testLayer->contentBounds().height());
@@ -54,25 +54,10 @@ TEST(ContentsScalingLayerTest, checkContentsBounds) {
EXPECT_EQ(20, testLayer->contentBounds().width());
EXPECT_EQ(40, testLayer->contentBounds().height());
- testLayer->setContentsScale(1.33f);
+ testLayer->updateContentsScale(1.33f);
EXPECT_EQ(14, testLayer->contentBounds().width());
EXPECT_EQ(27, testLayer->contentBounds().height());
}
-TEST(ContentsScalingLayerTest, checkContentsScaleChangeTriggersNeedsDisplay) {
- scoped_refptr<MockContentsScalingLayer> testLayer =
- make_scoped_refptr(new MockContentsScalingLayer());
-
- testLayer->setBounds(gfx::Size(320, 240));
-
- testLayer->resetNeedsDisplay();
- EXPECT_FALSE(testLayer->needsDisplay());
-
- testLayer->setContentsScale(testLayer->contentsScaleX() + 1.f);
- EXPECT_TRUE(testLayer->needsDisplay());
- EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 320, 240),
- testLayer->lastNeedsDisplayRect());
-}
-
} // namespace
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698