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

Unified Diff: components/autofill/core/common/password_form_fill_data_unittest.cc

Issue 1096983002: Update usages of std::map to use ScopedPtrMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@passwordmanager-scopedmemory
Patch Set: Rebase. Created 5 years, 6 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 | « components/autofill/core/common/password_form.h ('k') | components/gcm_driver/gcm_client_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/common/password_form_fill_data_unittest.cc
diff --git a/components/autofill/core/common/password_form_fill_data_unittest.cc b/components/autofill/core/common/password_form_fill_data_unittest.cc
index 528a7ad51288b1c0ba85fe8bd23c742aa74edb22..aafb4732d446803a7d1696ef752e5818476b6b5b 100644
--- a/components/autofill/core/common/password_form_fill_data_unittest.cc
+++ b/components/autofill/core/common/password_form_fill_data_unittest.cc
@@ -4,6 +4,7 @@
#include "components/autofill/core/common/password_form_fill_data.h"
+#include "base/memory/scoped_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/common/password_form.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -109,7 +110,8 @@ TEST(PasswordFormFillDataTest, TestPublicSuffixDomainMatching) {
preferred_match.scheme = PasswordForm::SCHEME_HTML;
// Create a match that matches exactly, so |original_signon_realm| is not set.
- PasswordForm exact_match;
+ scoped_ptr<PasswordForm> scoped_exact_match(new PasswordForm);
+ PasswordForm& exact_match = *scoped_exact_match;
exact_match.origin = GURL("https://foo.com/");
exact_match.action = GURL("https://foo.com/login");
exact_match.username_element = ASCIIToUTF16("username");
@@ -124,7 +126,8 @@ TEST(PasswordFormFillDataTest, TestPublicSuffixDomainMatching) {
// Create a match that was matched using public suffix, so
// |original_signon_realm| is set to where the result came from.
- PasswordForm public_suffix_match;
+ scoped_ptr<PasswordForm> scoped_public_suffix_match(new PasswordForm);
+ PasswordForm& public_suffix_match = *scoped_public_suffix_match;
public_suffix_match.origin = GURL("https://foo.com/");
public_suffix_match.action = GURL("https://foo.com/login");
public_suffix_match.username_element = ASCIIToUTF16("username");
@@ -140,8 +143,9 @@ TEST(PasswordFormFillDataTest, TestPublicSuffixDomainMatching) {
// Add one exact match and one public suffix match.
PasswordFormMap matches;
- matches[exact_match.username_value] = &exact_match;
- matches[public_suffix_match.username_value] = &public_suffix_match;
+ matches.insert(exact_match.username_value, scoped_exact_match.Pass());
+ matches.insert(public_suffix_match.username_value,
+ scoped_public_suffix_match.Pass());
PasswordFormFillData result;
InitPasswordFormFillData(form_on_page,
« no previous file with comments | « components/autofill/core/common/password_form.h ('k') | components/gcm_driver/gcm_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698