| Index: cc/layer_impl_unittest.cc
|
| diff --git a/cc/layer_impl_unittest.cc b/cc/layer_impl_unittest.cc
|
| index 68a2fe03b1eca88e933d4cc354bb517713d0f658..8d691cfe4ebcecd3f3b2b813aa85bf0c042de80d 100644
|
| --- a/cc/layer_impl_unittest.cc
|
| +++ b/cc/layer_impl_unittest.cc
|
| @@ -7,6 +7,7 @@
|
| #include "cc/single_thread_proxy.h"
|
| #include "cc/test/fake_impl_proxy.h"
|
| #include "cc/test/fake_layer_tree_host_impl.h"
|
| +#include "cc/test/fake_output_surface.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "third_party/skia/include/effects/SkBlurImageFilter.h"
|
| @@ -53,13 +54,13 @@ namespace {
|
|
|
| #define VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(codeToTest) \
|
| root->resetAllChangeTrackingForSubtree(); \
|
| - hostImpl.resetNeedsUpdateDrawPropertiesForTesting(); \
|
| + hostImpl.forcePrepareToDraw(); \
|
| codeToTest; \
|
| EXPECT_TRUE(hostImpl.needsUpdateDrawProperties());
|
|
|
| #define VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(codeToTest) \
|
| root->resetAllChangeTrackingForSubtree(); \
|
| - hostImpl.resetNeedsUpdateDrawPropertiesForTesting(); \
|
| + hostImpl.forcePrepareToDraw(); \
|
| codeToTest; \
|
| EXPECT_FALSE(hostImpl.needsUpdateDrawProperties());
|
|
|
| @@ -73,6 +74,7 @@ TEST(LayerImplTest, verifyLayerChangesAreTrackedProperly)
|
| // Create a simple LayerImpl tree:
|
| FakeImplProxy proxy;
|
| FakeLayerTreeHostImpl hostImpl(&proxy);
|
| + EXPECT_TRUE(hostImpl.initializeRenderer(createFakeOutputSurface()));
|
| scoped_ptr<LayerImpl> root = LayerImpl::create(hostImpl.activeTree(), 1);
|
| root->addChild(LayerImpl::create(hostImpl.activeTree(), 2));
|
| LayerImpl* child = root->children()[0];
|
| @@ -169,6 +171,7 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties)
|
| {
|
| FakeImplProxy proxy;
|
| FakeLayerTreeHostImpl hostImpl(&proxy);
|
| + EXPECT_TRUE(hostImpl.initializeRenderer(createFakeOutputSurface()));
|
| scoped_ptr<LayerImpl> root = LayerImpl::create(hostImpl.activeTree(), 1);
|
|
|
| gfx::PointF arbitraryPointF = gfx::PointF(0.125f, 0.25f);
|
| @@ -199,7 +202,7 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties)
|
| VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(root->scrollBy(arbitraryVector2d));
|
| VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(root->scrollBy(gfx::Vector2d()));
|
| root->setScrollDelta(gfx::Vector2d(0, 0));
|
| - hostImpl.resetNeedsUpdateDrawPropertiesForTesting();
|
| + hostImpl.forcePrepareToDraw();
|
| VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(root->setScrollDelta(arbitraryVector2d));
|
| VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(root->setScrollDelta(arbitraryVector2d));
|
| VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(root->setScrollOffset(arbitraryVector2d));
|
|
|