Chromium Code Reviews| Index: chrome/browser/autofill/autofill_manager_unittest.cc |
| diff --git a/chrome/browser/autofill/autofill_manager_unittest.cc b/chrome/browser/autofill/autofill_manager_unittest.cc |
| index e3d912bbbf1f5dd22dcf0105cef71cdc5496d341..ed23d54714d2dff060af5b28bc8dff0c1845e7c1 100644 |
| --- a/chrome/browser/autofill/autofill_manager_unittest.cc |
| +++ b/chrome/browser/autofill/autofill_manager_unittest.cc |
| @@ -672,9 +672,10 @@ TEST_F(AutofillManagerTest, GetProfileSuggestionsWithDuplicates) { |
| FormsSeen(forms); |
| // Add a duplicate profile. |
| - AutoFillProfile* duplicate_profile = static_cast<AutoFillProfile*>( |
| - autofill_manager_->GetProfileWithGUID( |
| - "00000000-0000-0000-0000-000000000001")->Clone()); |
| + AutoFillProfile* duplicate_profile = |
| + new AutoFillProfile( |
| + *(autofill_manager_->GetProfileWithGUID( |
| + "00000000-0000-0000-0000-000000000001"))); |
|
Ilya Sherman
2011/03/09 00:50:50
Won't this leak memory? Or did we have a double-f
dhollowa
2011/03/09 01:55:47
No, this AddProfile call takes ownership. It adds
|
| autofill_manager_->AddProfile(duplicate_profile); |
| const FormField& field = form.fields[0]; |