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

Side by Side Diff: chrome/browser/autofill/autofill_manager_unittest.cc

Issue 10797017: base: Make ScopedVector::clear() destroy elements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update location_bar_view_mac.mm Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 virtual void RemoveCreditCard(const std::string& guid) OVERRIDE { 116 virtual void RemoveCreditCard(const std::string& guid) OVERRIDE {
117 CreditCard* credit_card = GetCreditCardWithGUID(guid.c_str()); 117 CreditCard* credit_card = GetCreditCardWithGUID(guid.c_str());
118 118
119 credit_cards_.erase( 119 credit_cards_.erase(
120 std::remove(credit_cards_.begin(), credit_cards_.end(), credit_card), 120 std::remove(credit_cards_.begin(), credit_cards_.end(), credit_card),
121 credit_cards_.end()); 121 credit_cards_.end());
122 } 122 }
123 123
124 void ClearAutofillProfiles() { 124 void ClearAutofillProfiles() {
125 web_profiles_.reset(); 125 web_profiles_.clear();
126 } 126 }
127 127
128 void ClearCreditCards() { 128 void ClearCreditCards() {
129 credit_cards_.reset(); 129 credit_cards_.clear();
130 } 130 }
131 131
132 void CreateTestCreditCardsYearAndMonth(const char* year, const char* month) { 132 void CreateTestCreditCardsYearAndMonth(const char* year, const char* month) {
133 ClearCreditCards(); 133 ClearCreditCards();
134 CreditCard* credit_card = new CreditCard; 134 CreditCard* credit_card = new CreditCard;
135 autofill_test::SetCreditCardInfo(credit_card, "Miku Hatsune", 135 autofill_test::SetCreditCardInfo(credit_card, "Miku Hatsune",
136 "4234567890654321", // Visa 136 "4234567890654321", // Visa
137 month, year); 137 month, year);
138 credit_card->set_guid("00000000-0000-0000-0000-000000000007"); 138 credit_card->set_guid("00000000-0000-0000-0000-000000000007");
139 credit_cards_.push_back(credit_card); 139 credit_cards_.push_back(credit_card);
(...skipping 2988 matching lines...) Expand 10 before | Expand all | Expand 10 after
3128 3128
3129 AutofillManager* autofill_manager = tab_contents()->autofill_manager(); 3129 AutofillManager* autofill_manager = tab_contents()->autofill_manager();
3130 EXPECT_TRUE(autofill_manager->external_delegate()); 3130 EXPECT_TRUE(autofill_manager->external_delegate());
3131 3131
3132 AutocompleteHistoryManager* autocomplete_history_manager = 3132 AutocompleteHistoryManager* autocomplete_history_manager =
3133 tab_contents()->autocomplete_history_manager(); 3133 tab_contents()->autocomplete_history_manager();
3134 EXPECT_TRUE(autocomplete_history_manager->external_delegate()); 3134 EXPECT_TRUE(autocomplete_history_manager->external_delegate());
3135 } 3135 }
3136 3136
3137 #endif // OS_ANDROID 3137 #endif // OS_ANDROID
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_manager.cc ('k') | chrome/browser/autofill/autofill_merge_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698