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

Unified Diff: components/autofill/core/browser/autofill_field_unittest.cc

Issue 22009003: [Autofill] Distinguish between native field types and potentially HTML field types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 4 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: components/autofill/core/browser/autofill_field_unittest.cc
diff --git a/components/autofill/core/browser/autofill_field_unittest.cc b/components/autofill/core/browser/autofill_field_unittest.cc
index 53de47bbc0f78c25026fa9e677c738d7a520ef2e..c47f314861464fb7a2a4b62969835948602a38ba 100644
--- a/components/autofill/core/browser/autofill_field_unittest.cc
+++ b/components/autofill/core/browser/autofill_field_unittest.cc
@@ -5,6 +5,7 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/autofill_field.h"
+#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/field_types.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -17,19 +18,19 @@ TEST(AutofillFieldTest, Type) {
ASSERT_EQ(UNKNOWN_TYPE, field.heuristic_type());
// |server_type_| is NO_SERVER_DATA, so |heuristic_type_| is returned.
- EXPECT_EQ(UNKNOWN_TYPE, field.type());
+ EXPECT_EQ(UNKNOWN_TYPE, field.Type().server_type());
// Set the heuristic type and check it.
field.set_heuristic_type(NAME_FIRST);
- EXPECT_EQ(NAME_FIRST, field.type());
+ EXPECT_EQ(NAME_FIRST, field.Type().server_type());
// Set the server type and check it.
field.set_server_type(ADDRESS_BILLING_LINE1);
- EXPECT_EQ(ADDRESS_BILLING_LINE1, field.type());
+ EXPECT_EQ(ADDRESS_BILLING_LINE1, field.Type().server_type());
// Remove the server type to make sure the heuristic type is preserved.
field.set_server_type(NO_SERVER_DATA);
- EXPECT_EQ(NAME_FIRST, field.type());
+ EXPECT_EQ(NAME_FIRST, field.Type().server_type());
}
TEST(AutofillFieldTest, IsEmpty) {
@@ -71,7 +72,7 @@ TEST(AutofillFieldTest, FieldSignature) {
TEST(AutofillFieldTest, IsFieldFillable) {
AutofillField field;
- ASSERT_EQ(UNKNOWN_TYPE, field.type());
+ ASSERT_EQ(UNKNOWN_TYPE, field.Type().server_type());
// Type is unknown.
EXPECT_FALSE(field.IsFieldFillable());
« no previous file with comments | « components/autofill/core/browser/autofill_field.cc ('k') | components/autofill/core/browser/autofill_ie_toolbar_import_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698