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

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

Issue 402993004: [Password Generation] Fix memory leak in test from r284169 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/password_manager_unittest.cc
diff --git a/components/password_manager/core/browser/password_manager_unittest.cc b/components/password_manager/core/browser/password_manager_unittest.cc
index c9fd3138bc8959c4b8c52a31be2f7d570cac0960..e628923a135ea80ddcadd137103a16188e0ad70d 100644
--- a/components/password_manager/core/browser/password_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_manager_unittest.cc
@@ -335,7 +335,9 @@ TEST_F(PasswordManagerTest, GeneratedPasswordFormSubmitEmptyStore) {
// occured.
EXPECT_CALL(client_, PromptUserToSavePasswordPtr(_)).Times(Exactly(0));
EXPECT_CALL(*store_.get(), AddLogin(FormMatches(form)));
- EXPECT_CALL(client_, AutomaticPasswordSavePtr(_)).Times(Exactly(1));
+ scoped_ptr<PasswordFormManager> saved_form_manager;
+ EXPECT_CALL(client_, AutomaticPasswordSavePtr(_)).Times(Exactly(1))
+ .WillOnce(WithArg<0>(SaveToScopedPtr(&saved_form_manager)));
// Now the password manager waits for the navigation to complete.
observed.clear();
@@ -643,7 +645,9 @@ TEST_F(PasswordManagerTest, GeneratedPasswordFormSavedAutocompleteOff) {
// occured.
EXPECT_CALL(client_, PromptUserToSavePasswordPtr(_)).Times(Exactly(0));
EXPECT_CALL(*store_.get(), AddLogin(FormMatches(form)));
- EXPECT_CALL(client_, AutomaticPasswordSavePtr(_)).Times(Exactly(1));
+ scoped_ptr<PasswordFormManager> saved_form_manager;
+ EXPECT_CALL(client_, AutomaticPasswordSavePtr(_)).Times(Exactly(1))
+ .WillOnce(WithArg<0>(SaveToScopedPtr(&saved_form_manager)));
// Now the password manager waits for the navigation to complete.
observed.clear();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698