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

Unified Diff: chrome/browser/password_manager/credential_manager_browsertest.cc

Issue 2605483002: Remove usages of raw new (Closed)
Patch Set: Replace unique_ptrs with stack allocations Created 4 years 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: chrome/browser/password_manager/credential_manager_browsertest.cc
diff --git a/chrome/browser/password_manager/credential_manager_browsertest.cc b/chrome/browser/password_manager/credential_manager_browsertest.cc
index f7d3a22e73b1cc3765c23f17fb02f652fa8db616..d10b36344e380c873e3e1f0edb969adfaf624507 100644
--- a/chrome/browser/password_manager/credential_manager_browsertest.cc
+++ b/chrome/browser/password_manager/credential_manager_browsertest.cc
@@ -214,10 +214,9 @@ IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest,
// Wait for the password store before checking the prompt because it pops up
// after the store replies.
WaitForPasswordStore();
- std::unique_ptr<BubbleObserver> prompt_observer(
- new BubbleObserver(WebContents()));
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
- EXPECT_FALSE(prompt_observer->IsShowingUpdatePrompt());
+ BubbleObserver prompt_observer(WebContents());
+ EXPECT_FALSE(prompt_observer.IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer.IsShowingUpdatePrompt());
// There should be an entry for both psl.example.com and www.example.com.
password_manager::TestPasswordStore::PasswordMap passwords =
@@ -263,11 +262,10 @@ IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest,
observer.SetPathToWaitFor("/password/done.html");
observer.Wait();
- std::unique_ptr<BubbleObserver> prompt_observer(
- new BubbleObserver(WebContents()));
+ BubbleObserver prompt_observer(WebContents());
// The autofill password manager shouldn't react to the successful login
// because it was suppressed when the site got the credential back.
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer.IsShowingSavePrompt());
}
IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, SaveViaAPIAndAutofill) {
@@ -291,10 +289,9 @@ IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, SaveViaAPIAndAutofill) {
form_submit_observer.Wait();
WaitForPasswordStore();
- std::unique_ptr<BubbleObserver> prompt_observer(
- new BubbleObserver(WebContents()));
- ASSERT_TRUE(prompt_observer->IsShowingSavePrompt());
- prompt_observer->AcceptSavePrompt();
+ BubbleObserver prompt_observer(WebContents());
+ ASSERT_TRUE(prompt_observer.IsShowingSavePrompt());
+ prompt_observer.AcceptSavePrompt();
WaitForPasswordStore();
password_manager::TestPasswordStore::PasswordMap stored =
@@ -350,10 +347,9 @@ IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, UpdateViaAPIAndAutofill) {
// Wait for the password store before checking the prompt because it pops up
// after the store replies.
WaitForPasswordStore();
- std::unique_ptr<BubbleObserver> prompt_observer(
- new BubbleObserver(WebContents()));
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
- EXPECT_FALSE(prompt_observer->IsShowingUpdatePrompt());
+ BubbleObserver prompt_observer(WebContents());
+ EXPECT_FALSE(prompt_observer.IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer.IsShowingUpdatePrompt());
signin_form.skip_zero_click = false;
signin_form.times_used = 1;
signin_form.password_value = base::ASCIIToUTF16("API");
« 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