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

Side by Side Diff: components/autofill/core/browser/autofill_test_utils.cc

Issue 2719723002: [Autofill] Split server card data and metadata updates. (Closed)
Patch Set: Used AutofillClock in test Created 3 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/autofill/core/browser/autofill_test_utils.h" 5 #include "components/autofill/core/browser/autofill_test_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 } 318 }
319 319
320 void SetServerCreditCards(AutofillTable* table, 320 void SetServerCreditCards(AutofillTable* table,
321 const std::vector<CreditCard>& cards) { 321 const std::vector<CreditCard>& cards) {
322 std::vector<CreditCard> as_masked_cards = cards; 322 std::vector<CreditCard> as_masked_cards = cards;
323 for (CreditCard& card : as_masked_cards) { 323 for (CreditCard& card : as_masked_cards) {
324 card.set_record_type(CreditCard::MASKED_SERVER_CARD); 324 card.set_record_type(CreditCard::MASKED_SERVER_CARD);
325 std::string type = card.type(); 325 std::string type = card.type();
326 card.SetNumber(card.LastFourDigits()); 326 card.SetNumber(card.LastFourDigits());
327 card.SetTypeForMaskedCard(type.c_str()); 327 card.SetTypeForMaskedCard(type.c_str());
328 table->UpdateServerCardMetadata(card);
328 } 329 }
329 table->SetServerCreditCards(as_masked_cards); 330 table->SetServerCreditCards(as_masked_cards);
330 331
331 for (const CreditCard& card : cards) { 332 for (const CreditCard& card : cards) {
332 if (card.record_type() != CreditCard::FULL_SERVER_CARD) 333 if (card.record_type() != CreditCard::FULL_SERVER_CARD)
333 continue; 334 continue;
334 335
335 table->UnmaskServerCreditCard(card, card.number()); 336 table->UnmaskServerCreditCard(card, card.number());
336 } 337 }
337 } 338 }
(...skipping 20 matching lines...) Expand all
358 const char* control_type) { 359 const char* control_type) {
359 field->set_signature(signature); 360 field->set_signature(signature);
360 if (name) 361 if (name)
361 field->set_name(name); 362 field->set_name(name);
362 if (control_type) 363 if (control_type)
363 field->set_type(control_type); 364 field->set_type(control_type);
364 } 365 }
365 366
366 } // namespace test 367 } // namespace test
367 } // namespace autofill 368 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698