| Index: Source/core/paint/DrawingRecorderTest.cpp
|
| diff --git a/Source/core/paint/DrawingRecorderTest.cpp b/Source/core/paint/DrawingRecorderTest.cpp
|
| index e07c585a8d121965e3393dcc5c9210d272b06f35..e1a51d1dd2d35e7a322428d5d3826cfe61f9183f 100644
|
| --- a/Source/core/paint/DrawingRecorderTest.cpp
|
| +++ b/Source/core/paint/DrawingRecorderTest.cpp
|
| @@ -36,6 +36,12 @@ private:
|
| ASSERT_TRUE(m_renderView);
|
| }
|
|
|
| + virtual void TearDown() override
|
| + {
|
| + RuntimeEnabledFeatures::setSlimmingPaintEnabled(false);
|
| + RuntimeEnabledFeatures::setSlimmingPaintDisplayItemCacheEnabled(false);
|
| + }
|
| +
|
| RenderView* m_renderView;
|
| };
|
|
|
| @@ -54,7 +60,7 @@ void drawRect(GraphicsContext* context, RenderView* renderer, PaintPhase phase,
|
| }
|
|
|
|
|
| -TEST_F(DrawingRecorderTest, DrawingRecorderTest_Nothing)
|
| +TEST_F(DrawingRecorderTest, Nothing)
|
| {
|
| GraphicsContext context(nullptr, &rootDisplayItemList());
|
| FloatRect bound = renderView()->viewRect();
|
| @@ -62,10 +68,10 @@ TEST_F(DrawingRecorderTest, DrawingRecorderTest_Nothing)
|
|
|
| drawNothing(&context, renderView(), PaintPhaseForeground, bound);
|
| rootDisplayItemList().endNewPaints();
|
| - EXPECT_EQ((size_t)1, rootDisplayItemList().paintList().size());
|
| + EXPECT_EQ((size_t)0, rootDisplayItemList().paintList().size());
|
| }
|
|
|
| -TEST_F(DrawingRecorderTest, DrawingRecorderTest_Rect)
|
| +TEST_F(DrawingRecorderTest, Rect)
|
| {
|
| GraphicsContext context(nullptr, &rootDisplayItemList());
|
| FloatRect bound = renderView()->viewRect();
|
| @@ -75,21 +81,26 @@ TEST_F(DrawingRecorderTest, DrawingRecorderTest_Rect)
|
| EXPECT_TRUE(rootDisplayItemList().paintList()[0]->isDrawing());
|
| }
|
|
|
| -TEST_F(DrawingRecorderTest, DrawingRecorderTest_Cached)
|
| +TEST_F(DrawingRecorderTest, Cached)
|
| {
|
| + RuntimeEnabledFeatures::setSlimmingPaintDisplayItemCacheEnabled(true);
|
| +
|
| GraphicsContext context(nullptr, &rootDisplayItemList());
|
| FloatRect bound = renderView()->viewRect();
|
| drawNothing(&context, renderView(), PaintPhaseBlockBackground, bound);
|
| drawRect(&context, renderView(), PaintPhaseForeground, bound);
|
| rootDisplayItemList().endNewPaints();
|
| - EXPECT_EQ((size_t)2, rootDisplayItemList().paintList().size());
|
| - EXPECT_TRUE(rootDisplayItemList().paintList()[1]->isDrawing());
|
| + EXPECT_EQ((size_t)1, rootDisplayItemList().paintList().size());
|
| + EXPECT_TRUE(rootDisplayItemList().paintList()[0]->isDrawing());
|
|
|
| drawNothing(&context, renderView(), PaintPhaseBlockBackground, bound);
|
| drawRect(&context, renderView(), PaintPhaseForeground, bound);
|
| + EXPECT_EQ((size_t)2, rootDisplayItemList().newPaintListForTesting().size());
|
| + EXPECT_TRUE(rootDisplayItemList().newPaintListForTesting()[0]->isCached());
|
| + EXPECT_TRUE(rootDisplayItemList().newPaintListForTesting()[1]->isCached());
|
| rootDisplayItemList().endNewPaints();
|
| - EXPECT_EQ((size_t)2, rootDisplayItemList().paintList().size());
|
| - EXPECT_TRUE(rootDisplayItemList().paintList()[1]->isDrawing());
|
| + EXPECT_EQ((size_t)1, rootDisplayItemList().paintList().size());
|
| + EXPECT_TRUE(rootDisplayItemList().paintList()[0]->isDrawing());
|
| }
|
|
|
| }
|
|
|