| Index: third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
|
| index 7a78d7fa1964d8247cd3927ebdf3a21b0fcb5de0..869bd75896d1d502b0f059904c10e71540cc1fc8 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
|
| @@ -1083,27 +1083,21 @@
|
| }
|
| getPaintController().commitNewDisplayItems();
|
|
|
| - EXPECT_DISPLAY_LIST(getPaintController().getDisplayItemList(), 8,
|
| - TestDisplayItem(container1, backgroundDrawingType),
|
| - TestDisplayItem(content1, backgroundDrawingType),
|
| - TestDisplayItem(content1, foregroundDrawingType),
|
| - TestDisplayItem(container1, foregroundDrawingType),
|
| -
|
| - TestDisplayItem(container2, backgroundDrawingType),
|
| - TestDisplayItem(content2, backgroundDrawingType),
|
| - TestDisplayItem(content2, foregroundDrawingType),
|
| - TestDisplayItem(container2, foregroundDrawingType));
|
| -
|
| - PaintController::SubsequenceMarkers* markers =
|
| - getPaintController().getSubsequenceMarkers(container1);
|
| - CHECK(markers);
|
| - EXPECT_EQ(0u, markers->start);
|
| - EXPECT_EQ(3u, markers->end);
|
| -
|
| - markers = getPaintController().getSubsequenceMarkers(container2);
|
| - CHECK(markers);
|
| - EXPECT_EQ(4u, markers->start);
|
| - EXPECT_EQ(7u, markers->end);
|
| + EXPECT_DISPLAY_LIST(
|
| + getPaintController().getDisplayItemList(), 12,
|
| + TestDisplayItem(container1, DisplayItem::kSubsequence),
|
| + TestDisplayItem(container1, backgroundDrawingType),
|
| + TestDisplayItem(content1, backgroundDrawingType),
|
| + TestDisplayItem(content1, foregroundDrawingType),
|
| + TestDisplayItem(container1, foregroundDrawingType),
|
| + TestDisplayItem(container1, DisplayItem::kEndSubsequence),
|
| +
|
| + TestDisplayItem(container2, DisplayItem::kSubsequence),
|
| + TestDisplayItem(container2, backgroundDrawingType),
|
| + TestDisplayItem(content2, backgroundDrawingType),
|
| + TestDisplayItem(content2, foregroundDrawingType),
|
| + TestDisplayItem(container2, foregroundDrawingType),
|
| + TestDisplayItem(container2, DisplayItem::kEndSubsequence));
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| EXPECT_EQ(2u, getPaintController().paintChunks().size());
|
| @@ -1166,34 +1160,30 @@
|
| context, container1));
|
| }
|
|
|
| - EXPECT_EQ(8, numCachedNewItems());
|
| + EXPECT_EQ(12, numCachedNewItems());
|
| #ifndef NDEBUG
|
| - EXPECT_EQ(0, numSequentialMatches());
|
| - EXPECT_EQ(0, numOutOfOrderMatches());
|
| - EXPECT_EQ(0, numIndexedItems());
|
| + EXPECT_EQ(1, numSequentialMatches());
|
| + EXPECT_EQ(1, numOutOfOrderMatches());
|
| + EXPECT_EQ(5, numIndexedItems());
|
| #endif
|
|
|
| getPaintController().commitNewDisplayItems();
|
|
|
| - EXPECT_DISPLAY_LIST(getPaintController().getDisplayItemList(), 8,
|
| - TestDisplayItem(container2, backgroundDrawingType),
|
| - TestDisplayItem(content2, backgroundDrawingType),
|
| - TestDisplayItem(content2, foregroundDrawingType),
|
| - TestDisplayItem(container2, foregroundDrawingType),
|
| - TestDisplayItem(container1, backgroundDrawingType),
|
| - TestDisplayItem(content1, backgroundDrawingType),
|
| - TestDisplayItem(content1, foregroundDrawingType),
|
| - TestDisplayItem(container1, foregroundDrawingType));
|
| -
|
| - markers = getPaintController().getSubsequenceMarkers(container2);
|
| - CHECK(markers);
|
| - EXPECT_EQ(0u, markers->start);
|
| - EXPECT_EQ(3u, markers->end);
|
| -
|
| - markers = getPaintController().getSubsequenceMarkers(container1);
|
| - CHECK(markers);
|
| - EXPECT_EQ(4u, markers->start);
|
| - EXPECT_EQ(7u, markers->end);
|
| + EXPECT_DISPLAY_LIST(
|
| + getPaintController().getDisplayItemList(), 12,
|
| + TestDisplayItem(container2, DisplayItem::kSubsequence),
|
| + TestDisplayItem(container2, backgroundDrawingType),
|
| + TestDisplayItem(content2, backgroundDrawingType),
|
| + TestDisplayItem(content2, foregroundDrawingType),
|
| + TestDisplayItem(container2, foregroundDrawingType),
|
| + TestDisplayItem(container2, DisplayItem::kEndSubsequence),
|
| +
|
| + TestDisplayItem(container1, DisplayItem::kSubsequence),
|
| + TestDisplayItem(container1, backgroundDrawingType),
|
| + TestDisplayItem(content1, backgroundDrawingType),
|
| + TestDisplayItem(content1, foregroundDrawingType),
|
| + TestDisplayItem(container1, foregroundDrawingType),
|
| + TestDisplayItem(container1, DisplayItem::kEndSubsequence));
|
|
|
| #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
|
| DisplayItemClient::endShouldKeepAliveAllClients();
|
| @@ -1436,34 +1426,23 @@
|
| }
|
| getPaintController().commitNewDisplayItems();
|
|
|
| - EXPECT_DISPLAY_LIST(getPaintController().getDisplayItemList(), 6,
|
| - TestDisplayItem(container1, backgroundDrawingType),
|
| - TestDisplayItem(content1, backgroundDrawingType),
|
| - TestDisplayItem(content1, foregroundDrawingType),
|
| - TestDisplayItem(container1, foregroundDrawingType),
|
| - TestDisplayItem(container2, backgroundDrawingType),
|
| - TestDisplayItem(content2, backgroundDrawingType));
|
| -
|
| - PaintController::SubsequenceMarkers* markers =
|
| - getPaintController().getSubsequenceMarkers(container1);
|
| - CHECK(markers);
|
| - EXPECT_EQ(0u, markers->start);
|
| - EXPECT_EQ(3u, markers->end);
|
| -
|
| - markers = getPaintController().getSubsequenceMarkers(content1);
|
| - CHECK(markers);
|
| - EXPECT_EQ(1u, markers->start);
|
| - EXPECT_EQ(2u, markers->end);
|
| -
|
| - markers = getPaintController().getSubsequenceMarkers(container2);
|
| - CHECK(markers);
|
| - EXPECT_EQ(4u, markers->start);
|
| - EXPECT_EQ(5u, markers->end);
|
| -
|
| - markers = getPaintController().getSubsequenceMarkers(content2);
|
| - CHECK(markers);
|
| - EXPECT_EQ(5u, markers->start);
|
| - EXPECT_EQ(5u, markers->end);
|
| + EXPECT_DISPLAY_LIST(
|
| + getPaintController().getDisplayItemList(), 14,
|
| + TestDisplayItem(container1, DisplayItem::kSubsequence),
|
| + TestDisplayItem(container1, backgroundDrawingType),
|
| + TestDisplayItem(content1, DisplayItem::kSubsequence),
|
| + TestDisplayItem(content1, backgroundDrawingType),
|
| + TestDisplayItem(content1, foregroundDrawingType),
|
| + TestDisplayItem(content1, DisplayItem::kEndSubsequence),
|
| + TestDisplayItem(container1, foregroundDrawingType),
|
| + TestDisplayItem(container1, DisplayItem::kEndSubsequence),
|
| +
|
| + TestDisplayItem(container2, DisplayItem::kSubsequence),
|
| + TestDisplayItem(container2, backgroundDrawingType),
|
| + TestDisplayItem(content2, DisplayItem::kSubsequence),
|
| + TestDisplayItem(content2, backgroundDrawingType),
|
| + TestDisplayItem(content2, DisplayItem::kEndSubsequence),
|
| + TestDisplayItem(container2, DisplayItem::kEndSubsequence));
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| EXPECT_EQ(5u, getPaintController().paintChunks().size());
|
| @@ -1547,35 +1526,28 @@
|
| FloatRect(100, 100, 100, 100));
|
| }
|
|
|
| - EXPECT_EQ(2, numCachedNewItems());
|
| + EXPECT_EQ(4, numCachedNewItems());
|
| #ifndef NDEBUG
|
| - EXPECT_EQ(0, numSequentialMatches());
|
| + EXPECT_EQ(1, numSequentialMatches());
|
| EXPECT_EQ(0, numOutOfOrderMatches());
|
| - EXPECT_EQ(0, numIndexedItems());
|
| + EXPECT_EQ(2, numIndexedItems());
|
| #endif
|
|
|
| getPaintController().commitNewDisplayItems();
|
|
|
| - EXPECT_DISPLAY_LIST(getPaintController().getDisplayItemList(), 4,
|
| - TestDisplayItem(content2, foregroundDrawingType),
|
| - TestDisplayItem(content1, backgroundDrawingType),
|
| - TestDisplayItem(content1, foregroundDrawingType),
|
| - TestDisplayItem(container1, foregroundDrawingType));
|
| -
|
| - markers = getPaintController().getSubsequenceMarkers(content2);
|
| - CHECK(markers);
|
| - EXPECT_EQ(0u, markers->start);
|
| - EXPECT_EQ(0u, markers->end);
|
| -
|
| - markers = getPaintController().getSubsequenceMarkers(container1);
|
| - CHECK(markers);
|
| - EXPECT_EQ(1u, markers->start);
|
| - EXPECT_EQ(3u, markers->end);
|
| -
|
| - markers = getPaintController().getSubsequenceMarkers(content1);
|
| - CHECK(markers);
|
| - EXPECT_EQ(1u, markers->start);
|
| - EXPECT_EQ(2u, markers->end);
|
| + EXPECT_DISPLAY_LIST(
|
| + getPaintController().getDisplayItemList(), 10,
|
| + TestDisplayItem(content2, DisplayItem::kSubsequence),
|
| + TestDisplayItem(content2, foregroundDrawingType),
|
| + TestDisplayItem(content2, DisplayItem::kEndSubsequence),
|
| +
|
| + TestDisplayItem(container1, DisplayItem::kSubsequence),
|
| + TestDisplayItem(content1, DisplayItem::kSubsequence),
|
| + TestDisplayItem(content1, backgroundDrawingType),
|
| + TestDisplayItem(content1, foregroundDrawingType),
|
| + TestDisplayItem(content1, DisplayItem::kEndSubsequence),
|
| + TestDisplayItem(container1, foregroundDrawingType),
|
| + TestDisplayItem(container1, DisplayItem::kEndSubsequence));
|
|
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| EXPECT_EQ(3u, getPaintController().paintChunks().size());
|
| @@ -2269,7 +2241,7 @@
|
| FloatRect(100, 100, 300, 300));
|
| }
|
| getPaintController().commitNewDisplayItems();
|
| - EXPECT_EQ(1u,
|
| + EXPECT_EQ(3u,
|
| getPaintController().paintArtifact().getDisplayItemList().size());
|
|
|
| {
|
| @@ -2281,7 +2253,7 @@
|
| FloatRect(100, 100, 300, 300));
|
| }
|
| getPaintController().commitNewDisplayItems();
|
| - EXPECT_EQ(1u,
|
| + EXPECT_EQ(3u,
|
| getPaintController().paintArtifact().getDisplayItemList().size());
|
|
|
| #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
|
| @@ -2319,16 +2291,14 @@
|
|
|
| TEST_F(PaintControllerUnderInvalidationTest, MoreDrawingInSubsequence) {
|
| EXPECT_DEATH(testMoreDrawingInSubsequence(),
|
| - "Check failed: false. Can't find cached display item");
|
| + "\"\\(In cached subsequence of first\\)\" under-invalidation: "
|
| + "display item changed");
|
| }
|
|
|
| TEST_F(PaintControllerUnderInvalidationTest, LessDrawingInSubsequence) {
|
| - // We allow invalidated display item clients as long as they would produce the
|
| - // same display items. The cases of changed display items are tested by other
|
| - // test cases.
|
| EXPECT_DEATH(testLessDrawingInSubsequence(),
|
| "\"\\(In cached subsequence of first\\)\" under-invalidation: "
|
| - "new subsequence wrong length");
|
| + "display item changed");
|
| }
|
|
|
| TEST_F(PaintControllerUnderInvalidationTest, ChangeNonCacheableInSubsequence) {
|
|
|