OLD | NEW |
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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/guid.h" | 8 #include "base/guid.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 2114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2125 base::MessageLoop::current()->Run(); | 2125 base::MessageLoop::current()->Run(); |
2126 | 2126 |
2127 // Expect that the saved credit card is updated. | 2127 // Expect that the saved credit card is updated. |
2128 const std::vector<CreditCard*>& results = personal_data_->GetCreditCards(); | 2128 const std::vector<CreditCard*>& results = personal_data_->GetCreditCards(); |
2129 ASSERT_EQ(1U, results.size()); | 2129 ASSERT_EQ(1U, results.size()); |
2130 EXPECT_EQ(ASCIIToUTF16("B. Small"), results[0]->GetRawInfo(CREDIT_CARD_NAME)); | 2130 EXPECT_EQ(ASCIIToUTF16("B. Small"), results[0]->GetRawInfo(CREDIT_CARD_NAME)); |
2131 } | 2131 } |
2132 | 2132 |
2133 TEST_F(PersonalDataManagerTest, GetNonEmptyTypes) { | 2133 TEST_F(PersonalDataManagerTest, GetNonEmptyTypes) { |
2134 // Check that there are no available types with no profiles stored. | 2134 // Check that there are no available types with no profiles stored. |
2135 FieldTypeSet non_empty_types; | 2135 ServerFieldTypeSet non_empty_types; |
2136 personal_data_->GetNonEmptyTypes(&non_empty_types); | 2136 personal_data_->GetNonEmptyTypes(&non_empty_types); |
2137 EXPECT_EQ(0U, non_empty_types.size()); | 2137 EXPECT_EQ(0U, non_empty_types.size()); |
2138 | 2138 |
2139 // Test with one profile stored. | 2139 // Test with one profile stored. |
2140 AutofillProfile profile0(base::GenerateGUID(), "https://www.example.com"); | 2140 AutofillProfile profile0(base::GenerateGUID(), "https://www.example.com"); |
2141 test::SetProfileInfo(&profile0, | 2141 test::SetProfileInfo(&profile0, |
2142 "Marion", NULL, "Morrison", | 2142 "Marion", NULL, "Morrison", |
2143 "johnwayne@me.xyz", NULL, "123 Zoo St.", NULL, "Hollywood", "CA", | 2143 "johnwayne@me.xyz", NULL, "123 Zoo St.", NULL, "Hollywood", "CA", |
2144 "91601", "US", "14155678910"); | 2144 "91601", "US", "14155678910"); |
2145 | 2145 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2409 // Removing shouldn't work. | 2409 // Removing shouldn't work. |
2410 personal_data_->RemoveByGUID(steve_jobs.guid()); | 2410 personal_data_->RemoveByGUID(steve_jobs.guid()); |
2411 personal_data_->RemoveByGUID(bill_gates.guid()); | 2411 personal_data_->RemoveByGUID(bill_gates.guid()); |
2412 | 2412 |
2413 ResetPersonalDataManager(); | 2413 ResetPersonalDataManager(); |
2414 EXPECT_EQ(1U, personal_data_->GetProfiles().size()); | 2414 EXPECT_EQ(1U, personal_data_->GetProfiles().size()); |
2415 EXPECT_EQ(1U, personal_data_->GetCreditCards().size()); | 2415 EXPECT_EQ(1U, personal_data_->GetCreditCards().size()); |
2416 } | 2416 } |
2417 | 2417 |
2418 } // namespace autofill | 2418 } // namespace autofill |
OLD | NEW |