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

Unified Diff: webkit/glue/form_field.h

Issue 7576001: Refactor webkit_glue::FormField to remove hacky methods (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright header Created 9 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
« no previous file with comments | « chrome/test/live_sync/autofill_helper.cc ('k') | webkit/glue/form_field.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/form_field.h
diff --git a/webkit/glue/form_field.h b/webkit/glue/form_field.h
index 58ad15751837222f4325dda0d958e24970d9bf5b..622dabfc6fcb23e34ae06b173c7d34f8b585ef2c 100644
--- a/webkit/glue/form_field.h
+++ b/webkit/glue/form_field.h
@@ -15,25 +15,15 @@ namespace webkit_glue {
// Stores information about a field in a form.
struct FormField {
FormField();
- FormField(const string16& label,
- const string16& name,
- const string16& value,
- const string16& form_control_type,
- int max_length,
- bool is_autofilled);
virtual ~FormField();
- // Equality tests for identity which does not include |value_| or |size_|.
- // Use |StrictlyEqualsHack| method to test all members.
+ // Equality tests for identity which does not include |value| or
+ // |is_autofilled|.
// TODO(dhollowa): These operators need to be revised when we implement field
// ids.
bool operator==(const FormField& field) const;
bool operator!=(const FormField& field) const;
- // Test equality of all data members.
- // TODO(dhollowa): This will be removed when we implement field ids.
- bool StrictlyEqualsHack(const FormField& field) const;
-
string16 label;
string16 name;
string16 value;
@@ -52,4 +42,16 @@ std::ostream& operator<<(std::ostream& os, const FormField& field);
} // namespace webkit_glue
+// Prefer to use this macro in place of |EXPECT_EQ()| for comparing |FormField|s
+// in test code.
+#define EXPECT_FORM_FIELD_EQUALS(expected, actual) \
+ do { \
+ EXPECT_EQ(expected.label, actual.label); \
+ EXPECT_EQ(expected.name, actual.name); \
+ EXPECT_EQ(expected.value, actual.value); \
+ EXPECT_EQ(expected.form_control_type, actual.form_control_type); \
+ EXPECT_EQ(expected.max_length, actual.max_length); \
+ EXPECT_EQ(expected.is_autofilled, actual.is_autofilled); \
+ } while (0)
+
#endif // WEBKIT_GLUE_FORM_FIELD_H_
« no previous file with comments | « chrome/test/live_sync/autofill_helper.cc ('k') | webkit/glue/form_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698