summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/autofill_download_unittest.cc
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-03 00:30:59 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-03 00:30:59 +0000
commitb143821ab651df119648c0a201b6ab4bf616a500 (patch)
treebb9946d52d2d1937bbfc3d2de641a0fabca80c3f /chrome/browser/autofill/autofill_download_unittest.cc
parent89098b14454bd3e9ec38c98084e1e0488de67fb3 (diff)
downloadchromium_src-b143821ab651df119648c0a201b6ab4bf616a500.zip
chromium_src-b143821ab651df119648c0a201b6ab4bf616a500.tar.gz
chromium_src-b143821ab651df119648c0a201b6ab4bf616a500.tar.bz2
AutoFill: Use the FormManager cache to send forms to the AutoFillManager.
Remove the FormFieldValues class and replace its usage with FormData. BUG=38325,33032 TEST=none Review URL: http://codereview.chromium.org/1606005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_download_unittest.cc')
-rw-r--r--chrome/browser/autofill/autofill_download_unittest.cc89
1 files changed, 45 insertions, 44 deletions
diff --git a/chrome/browser/autofill/autofill_download_unittest.cc b/chrome/browser/autofill/autofill_download_unittest.cc
index e1df3b8..fe09261a 100644
--- a/chrome/browser/autofill/autofill_download_unittest.cc
+++ b/chrome/browser/autofill/autofill_download_unittest.cc
@@ -11,8 +11,9 @@
#include "net/url_request/url_request_status.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/WebKit/chromium/public/WebInputElement.h"
-#include "webkit/glue/form_field_values.h"
+#include "webkit/glue/form_data.h"
+using webkit_glue::FormData;
using WebKit::WebInputElement;
// This tests AutoFillDownloadManager. AutoFillDownloadTestHelper implements
@@ -99,52 +100,52 @@ TEST(AutoFillDownloadTest, QueryAndUploadTest) {
TestURLFetcherFactory factory;
URLFetcher::set_factory(&factory);
- webkit_glue::FormFieldValues values;
- values.method = ASCIIToUTF16("post");
- values.elements.push_back(webkit_glue::FormField(ASCIIToUTF16("username"),
- ASCIIToUTF16("username"),
- string16(),
- ASCIIToUTF16("text")));
- values.elements.push_back(webkit_glue::FormField(ASCIIToUTF16("email"),
- ASCIIToUTF16("email"),
- string16(),
- ASCIIToUTF16("text")));
- values.elements.push_back(webkit_glue::FormField(ASCIIToUTF16("email2"),
- ASCIIToUTF16("email2"),
- string16(),
- ASCIIToUTF16("text")));
- values.elements.push_back(webkit_glue::FormField(ASCIIToUTF16("password"),
- ASCIIToUTF16("password"),
- string16(),
- ASCIIToUTF16("password")));
- values.elements.push_back(webkit_glue::FormField(string16(),
- ASCIIToUTF16("Submit"),
- string16(),
- ASCIIToUTF16("submit")));
+ FormData form;
+ form.method = ASCIIToUTF16("post");
+ form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("username"),
+ ASCIIToUTF16("username"),
+ string16(),
+ ASCIIToUTF16("text")));
+ form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("email"),
+ ASCIIToUTF16("email"),
+ string16(),
+ ASCIIToUTF16("text")));
+ form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("email2"),
+ ASCIIToUTF16("email2"),
+ string16(),
+ ASCIIToUTF16("text")));
+ form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("password"),
+ ASCIIToUTF16("password"),
+ string16(),
+ ASCIIToUTF16("password")));
+ form.fields.push_back(webkit_glue::FormField(string16(),
+ ASCIIToUTF16("Submit"),
+ string16(),
+ ASCIIToUTF16("submit")));
- FormStructure *form = new FormStructure(values);
+ FormStructure *form_structure = new FormStructure(form);
ScopedVector<FormStructure> form_structures;
- form_structures.push_back(form);
+ form_structures.push_back(form_structure);
- values.elements.clear();
- values.elements.push_back(webkit_glue::FormField(ASCIIToUTF16("address"),
- ASCIIToUTF16("address"),
- string16(),
- ASCIIToUTF16("text")));
- values.elements.push_back(webkit_glue::FormField(ASCIIToUTF16("address2"),
- ASCIIToUTF16("address2"),
- string16(),
- ASCIIToUTF16("text")));
- values.elements.push_back(webkit_glue::FormField(ASCIIToUTF16("city"),
- ASCIIToUTF16("address2"),
- string16(),
- ASCIIToUTF16("text")));
- values.elements.push_back(webkit_glue::FormField(string16(),
- ASCIIToUTF16("Submit"),
- string16(),
- ASCIIToUTF16("submit")));
- form = new FormStructure(values);
- form_structures.push_back(form);
+ form.fields.clear();
+ form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("address"),
+ ASCIIToUTF16("address"),
+ string16(),
+ ASCIIToUTF16("text")));
+ form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("address2"),
+ ASCIIToUTF16("address2"),
+ string16(),
+ ASCIIToUTF16("text")));
+ form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("city"),
+ ASCIIToUTF16("address2"),
+ string16(),
+ ASCIIToUTF16("text")));
+ form.fields.push_back(webkit_glue::FormField(string16(),
+ ASCIIToUTF16("Submit"),
+ string16(),
+ ASCIIToUTF16("submit")));
+ form_structure = new FormStructure(form);
+ form_structures.push_back(form_structure);
// Request with id 0.
EXPECT_TRUE(helper.download_manager.StartQueryRequest(form_structures));