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

Unified Diff: chrome/browser/ui/autofill/autofill_popup_layout_model_unittest.cc

Issue 2517843002: Http Bad: Put icon on the left of http warning message on Views (Closed)
Patch Set: fix mac Created 4 years 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/autofill/autofill_popup_layout_model_unittest.cc
diff --git a/chrome/browser/ui/autofill/autofill_popup_layout_model_unittest.cc b/chrome/browser/ui/autofill/autofill_popup_layout_model_unittest.cc
index 22c718874dcdd448206dd14561f3dc0f5540bbed..47b408a7913a201bd740ec218da407bf355b4799 100644
--- a/chrome/browser/ui/autofill/autofill_popup_layout_model_unittest.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_layout_model_unittest.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h"
#include "chrome/browser/ui/autofill/popup_constants.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
+#include "components/autofill/core/browser/popup_item_ids.h"
#include "components/autofill/core/browser/suggestion.h"
#include "components/grit/components_scaled_resources.h"
#include "content/public/browser/web_contents.h"
@@ -20,6 +21,7 @@
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
+#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/native_widget_types.h"
namespace autofill {
@@ -50,6 +52,10 @@ class TestAutofillPopupViewDelegate : public AutofillPopupViewDelegate {
suggestions.push_back(Suggestion("", "x", "", 0));
suggestions.push_back(Suggestion("", "", "americanExpressCC", 0));
suggestions.push_back(Suggestion("", "x", "genericCC", 0));
+ // Http warning message.
+ suggestions.push_back(
+ Suggestion("x", "x", "httpWarning",
+ POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE));
return suggestions;
}
#if !defined(OS_ANDROID)
@@ -102,6 +108,10 @@ TEST_F(AutofillPopupLayoutModelTest, RowWidthWithoutText) {
.GetImageNamed(IDR_AUTOFILL_CC_GENERIC)
.Width(),
layout_model()->RowWidthWithoutText(3, /* with_label= */ true));
+ EXPECT_EQ(base_size + AutofillPopupLayoutModel::kHttpWarningNamePadding +
+ AutofillPopupLayoutModel::kHttpWarningIconPadding +
+ layout_model()->GetIconImage(4).width(),
+ layout_model()->RowWidthWithoutText(4, /* with_label= */ true));
}
#endif

Powered by Google App Engine
This is Rietveld 408576698