Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3106)

Unified Diff: Source/platform/graphics/paint/DisplayItemListTest.cpp

Issue 1307653007: Fix assertion failure during out-of-order matching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/graphics/paint/DisplayItemList.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
« no previous file with comments | « Source/platform/graphics/paint/DisplayItemList.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698