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

Unified Diff: chrome/browser/ui/views/tabs/tab_unittest.cc

Issue 1401933004: Switch tab.cc to use an empty border for the contents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 5 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 | « chrome/browser/ui/views/tabs/tab.cc ('k') | ui/views/border.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_unittest.cc
diff --git a/chrome/browser/ui/views/tabs/tab_unittest.cc b/chrome/browser/ui/views/tabs/tab_unittest.cc
index d5641ad4a05ffa5f00f8c0d7d4e693949c1ef48d..5c67ac25a93ce68c3e97f9f7641bac72874b9fc3 100644
--- a/chrome/browser/ui/views/tabs/tab_unittest.cc
+++ b/chrome/browser/ui/views/tabs/tab_unittest.cc
@@ -197,9 +197,15 @@ class TabTest : public views::ViewsTestBase,
tab.close_button_->bounds().x() +
tab.close_button_->GetInsets().left());
}
- EXPECT_LE(tab.close_button_->bounds().right(), contents_bounds.right());
- EXPECT_LE(contents_bounds.y(), tab.close_button_->bounds().y());
- EXPECT_LE(tab.close_button_->bounds().bottom(), contents_bounds.bottom());
+ // We need to use the close button contents bounds instead of its bounds,
+ // since it has an empty border around it to extend its clickable area for
+ // touch.
+ // Note: The close button right edge can be outside the nominal contents
+ // bounds, but shouldn't leave the local bounds.
+ const gfx::Rect close_bounds = tab.close_button_->GetContentsBounds();
+ EXPECT_LE(close_bounds.right(), tab.GetLocalBounds().right());
+ EXPECT_LE(contents_bounds.y(), close_bounds.y());
+ EXPECT_LE(close_bounds.bottom(), contents_bounds.bottom());
}
}
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | ui/views/border.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698