Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / components / password_manager / core / browser / login_database_unittest.cc
index 7697be7..4dd83f8 100644 (file)
@@ -5,7 +5,7 @@
 #include "components/password_manager/core/browser/login_database.h"
 
 #include "base/basictypes.h"
-#include "base/file_util.h"
+#include "base/files/file_util.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/memory/scoped_vector.h"
 #include "base/path_service.h"
@@ -135,6 +135,10 @@ TEST_F(LoginDatabaseTest, Logins) {
   form.times_used = 1;
   form.form_data.name = ASCIIToUTF16("form_name");
   form.date_synced = base::Time::Now();
+  form.display_name = ASCIIToUTF16("Mr. Smith");
+  form.avatar_url = GURL("https://accounts.google.com/Avatar");
+  form.federation_url = GURL("https://accounts.google.com/federation");
+  form.is_zero_click = true;
 
   // Add it and make sure it is there and that all the fields were retrieved
   // correctly.
@@ -253,7 +257,6 @@ TEST_F(LoginDatabaseTest, Logins) {
 }
 
 TEST_F(LoginDatabaseTest, TestPublicSuffixDomainMatching) {
-  PSLMatchingHelper::EnablePublicSuffixDomainMatchingForTesting();
   std::vector<PasswordForm*> result;
 
   // Verify the database is empty.
@@ -303,15 +306,12 @@ TEST_F(LoginDatabaseTest, TestPublicSuffixDomainMatching) {
 }
 
 TEST_F(LoginDatabaseTest, TestPublicSuffixDisabledForNonHTMLForms) {
-  PSLMatchingHelper::EnablePublicSuffixDomainMatchingForTesting();
-
   TestNonHTMLFormPSLMatching(PasswordForm::SCHEME_BASIC);
   TestNonHTMLFormPSLMatching(PasswordForm::SCHEME_DIGEST);
   TestNonHTMLFormPSLMatching(PasswordForm::SCHEME_OTHER);
 }
 
 TEST_F(LoginDatabaseTest, TestPublicSuffixDomainMatchingShouldMatchingApply) {
-  PSLMatchingHelper::EnablePublicSuffixDomainMatchingForTesting();
   std::vector<PasswordForm*> result;
 
   // Verify the database is empty.
@@ -361,7 +361,6 @@ TEST_F(LoginDatabaseTest, TestPublicSuffixDomainMatchingShouldMatchingApply) {
 // instead of GetUniqueStatement, since REGEXP is in use. See
 // http://crbug.com/248608.
 TEST_F(LoginDatabaseTest, TestPublicSuffixDomainMatchingDifferentSites) {
-  PSLMatchingHelper::EnablePublicSuffixDomainMatchingForTesting();
   std::vector<PasswordForm*> result;
 
   // Verify the database is empty.
@@ -455,7 +454,6 @@ PasswordForm GetFormWithNewSignonRealm(PasswordForm form,
 }
 
 TEST_F(LoginDatabaseTest, TestPublicSuffixDomainMatchingRegexp) {
-  PSLMatchingHelper::EnablePublicSuffixDomainMatchingForTesting();
   std::vector<PasswordForm*> result;
 
   // Verify the database is empty.
@@ -589,6 +587,11 @@ static bool AddTimestampedLogin(LoginDatabase* db,
   form.password_element = ASCIIToUTF16(unique_string);
   form.submit_element = ASCIIToUTF16("signIn");
   form.signon_realm = url;
+  form.display_name = ASCIIToUTF16(unique_string);
+  form.avatar_url = GURL("https://accounts.google.com/Avatar");
+  form.federation_url = GURL("https://accounts.google.com/federation");
+  form.is_zero_click = true;
+
   if (date_is_creation)
     form.date_created = time;
   else
@@ -709,6 +712,10 @@ TEST_F(LoginDatabaseTest, BlacklistedLogins) {
   form.blacklisted_by_user = true;
   form.scheme = PasswordForm::SCHEME_HTML;
   form.date_synced = base::Time::Now();
+  form.display_name = ASCIIToUTF16("Mr. Smith");
+  form.avatar_url = GURL("https://accounts.google.com/Avatar");
+  form.federation_url = GURL("https://accounts.google.com/federation");
+  form.is_zero_click = true;
   EXPECT_EQ(AddChangeForForm(form), db_.AddLogin(form));
 
   // Get all non-blacklisted logins (should be none).
@@ -926,6 +933,10 @@ TEST_F(LoginDatabaseTest, UpdateLogin) {
   form.blacklisted_by_user = true;
   form.scheme = PasswordForm::SCHEME_BASIC;
   form.type = PasswordForm::TYPE_GENERATED;
+  form.display_name = ASCIIToUTF16("Mr. Smith");
+  form.avatar_url = GURL("https://accounts.google.com/Avatar");
+  form.federation_url = GURL("https://accounts.google.com/federation");
+  form.is_zero_click = true;
   EXPECT_EQ(UpdateChangeForForm(form), db_.UpdateLogin(form));
 
   ScopedVector<autofill::PasswordForm> result;