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

Unified Diff: components/password_manager/core/browser/password_form_manager_unittest.cc

Issue 279193002: Fix GMOCK warnings in password_manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 | « no previous file | components/password_manager/core/browser/password_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/password_form_manager_unittest.cc
diff --git a/components/password_manager/core/browser/password_form_manager_unittest.cc b/components/password_manager/core/browser/password_form_manager_unittest.cc
index 0e76081fb979e45c83e94ee073cc01f29eeed708..1599f444422954a56d38e38a1746d9610d13dfde 100644
--- a/components/password_manager/core/browser/password_form_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_form_manager_unittest.cc
@@ -380,6 +380,10 @@ TEST_F(PasswordFormManagerTest, TestAlternateUsername) {
TestPasswordManager password_manager(&client);
scoped_ptr<PasswordFormManager> manager(new PasswordFormManager(
&password_manager, &client, client.GetDriver(), *observed_form(), false));
+ EXPECT_CALL(*client.GetMockDriver(), AllowPasswordGenerationForForm(_))
+ .Times(1);
+ EXPECT_CALL(*client.GetMockDriver(), IsOffTheRecord())
+ .WillRepeatedly(Return(false));
password_store->AddLogin(*saved_match());
manager->FetchMatchingLoginsFromPasswordStore(PasswordStore::ALLOW_PROMPT);
@@ -411,6 +415,8 @@ TEST_F(PasswordFormManagerTest, TestAlternateUsername) {
// This time use an alternate username
manager.reset(new PasswordFormManager(
&password_manager, &client, client.GetDriver(), *observed_form(), false));
+ EXPECT_CALL(*client.GetMockDriver(), AllowPasswordGenerationForForm(_))
+ .Times(1);
password_store->Clear();
password_store->AddLogin(*saved_match());
manager->FetchMatchingLoginsFromPasswordStore(PasswordStore::ALLOW_PROMPT);
@@ -529,6 +535,8 @@ TEST_F(PasswordFormManagerTest, TestSendNotBlacklistedMessage) {
&password_manager, &client, client.GetDriver(), *observed_form(), false));
EXPECT_CALL(*client.GetMockDriver(), AllowPasswordGenerationForForm(_))
.Times(1);
+ EXPECT_CALL(*client.GetMockDriver(), IsOffTheRecord())
+ .WillRepeatedly(Return(false));
SimulateFetchMatchingLoginsFromPasswordStore(manager.get());
// We need add heap allocated objects to result.
result.push_back(CreateSavedMatch(false));
@@ -556,6 +564,10 @@ TEST_F(PasswordFormManagerTest, TestForceInclusionOfGeneratedPasswords) {
TestPasswordManager password_manager(&client);
scoped_ptr<PasswordFormManager> manager(new PasswordFormManager(
&password_manager, &client, client.GetDriver(), *observed_form(), false));
+ EXPECT_CALL(*client.GetMockDriver(), AllowPasswordGenerationForForm(_))
+ .Times(1);
+ EXPECT_CALL(*client.GetMockDriver(), IsOffTheRecord())
+ .WillRepeatedly(Return(false));
// Simulate having two matches for this origin, one of which was from a form
// with different HTML tags for elements. Because of scoring differences,
@@ -575,6 +587,9 @@ TEST_F(PasswordFormManagerTest, TestForceInclusionOfGeneratedPasswords) {
// well are generated. They should now be sent to Autofill().
manager.reset(new PasswordFormManager(
&password_manager, &client, client.GetDriver(), *observed_form(), false));
+ EXPECT_CALL(*client.GetMockDriver(), AllowPasswordGenerationForForm(_))
+ .Times(1);
+
results.push_back(CreateSavedMatch(false));
results.push_back(CreateSavedMatch(false));
results[1]->username_value = ASCIIToUTF16("other@gmail.com");
« no previous file with comments | « no previous file | components/password_manager/core/browser/password_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698