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

Unified Diff: content/renderer/paint_aggregator_unittest.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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
Index: content/renderer/paint_aggregator_unittest.cc
diff --git a/content/renderer/paint_aggregator_unittest.cc b/content/renderer/paint_aggregator_unittest.cc
index 1874270dad7df18623072256e027d6f0f7a13b71..6c1e578fe3cc7f80dce6bbf7140c956dd69a8dc0 100644
--- a/content/renderer/paint_aggregator_unittest.cc
+++ b/content/renderer/paint_aggregator_unittest.cc
@@ -35,7 +35,8 @@ TEST(PaintAggregator, DoubleDisjointInvalidation) {
greg.InvalidateRect(r1);
greg.InvalidateRect(r2);
- gfx::Rect expected_bounds = r1.Union(r2);
+ gfx::Rect expected_bounds = r1;
+ expected_bounds.Union(r2);
EXPECT_TRUE(greg.HasPendingUpdate());
PaintAggregator::PendingUpdate update;
@@ -59,7 +60,8 @@ TEST(PaintAggregator, DisjointInvalidationsCombined) {
greg.InvalidateRect(r1);
greg.InvalidateRect(r2);
- gfx::Rect expected_bounds = r1.Union(r2);
+ gfx::Rect expected_bounds = r1;
+ expected_bounds.Union(r2);
EXPECT_TRUE(greg.HasPendingUpdate());
PaintAggregator::PendingUpdate update;
@@ -275,7 +277,8 @@ TEST(PaintAggregator, OverlappingPaintBeforeScroll) {
gfx::Rect scroll_rect(0, 0, 10, 10);
greg.ScrollRect(2, 0, scroll_rect);
- gfx::Rect expected_paint_rect = scroll_rect.Union(paint_rect);
+ gfx::Rect expected_paint_rect = scroll_rect;
+ expected_paint_rect.Union(paint_rect);
EXPECT_TRUE(greg.HasPendingUpdate());
PaintAggregator::PendingUpdate update;
@@ -296,7 +299,8 @@ TEST(PaintAggregator, OverlappingPaintAfterScroll) {
gfx::Rect paint_rect(4, 4, 10, 2);
greg.InvalidateRect(paint_rect);
- gfx::Rect expected_paint_rect = scroll_rect.Union(paint_rect);
+ gfx::Rect expected_paint_rect = scroll_rect;
+ expectd_paint_rect.Union(paint_rect);
EXPECT_TRUE(greg.HasPendingUpdate());
PaintAggregator::PendingUpdate update;

Powered by Google App Engine
This is Rietveld 408576698