summaryrefslogtreecommitdiffstats
path: root/chrome/browser/webdata/web_database_unittest.cc
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-23 19:47:41 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-23 19:47:41 +0000
commit6780b3bd5805018c242cde0a9cff3f48d12e4649 (patch)
tree4d208f861eb7d181010c5b230aad39ae96807bb7 /chrome/browser/webdata/web_database_unittest.cc
parent91451171aa98b6e44238517f39fc58a86028d75d (diff)
downloadchromium_src-6780b3bd5805018c242cde0a9cff3f48d12e4649.zip
chromium_src-6780b3bd5805018c242cde0a9cff3f48d12e4649.tar.gz
chromium_src-6780b3bd5805018c242cde0a9cff3f48d12e4649.tar.bz2
Add a label member to the FormField class. This member will hold the value of the field's label once we parse this value from the DOM.
BUG=none TEST=none Review URL: http://codereview.chromium.org/418032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32834 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/webdata/web_database_unittest.cc')
-rw-r--r--chrome/browser/webdata/web_database_unittest.cc44
1 files changed, 32 insertions, 12 deletions
diff --git a/chrome/browser/webdata/web_database_unittest.cc b/chrome/browser/webdata/web_database_unittest.cc
index 14f52e1..4a54d76 100644
--- a/chrome/browser/webdata/web_database_unittest.cc
+++ b/chrome/browser/webdata/web_database_unittest.cc
@@ -392,23 +392,29 @@ TEST_F(WebDatabaseTest, Autofill) {
// Simulate the submission of a handful of entries in a field called "Name",
// some more often than others.
EXPECT_TRUE(db.AddFormFieldValue(
- FormField(ASCIIToUTF16("Name"), string16(), ASCIIToUTF16("Superman"))));
+ FormField(string16(),
+ ASCIIToUTF16("Name"),
+ string16(),
+ ASCIIToUTF16("Superman"))));
std::vector<string16> v;
for (int i = 0; i < 5; i++) {
EXPECT_TRUE(db.AddFormFieldValue(
- FormField(ASCIIToUTF16("Name"),
+ FormField(string16(),
+ ASCIIToUTF16("Name"),
string16(),
ASCIIToUTF16("Clark Kent"))));
}
for (int i = 0; i < 3; i++) {
EXPECT_TRUE(db.AddFormFieldValue(
- FormField(ASCIIToUTF16("Name"),
+ FormField(string16(),
+ ASCIIToUTF16("Name"),
string16(),
ASCIIToUTF16("Clark Sutter"))));
}
for (int i = 0; i < 2; i++) {
EXPECT_TRUE(db.AddFormFieldValue(
- FormField(ASCIIToUTF16("Favorite Color"),
+ FormField(string16(),
+ ASCIIToUTF16("Favorite Color"),
string16(),
ASCIIToUTF16("Green"))));
}
@@ -419,7 +425,10 @@ TEST_F(WebDatabaseTest, Autofill) {
// We have added the name Clark Kent 5 times, so count should be 5 and pair_id
// should be somthing non-zero.
EXPECT_TRUE(db.GetIDAndCountOfFormElement(
- FormField(ASCIIToUTF16("Name"), string16(), ASCIIToUTF16("Clark Kent")),
+ FormField(string16(),
+ ASCIIToUTF16("Name"),
+ string16(),
+ ASCIIToUTF16("Clark Kent")),
&pair_id, &count));
EXPECT_EQ(5, count);
EXPECT_NE(0, pair_id);
@@ -427,12 +436,16 @@ TEST_F(WebDatabaseTest, Autofill) {
// Storing in the data base should be case sensitive, so there should be no
// database entry for clark kent lowercase.
EXPECT_TRUE(db.GetIDAndCountOfFormElement(
- FormField(ASCIIToUTF16("Name"), string16(), ASCIIToUTF16("clark kent")),
+ FormField(string16(),
+ ASCIIToUTF16("Name"),
+ string16(),
+ ASCIIToUTF16("clark kent")),
&pair_id, &count));
EXPECT_EQ(0, count);
EXPECT_TRUE(db.GetIDAndCountOfFormElement(
- FormField(ASCIIToUTF16("Favorite Color"),
+ FormField(string16(),
+ ASCIIToUTF16("Favorite Color"),
string16(),
ASCIIToUTF16("Green")),
&pair_id, &count));
@@ -475,7 +488,10 @@ TEST_F(WebDatabaseTest, Autofill) {
EXPECT_TRUE(db.RemoveFormElementsAddedBetween(t1, Time()));
EXPECT_TRUE(db.GetIDAndCountOfFormElement(
- FormField(ASCIIToUTF16("Name"), string16(), ASCIIToUTF16("Clark Kent")),
+ FormField(string16(),
+ ASCIIToUTF16("Name"),
+ string16(),
+ ASCIIToUTF16("Clark Kent")),
&pair_id, &count));
EXPECT_EQ(0, count);
@@ -485,16 +501,20 @@ TEST_F(WebDatabaseTest, Autofill) {
// Now add some values with empty strings.
const string16 kValue = ASCIIToUTF16(" toto ");
- EXPECT_TRUE(db.AddFormFieldValue(FormField(ASCIIToUTF16("blank"),
+ EXPECT_TRUE(db.AddFormFieldValue(FormField(string16(),
+ ASCIIToUTF16("blank"),
string16(),
string16())));
- EXPECT_TRUE(db.AddFormFieldValue(FormField(ASCIIToUTF16("blank"),
+ EXPECT_TRUE(db.AddFormFieldValue(FormField(string16(),
+ ASCIIToUTF16("blank"),
string16(),
ASCIIToUTF16(" "))));
- EXPECT_TRUE(db.AddFormFieldValue(FormField(ASCIIToUTF16("blank"),
+ EXPECT_TRUE(db.AddFormFieldValue(FormField(string16(),
+ ASCIIToUTF16("blank"),
string16(),
ASCIIToUTF16(" "))));
- EXPECT_TRUE(db.AddFormFieldValue(FormField(ASCIIToUTF16("blank"),
+ EXPECT_TRUE(db.AddFormFieldValue(FormField(string16(),
+ ASCIIToUTF16("blank"),
string16(),
kValue)));