summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/autofill_xml_parser_unittest.cc
diff options
context:
space:
mode:
authorramankk@chromium.org <ramankk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-18 20:52:08 +0000
committerramankk@chromium.org <ramankk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-18 20:52:08 +0000
commite899b96d5a8529a053dd6fa09e73950f5c8bcbf9 (patch)
tree5d985b7713177e2e2299bcbb8887abdf5ed5c264 /chrome/browser/autofill/autofill_xml_parser_unittest.cc
parent643ce66d6d75575437e63acb38c07245364e584b (diff)
downloadchromium_src-e899b96d5a8529a053dd6fa09e73950f5c8bcbf9.zip
chromium_src-e899b96d5a8529a053dd6fa09e73950f5c8bcbf9.tar.gz
chromium_src-e899b96d5a8529a053dd6fa09e73950f5c8bcbf9.tar.bz2
Pop up requestAutocomplete UI when autofill server hints chrome client that it is in a multipage autofill flow.
* Added AutofillFlowInfobarDelegate for the Infobar. (Note that this might evolve soon when we have much concrete UX) * Strings used are also temporary. * browser/autofill/autofill_flow_util.* : helper functions to build FormStructure representing all the information needed for autofill_flow. * browser/autofill/autofill_manager.* : Added new methods to pop the UI and callback method to handle data from UI. * browser/autofill/autofill_xml_parser/form_structure: To get information about step in the autofill flow from autofill servers. * renderer/autofill/autofill_agent.* : To send SSL Status of the page back to the browser process. BUG=159830 Review URL: https://chromiumcodereview.appspot.com/11539003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177746 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_xml_parser_unittest.cc')
-rw-r--r--chrome/browser/autofill/autofill_xml_parser_unittest.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/autofill/autofill_xml_parser_unittest.cc b/chrome/browser/autofill/autofill_xml_parser_unittest.cc
index a0a1024..44ea704 100644
--- a/chrome/browser/autofill/autofill_xml_parser_unittest.cc
+++ b/chrome/browser/autofill/autofill_xml_parser_unittest.cc
@@ -154,6 +154,28 @@ TEST(AutofillQueryXmlParserTest, ParseExperimentId) {
EXPECT_EQ(std::string("ServerSmartyPants"), experiment_id);
}
+// Test XML response with autofill_flow information.
+TEST(AutofillQueryXmlParserTest, ParseAutofillFlow) {
+ std::vector<AutofillFieldType> field_types;
+ UploadRequired upload_required = USE_UPLOAD_RATES;
+ std::string experiment_id;
+
+ std::string xml = "<autofillqueryresponse>"
+ "<field autofilltype=\"55\"/>"
+ "<autofill_flow page_no=\"1\" total_pages=\"10\"/>"
+ "</autofillqueryresponse>";
+
+ scoped_ptr<AutofillQueryXmlParser> parse_handler(
+ new AutofillQueryXmlParser(&field_types, &upload_required,
+ &experiment_id));
+ scoped_ptr<buzz::XmlParser> parser(new buzz::XmlParser(parse_handler.get()));
+ parser->Parse(xml.c_str(), xml.length(), true);
+ EXPECT_TRUE(parse_handler->succeeded());
+ EXPECT_EQ(1U, field_types.size());
+ EXPECT_EQ(1, parse_handler->current_page_number());
+ EXPECT_EQ(10, parse_handler->total_pages());
+}
+
// Test badly formed XML queries.
TEST(AutofillQueryXmlParserTest, ParseErrors) {
std::vector<AutofillFieldType> field_types;