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

Unified Diff: ash/launcher/launcher_view_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: cc/ fixes 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 | « ash/launcher/launcher_view.cc ('k') | ash/system/drive/tray_drive.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/launcher/launcher_view_unittest.cc
diff --git a/ash/launcher/launcher_view_unittest.cc b/ash/launcher/launcher_view_unittest.cc
index fdb062f3380fff8b9241d8bebb4ce13ccd07cddf..3e1e80660add82dde5513f6b6394d0b53c6de39f 100644
--- a/ash/launcher/launcher_view_unittest.cc
+++ b/ash/launcher/launcher_view_unittest.cc
@@ -645,8 +645,9 @@ TEST_F(LauncherViewTest, ShouldHideTooltipTest) {
gfx::Rect app_button_rect = GetButtonByID(app_button_id)->GetMirroredBounds();
gfx::Rect tab_button_rect = GetButtonByID(tab_button_id)->GetMirroredBounds();
ASSERT_FALSE(app_button_rect.Intersects(tab_button_rect));
- EXPECT_FALSE(launcher_view_->ShouldHideTooltip(
- app_button_rect.Union(tab_button_rect).CenterPoint()));
+ gfx::Rect union_rect = app_button_rect;
+ union_rect.Union(tab_button_rect);
+ EXPECT_FALSE(launcher_view_->ShouldHideTooltip(union_rect.CenterPoint()));
// The tooltip should hide if it's outside of all buttons.
gfx::Rect all_area;
@@ -655,10 +656,9 @@ TEST_F(LauncherViewTest, ShouldHideTooltipTest) {
if (!button)
continue;
- all_area = all_area.Union(button->GetMirroredBounds());
+ all_area.Union(button->GetMirroredBounds());
}
- all_area = all_area.Union(
- launcher_view_->GetAppListButtonView()->GetMirroredBounds());
+ all_area.Union(launcher_view_->GetAppListButtonView()->GetMirroredBounds());
EXPECT_FALSE(launcher_view_->ShouldHideTooltip(all_area.origin()));
EXPECT_FALSE(launcher_view_->ShouldHideTooltip(
gfx::Point(all_area.right() - 1, all_area.bottom() - 1)));
« no previous file with comments | « ash/launcher/launcher_view.cc ('k') | ash/system/drive/tray_drive.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698