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

Unified Diff: content/renderer/paint_aggregator_unittest.cc

Issue 11270042: Add non-member non-mutating methods for common gfx::Rect operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 2 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 | « content/renderer/paint_aggregator.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/paint_aggregator_unittest.cc
diff --git a/content/renderer/paint_aggregator_unittest.cc b/content/renderer/paint_aggregator_unittest.cc
index 72618229b1bf37e3b5254feb3390bd7faae65c63..5e0ec86ad256eed5622273ae22ff2412109353da 100644
--- a/content/renderer/paint_aggregator_unittest.cc
+++ b/content/renderer/paint_aggregator_unittest.cc
@@ -37,8 +37,7 @@ TEST(PaintAggregator, DoubleDisjointInvalidation) {
greg.InvalidateRect(r1);
greg.InvalidateRect(r2);
- gfx::Rect expected_bounds = r1;
- expected_bounds.Union(r2);
+ gfx::Rect expected_bounds = gfx::UnionRects(r1, r2);
EXPECT_TRUE(greg.HasPendingUpdate());
PaintAggregator::PendingUpdate update;
@@ -62,8 +61,7 @@ TEST(PaintAggregator, DisjointInvalidationsCombined) {
greg.InvalidateRect(r1);
greg.InvalidateRect(r2);
- gfx::Rect expected_bounds = r1;
- expected_bounds.Union(r2);
+ gfx::Rect expected_bounds = gfx::UnionRects(r1, r2);
EXPECT_TRUE(greg.HasPendingUpdate());
PaintAggregator::PendingUpdate update;
@@ -279,8 +277,7 @@ TEST(PaintAggregator, OverlappingPaintBeforeScroll) {
gfx::Rect scroll_rect(0, 0, 10, 10);
greg.ScrollRect(2, 0, scroll_rect);
- gfx::Rect expected_paint_rect = scroll_rect;
- expected_paint_rect.Union(paint_rect);
+ gfx::Rect expected_paint_rect = gfx::UnionRects(scroll_rect, paint_rect);
EXPECT_TRUE(greg.HasPendingUpdate());
PaintAggregator::PendingUpdate update;
@@ -301,8 +298,7 @@ TEST(PaintAggregator, OverlappingPaintAfterScroll) {
gfx::Rect paint_rect(4, 4, 10, 2);
greg.InvalidateRect(paint_rect);
- gfx::Rect expected_paint_rect = scroll_rect;
- expected_paint_rect.Union(paint_rect);
+ gfx::Rect expected_paint_rect = gfx::UnionRects(scroll_rect, paint_rect);
EXPECT_TRUE(greg.HasPendingUpdate());
PaintAggregator::PendingUpdate update;
« no previous file with comments | « content/renderer/paint_aggregator.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698