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

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

Issue 323993002: Use labels to display views tab titles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments; update tests. Created 6 years, 6 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') | chrome/browser/ui/views/validation_message_bubble_delegate.cc » ('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 23d564d07c08569f8d79f152fce868cedcd93685..9d3228621eb6e0254584b122b715c53ad630373f 100644
--- a/chrome/browser/ui/views/tabs/tab_unittest.cc
+++ b/chrome/browser/ui/views/tabs/tab_unittest.cc
@@ -9,6 +9,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/models/list_selection_model.h"
#include "ui/views/controls/button/image_button.h"
+#include "ui/views/controls/label.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/widget/widget.h"
@@ -150,16 +151,18 @@ class TabTest : public views::ViewsTestBase {
const gfx::Rect contents_bounds = tab.GetContentsBounds();
if (tab.ShouldShowIcon()) {
EXPECT_LE(contents_bounds.x(), tab.favicon_bounds_.x());
- if (tab.title_bounds_.width() > 0)
- EXPECT_LE(tab.favicon_bounds_.right(), tab.title_bounds_.x());
+ if (tab.title_->width() > 0)
+ EXPECT_LE(tab.favicon_bounds_.right(), tab.title_->x());
EXPECT_LE(contents_bounds.y(), tab.favicon_bounds_.y());
EXPECT_LE(tab.favicon_bounds_.bottom(), contents_bounds.bottom());
}
if (tab.ShouldShowIcon() && tab.ShouldShowMediaIndicator())
EXPECT_LE(tab.favicon_bounds_.right(), tab.media_indicator_bounds_.x());
if (tab.ShouldShowMediaIndicator()) {
- if (tab.title_bounds_.width() > 0)
- EXPECT_LE(tab.title_bounds_.right(), tab.media_indicator_bounds_.x());
+ if (tab.title_->width() > 0) {
+ EXPECT_LE(tab.title_->bounds().right(),
+ tab.media_indicator_bounds_.x());
+ }
EXPECT_LE(tab.media_indicator_bounds_.right(), contents_bounds.right());
EXPECT_LE(contents_bounds.y(), tab.media_indicator_bounds_.y());
EXPECT_LE(tab.media_indicator_bounds_.bottom(), contents_bounds.bottom());
@@ -174,8 +177,8 @@ class TabTest : public views::ViewsTestBase {
if (tab.ShouldShowCloseBox()) {
// Note: The title bounds can overlap the left-insets of the close box,
// but should otherwise be to the left of the close button.
- if (tab.title_bounds_.width() > 0) {
- EXPECT_LE(tab.title_bounds_.right(),
+ if (tab.title_->width() > 0) {
+ EXPECT_LE(tab.title_->bounds().right(),
tab.close_button_->bounds().x() +
tab.close_button_->GetInsets().left());
}
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | chrome/browser/ui/views/validation_message_bubble_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698