summaryrefslogtreecommitdiffstats
path: root/chrome/browser/webdata
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-10 03:59:11 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-10 03:59:11 +0000
commita151aa05cb2beecdb9f92a108ff78fa11ea9ce2e (patch)
treea58db79ec08d6fc45827106bc9aa2c5e2434ac52 /chrome/browser/webdata
parent56aaac0fa20bf3033f12f71a920431db1c7f0cc5 (diff)
downloadchromium_src-a151aa05cb2beecdb9f92a108ff78fa11ea9ce2e.zip
chromium_src-a151aa05cb2beecdb9f92a108ff78fa11ea9ce2e.tar.gz
chromium_src-a151aa05cb2beecdb9f92a108ff78fa11ea9ce2e.tar.bz2
Revert "Move conditions of FormFields creation to FormFieldHistoryManager;
AutoFill does not have the same conditions. This required manipulating the FormField data structure to add necessary field data." This reverts commit r38570. TBR=jhawkins Review URL: http://codereview.chromium.org/602014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38573 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/webdata')
-rw-r--r--chrome/browser/webdata/web_data_service_unittest.cc7
-rw-r--r--chrome/browser/webdata/web_database_unittest.cc49
2 files changed, 17 insertions, 39 deletions
diff --git a/chrome/browser/webdata/web_data_service_unittest.cc b/chrome/browser/webdata/web_data_service_unittest.cc
index 34092b8..c19fee8 100644
--- a/chrome/browser/webdata/web_data_service_unittest.cc
+++ b/chrome/browser/webdata/web_data_service_unittest.cc
@@ -24,7 +24,6 @@
#include "chrome/common/notification_type.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebInputElement.h"
#include "webkit/glue/form_field.h"
using base::Time;
@@ -106,11 +105,7 @@ class WebDataServiceTest : public testing::Test {
const string16& value,
std::vector<webkit_glue::FormField>* form_fields) {
form_fields->push_back(
- webkit_glue::FormField(string16(),
- name,
- value,
- string16(),
- WebKit::WebInputElement::Text));
+ webkit_glue::FormField(string16(), name, string16(), value));
}
MessageLoopForUI message_loop_;
diff --git a/chrome/browser/webdata/web_database_unittest.cc b/chrome/browser/webdata/web_database_unittest.cc
index 8064ef4..1b950c8 100644
--- a/chrome/browser/webdata/web_database_unittest.cc
+++ b/chrome/browser/webdata/web_database_unittest.cc
@@ -21,7 +21,6 @@
#include "chrome/common/chrome_paths.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebInputElement.h"
#include "webkit/glue/form_field.h"
#include "webkit/glue/password_form.h"
@@ -428,36 +427,32 @@ TEST_F(WebDatabaseTest, Autofill) {
EXPECT_TRUE(db.AddFormFieldValue(
FormField(string16(),
ASCIIToUTF16("Name"),
- ASCIIToUTF16("Superman"),
string16(),
- WebKit::WebInputElement::Text),
+ ASCIIToUTF16("Superman")),
&changes));
std::vector<string16> v;
for (int i = 0; i < 5; i++) {
EXPECT_TRUE(db.AddFormFieldValue(
FormField(string16(),
ASCIIToUTF16("Name"),
- ASCIIToUTF16("Clark Kent"),
string16(),
- WebKit::WebInputElement::Text),
+ ASCIIToUTF16("Clark Kent")),
&changes));
}
for (int i = 0; i < 3; i++) {
EXPECT_TRUE(db.AddFormFieldValue(
FormField(string16(),
ASCIIToUTF16("Name"),
- ASCIIToUTF16("Clark Sutter"),
string16(),
- WebKit::WebInputElement::Text),
+ ASCIIToUTF16("Clark Sutter")),
&changes));
}
for (int i = 0; i < 2; i++) {
EXPECT_TRUE(db.AddFormFieldValue(
FormField(string16(),
ASCIIToUTF16("Favorite Color"),
- ASCIIToUTF16("Green"),
string16(),
- WebKit::WebInputElement::Text),
+ ASCIIToUTF16("Green")),
&changes));
}
@@ -469,9 +464,8 @@ TEST_F(WebDatabaseTest, Autofill) {
EXPECT_TRUE(db.GetIDAndCountOfFormElement(
FormField(string16(),
ASCIIToUTF16("Name"),
- ASCIIToUTF16("Clark Kent"),
string16(),
- WebKit::WebInputElement::Text),
+ ASCIIToUTF16("Clark Kent")),
&pair_id, &count));
EXPECT_EQ(5, count);
EXPECT_NE(0, pair_id);
@@ -481,18 +475,16 @@ TEST_F(WebDatabaseTest, Autofill) {
EXPECT_TRUE(db.GetIDAndCountOfFormElement(
FormField(string16(),
ASCIIToUTF16("Name"),
- ASCIIToUTF16("clark kent"),
string16(),
- WebKit::WebInputElement::Text),
+ ASCIIToUTF16("clark kent")),
&pair_id, &count));
EXPECT_EQ(0, count);
EXPECT_TRUE(db.GetIDAndCountOfFormElement(
FormField(string16(),
ASCIIToUTF16("Favorite Color"),
- ASCIIToUTF16("Green"),
string16(),
- WebKit::WebInputElement::Text),
+ ASCIIToUTF16("Green")),
&pair_id, &count));
EXPECT_EQ(2, count);
@@ -555,9 +547,8 @@ TEST_F(WebDatabaseTest, Autofill) {
EXPECT_TRUE(db.GetIDAndCountOfFormElement(
FormField(string16(),
ASCIIToUTF16("Name"),
- ASCIIToUTF16("Clark Kent"),
string16(),
- WebKit::WebInputElement::Text),
+ ASCIIToUTF16("Clark Kent")),
&pair_id, &count));
EXPECT_EQ(0, count);
@@ -570,26 +561,22 @@ TEST_F(WebDatabaseTest, Autofill) {
EXPECT_TRUE(db.AddFormFieldValue(FormField(string16(),
ASCIIToUTF16("blank"),
string16(),
- string16(),
- WebKit::WebInputElement::Text),
+ string16()),
&changes));
EXPECT_TRUE(db.AddFormFieldValue(FormField(string16(),
ASCIIToUTF16("blank"),
- ASCIIToUTF16(" "),
string16(),
- WebKit::WebInputElement::Text),
+ ASCIIToUTF16(" ")),
&changes));
EXPECT_TRUE(db.AddFormFieldValue(FormField(string16(),
ASCIIToUTF16("blank"),
- ASCIIToUTF16(" "),
string16(),
- WebKit::WebInputElement::Text),
+ ASCIIToUTF16(" ")),
&changes));
EXPECT_TRUE(db.AddFormFieldValue(FormField(string16(),
ASCIIToUTF16("blank"),
- kValue,
string16(),
- WebKit::WebInputElement::Text),
+ kValue),
&changes));
// They should be stored normally as the DB layer does not check for empty
@@ -622,17 +609,15 @@ TEST_F(WebDatabaseTest, Autofill_RemoveBetweenChanges) {
EXPECT_TRUE(db.AddFormFieldValueTime(
FormField(string16(),
ASCIIToUTF16("Name"),
- ASCIIToUTF16("Superman"),
string16(),
- WebKit::WebInputElement::Text),
+ ASCIIToUTF16("Superman")),
&changes,
t1));
EXPECT_TRUE(db.AddFormFieldValueTime(
FormField(string16(),
ASCIIToUTF16("Name"),
- ASCIIToUTF16("Superman"),
string16(),
- WebKit::WebInputElement::Text),
+ ASCIIToUTF16("Superman")),
&changes,
t2));
@@ -665,9 +650,8 @@ TEST_F(WebDatabaseTest, Autofill_AddChanges) {
EXPECT_TRUE(db.AddFormFieldValueTime(
FormField(string16(),
ASCIIToUTF16("Name"),
- ASCIIToUTF16("Superman"),
string16(),
- WebKit::WebInputElement::Text),
+ ASCIIToUTF16("Superman")),
&changes,
t1));
ASSERT_EQ(1U, changes.size());
@@ -680,9 +664,8 @@ TEST_F(WebDatabaseTest, Autofill_AddChanges) {
EXPECT_TRUE(db.AddFormFieldValueTime(
FormField(string16(),
ASCIIToUTF16("Name"),
- ASCIIToUTF16("Superman"),
string16(),
- WebKit::WebInputElement::Text),
+ ASCIIToUTF16("Superman")),
&changes,
t2));
ASSERT_EQ(1U, changes.size());