diff options
Diffstat (limited to 'cc/layers/picture_image_layer_impl_unittest.cc')
-rw-r--r-- | cc/layers/picture_image_layer_impl_unittest.cc | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/cc/layers/picture_image_layer_impl_unittest.cc b/cc/layers/picture_image_layer_impl_unittest.cc index 53b0061..92e6926 100644 --- a/cc/layers/picture_image_layer_impl_unittest.cc +++ b/cc/layers/picture_image_layer_impl_unittest.cc @@ -108,14 +108,10 @@ TEST_F(PictureImageLayerImplTest, CalculateContentsScale) { scoped_ptr<TestablePictureImageLayerImpl> layer(CreateLayer(1, PENDING_TREE)); layer->SetDrawsContent(true); - TestablePictureImageLayerImpl* layer_ptr = layer.get(); - host_impl_.pending_tree()->SetRootLayer(std::move(layer)); - host_impl_.pending_tree()->BuildPropertyTreesForTesting(); - gfx::Rect viewport(100, 200); - SetupDrawPropertiesAndUpdateTiles(layer_ptr, 2.f, 3.f, 4.f, 1.f, false, - viewport); - EXPECT_FLOAT_EQ(1.f, layer_ptr->MaximumTilingContentsScale()); + SetupDrawPropertiesAndUpdateTiles( + layer.get(), 2.f, 3.f, 4.f, 1.f, false, viewport); + EXPECT_FLOAT_EQ(1.f, layer->MaximumTilingContentsScale()); } TEST_F(PictureImageLayerImplTest, IgnoreIdealContentScale) { @@ -125,10 +121,6 @@ TEST_F(PictureImageLayerImplTest, IgnoreIdealContentScale) { gfx::Rect viewport(100, 200); - TestablePictureImageLayerImpl* pending_layer_ptr = pending_layer.get(); - host_impl_.pending_tree()->SetRootLayer(std::move(pending_layer)); - host_impl_.pending_tree()->BuildPropertyTreesForTesting(); - // Set PictureLayerImpl::ideal_contents_scale_ to 2.f which is not equal // to the content scale used by PictureImageLayerImpl. const float suggested_ideal_contents_scale = 2.f; @@ -136,13 +128,17 @@ TEST_F(PictureImageLayerImplTest, IgnoreIdealContentScale) { const float page_scale_factor = 4.f; const float maximum_animation_contents_scale = 1.f; const bool animating_transform_to_screen = false; - SetupDrawPropertiesAndUpdateTiles( - pending_layer_ptr, suggested_ideal_contents_scale, device_scale_factor, - page_scale_factor, maximum_animation_contents_scale, - animating_transform_to_screen, viewport); - EXPECT_EQ(1.f, pending_layer_ptr->tilings()->tiling_at(0)->contents_scale()); + SetupDrawPropertiesAndUpdateTiles(pending_layer.get(), + suggested_ideal_contents_scale, + device_scale_factor, + page_scale_factor, + maximum_animation_contents_scale, + animating_transform_to_screen, + viewport); + EXPECT_EQ(1.f, pending_layer->tilings()->tiling_at(0)->contents_scale()); // Push to active layer. + host_impl_.pending_tree()->SetRootLayer(std::move(pending_layer)); host_impl_.ActivateSyncTree(); TestablePictureImageLayerImpl* active_layer = |