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

Unified Diff: cc/base/spiral_iterator_unittest.cc

Issue 2364583002: cc: Add edge case test in spiral iterator unittest. (Closed)
Patch Set: rebase Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/spiral_iterator_unittest.cc
diff --git a/cc/base/spiral_iterator_unittest.cc b/cc/base/spiral_iterator_unittest.cc
index 6bb17417a29a21981a69d5d0e68d77798cd9956a..30804ee94232d6e2b8d6bfe5ac9b3128309078f3 100644
--- a/cc/base/spiral_iterator_unittest.cc
+++ b/cc/base/spiral_iterator_unittest.cc
@@ -671,6 +671,26 @@ TEST(SpiralIteratorTest, EdgeCases) {
expected.push_back(std::make_pair(2, 0));
TestSpiralIterate(__LINE__, tiling_data, consider, ignore, center, expected);
+
+ // Tiling is smaller than tile size and center rect is not intersecting to
+ // tiling rect.
+ TilingData smaller_tiling(gfx::Size(10, 10), gfx::Size(1, 1), false);
+ consider = gfx::Rect(10, 10);
+ ignore = gfx::Rect();
+ center = gfx::Rect(2, 2, 10, 10);
+
+ // Layout of the tiling data, and expected return order:
+ // x 0
+ // y ┌───────┐
+ // │ 1 │
+ // 0 │ │
+ // │ * │
+ // └───────┘
+ expected.clear();
+ expected.push_back(std::make_pair(0, 0));
+
+ TestSpiralIterate(__LINE__, smaller_tiling, consider, ignore, center,
+ expected);
}
} // namespace
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698