Chromium Code Reviews| 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..5e877deff8e808298e3048d08a7f5e066be190d3 100644 |
| --- a/Source/platform/graphics/paint/DisplayItemListTest.cpp |
| +++ b/Source/platform/graphics/paint/DisplayItemListTest.cpp |
| @@ -516,6 +516,33 @@ TEST_F(DisplayItemListTest, CachedSubsequenceSwapOrder) |
| TestDisplayItem(container1, DisplayItem::EndSubsequence)); |
| } |
| +// Test for crbug.com/526590 |
|
pdr.
2015/09/02 23:13:12
No need for this or the comment "// Should not cra
Xianzhu
2015/09/02 23:21:44
Done.
|
| +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(); |
| + // Should not crash. |
| +} |
| + |
| TEST_F(DisplayItemListTest, CachedNestedSubsequenceUpdate) |
| { |
| TestDisplayItemClient container1("container1"); |