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

Unified Diff: chrome/browser/ui/views/location_bar/icon_label_bubble_view_unittest.cc

Issue 2642893002: Adjust positioning of location bar icons. (Closed)
Patch Set: nits Created 3 years, 11 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: chrome/browser/ui/views/location_bar/icon_label_bubble_view_unittest.cc
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view_unittest.cc b/chrome/browser/ui/views/location_bar/icon_label_bubble_view_unittest.cc
index 28f3efe0645baeefaad69eb061d8859dc4144c00..b2fc2bbf066c7aef5f0e4636f19b5e7f089d59b6 100644
--- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view_unittest.cc
+++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view_unittest.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/views/controls/image_view.h"
@@ -65,7 +66,8 @@ class TestIconLabelBubbleView : public IconLabelBubbleView {
bool ShouldShowLabel() const override {
return !IsShrinking() ||
(width() > (image()->GetPreferredSize().width() +
- 2 * LocationBarView::kHorizontalPadding));
+ 2 * LocationBarView::kIconInteriorPadding +
+ 2 * GetLayoutConstant(LOCATION_BAR_ELEMENT_PADDING)));
}
double WidthMultiplier() const override {
@@ -130,7 +132,7 @@ class IconLabelBubbleViewTest : public views::ViewsTestBase {
minimum_size_reached_ = false;
previous_width_ = 0;
initial_image_x_ = GetImageBounds().x();
- EXPECT_NE(0, initial_image_x_);
+ EXPECT_EQ(0, initial_image_x_);
}
void VerifyAnimationStep() {
@@ -152,7 +154,6 @@ class IconLabelBubbleViewTest : public views::ViewsTestBase {
if (steady_reached_)
EXPECT_EQ(previous_width_, width());
EXPECT_EQ(initial_image_x_, GetImageBounds().x());
- EXPECT_GT(GetImageBounds().x(), 0);
EXPECT_LT(GetImageBounds().right(), width());
EXPECT_TRUE(IsLabelVisible());
EXPECT_GT(GetLabelBounds().x(), GetImageBounds().right());

Powered by Google App Engine
This is Rietveld 408576698