#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"
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.
}
TEST_F(LoginDatabaseTest, TestPublicSuffixDomainMatching) {
- PSLMatchingHelper::EnablePublicSuffixDomainMatchingForTesting();
std::vector<PasswordForm*> result;
// Verify the database is empty.
}
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.
// 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.
}
TEST_F(LoginDatabaseTest, TestPublicSuffixDomainMatchingRegexp) {
- PSLMatchingHelper::EnablePublicSuffixDomainMatchingForTesting();
std::vector<PasswordForm*> result;
// Verify the database is empty.
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
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).
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;