Index: Source/platform/graphics/paint/DisplayItemListTest.cpp |
diff --git a/Source/platform/graphics/paint/DisplayItemListTest.cpp b/Source/platform/graphics/paint/DisplayItemListTest.cpp |
index 0605017cfe508fed1be79a53d4beaad56c62c3f4..c7132a0c3a7700724e423db17294ed0286c1881c 100644 |
--- a/Source/platform/graphics/paint/DisplayItemListTest.cpp |
+++ b/Source/platform/graphics/paint/DisplayItemListTest.cpp |
@@ -516,6 +516,31 @@ TEST_F(DisplayItemListTest, CachedSubsequenceSwapOrder) |
TestDisplayItem(container1, DisplayItem::EndSubsequence)); |
} |
+TEST_F(DisplayItemListTest, OutOfOrderNoCrash) |
+{ |
+ TestDisplayItemClient client("client"); |
+ GraphicsContext context(&displayItemList()); |
+ |
+ const DisplayItem::Type type1 = DisplayItem::DrawingFirst; |
+ const DisplayItem::Type type2 = static_cast<DisplayItem::Type>(DisplayItem::DrawingFirst + 1); |
+ const DisplayItem::Type type3 = static_cast<DisplayItem::Type>(DisplayItem::DrawingFirst + 2); |
+ const DisplayItem::Type type4 = static_cast<DisplayItem::Type>(DisplayItem::DrawingFirst + 3); |
+ |
+ drawRect(context, client, type1, FloatRect(100, 100, 100, 100)); |
+ drawRect(context, client, type2, FloatRect(100, 100, 50, 200)); |
+ drawRect(context, client, type3, FloatRect(100, 100, 50, 200)); |
+ drawRect(context, client, type4, FloatRect(100, 100, 100, 100)); |
+ |
+ displayItemList().commitNewDisplayItems(); |
+ |
+ drawRect(context, client, type2, FloatRect(100, 100, 50, 200)); |
+ drawRect(context, client, type3, FloatRect(100, 100, 50, 200)); |
+ drawRect(context, client, type1, FloatRect(100, 100, 100, 100)); |
+ drawRect(context, client, type4, FloatRect(100, 100, 100, 100)); |
+ |
+ displayItemList().commitNewDisplayItems(); |
+} |
+ |
TEST_F(DisplayItemListTest, CachedNestedSubsequenceUpdate) |
{ |
TestDisplayItemClient container1("container1"); |