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

Unified Diff: chrome/browser/autofill/form_structure_unittest.cc

Issue 12089035: add experiment support and add urlprefix for autocheckout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/browser/autofill/form_structure.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/form_structure_unittest.cc
diff --git a/chrome/browser/autofill/form_structure_unittest.cc b/chrome/browser/autofill/form_structure_unittest.cc
index 6dafc1ac6efad63c24dea3c3fe9d3927e511a473..4df25ea835b31b2f59dbfb917c25ce38abbcae22 100644
--- a/chrome/browser/autofill/form_structure_unittest.cc
+++ b/chrome/browser/autofill/form_structure_unittest.cc
@@ -1574,19 +1574,21 @@ TEST(FormStructureTest, EncodeQueryRequest) {
EXPECT_EQ(0U, encoded_signatures.size());
EXPECT_EQ("", encoded_xml);
- // Check the behaviour with kEnableExperimentalFormFilling switch on.
- // Add the previous form but with flag set.
+ // Check the behaviour with autocheckout enabled.
ScopedVector<FormStructure> checkable_forms;
+ form.origin = GURL("https://www.sample1.com/query/path");
checkable_forms.push_back(new FormStructure(form, true));
ASSERT_TRUE(FormStructure::EncodeQueryRequest(checkable_forms.get(),
&encoded_signatures,
&encoded_xml));
- const char * const kSignature3 = "7747357776717901584";
+ const char * const kSignature3 = "10816570822443282449";
const char * const kResponse3 =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><autofillquery "
- "clientversion=\"6.1.1715.1442/en (GGLL)\" accepts=\"e\">"
- "<form signature=\"7747357776717901584\"><field signature=\"412125936\"/>"
+ "clientversion=\"6.1.1715.1442/en (GGLL)\" accepts=\"a\" "
+ "urlprefix=\"https://www.sample1.com/query/path\">"
+ "<form signature=\"10816570822443282449\">"
+ "<field signature=\"412125936\"/>"
"<field signature=\"1917667676\"/><field signature=\"2226358947\"/><field"
" signature=\"747221617\"/><field signature=\"4108155786\"/><field "
"signature=\"3410250678\"/><field signature=\"509334676\"/><field "
@@ -1596,6 +1598,20 @@ TEST(FormStructureTest, EncodeQueryRequest) {
ASSERT_EQ(1U, encoded_signatures.size());
EXPECT_EQ(kSignature3, encoded_signatures[0]);
EXPECT_EQ(kResponse3, encoded_xml);
+
+ // Check the behaviour with autocheckout enabled.
+ // It should remove query parameters and the encoded_xml should be same
+ // as previous test.
+ ScopedVector<FormStructure> checkable_forms2;
+ form.origin = GURL("https://www.sample1.com/query/path?a=b&c=d");
+ checkable_forms2.push_back(new FormStructure(form, true));
+
+ ASSERT_TRUE(FormStructure::EncodeQueryRequest(checkable_forms2.get(),
+ &encoded_signatures,
+ &encoded_xml));
+ ASSERT_EQ(1U, encoded_signatures.size());
+ EXPECT_EQ(kSignature3, encoded_signatures[0]);
+ EXPECT_EQ(kResponse3, encoded_xml);
}
TEST(FormStructureTest, EncodeUploadRequest) {
« no previous file with comments | « chrome/browser/autofill/form_structure.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698