| OLD | NEW |
| 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 "chrome/browser/browsing_data/browsing_data_remover.h" | 5 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 personal_data_manager_->AddObserver(this); | 386 personal_data_manager_->AddObserver(this); |
| 387 } | 387 } |
| 388 | 388 |
| 389 virtual ~RemoveAutofillTester() { | 389 virtual ~RemoveAutofillTester() { |
| 390 personal_data_manager_->RemoveObserver(this); | 390 personal_data_manager_->RemoveObserver(this); |
| 391 } | 391 } |
| 392 | 392 |
| 393 // Returns true if there are autofill profiles. | 393 // Returns true if there are autofill profiles. |
| 394 bool HasProfile() { | 394 bool HasProfile() { |
| 395 return !personal_data_manager_->GetProfiles().empty() && | 395 return !personal_data_manager_->GetProfiles().empty() && |
| 396 !personal_data_manager_->credit_cards().empty(); | 396 !personal_data_manager_->GetCreditCards().empty(); |
| 397 } | 397 } |
| 398 | 398 |
| 399 void AddProfile() { | 399 void AddProfile() { |
| 400 autofill::AutofillProfile profile; | 400 autofill::AutofillProfile profile; |
| 401 profile.SetRawInfo(autofill::NAME_FIRST, ASCIIToUTF16("Bob")); | 401 profile.SetRawInfo(autofill::NAME_FIRST, ASCIIToUTF16("Bob")); |
| 402 profile.SetRawInfo(autofill::NAME_LAST, ASCIIToUTF16("Smith")); | 402 profile.SetRawInfo(autofill::NAME_LAST, ASCIIToUTF16("Smith")); |
| 403 profile.SetRawInfo(autofill::ADDRESS_HOME_ZIP, ASCIIToUTF16("94043")); | 403 profile.SetRawInfo(autofill::ADDRESS_HOME_ZIP, ASCIIToUTF16("94043")); |
| 404 profile.SetRawInfo(autofill::EMAIL_ADDRESS, | 404 profile.SetRawInfo(autofill::EMAIL_ADDRESS, |
| 405 ASCIIToUTF16("sue@example.com")); | 405 ASCIIToUTF16("sue@example.com")); |
| 406 profile.SetRawInfo(autofill::COMPANY_NAME, ASCIIToUTF16("Company X")); | 406 profile.SetRawInfo(autofill::COMPANY_NAME, ASCIIToUTF16("Company X")); |
| (...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1330 ASSERT_TRUE(tester.HasProfile()); | 1330 ASSERT_TRUE(tester.HasProfile()); |
| 1331 | 1331 |
| 1332 BlockUntilBrowsingDataRemoved( | 1332 BlockUntilBrowsingDataRemoved( |
| 1333 BrowsingDataRemover::EVERYTHING, | 1333 BrowsingDataRemover::EVERYTHING, |
| 1334 BrowsingDataRemover::REMOVE_FORM_DATA, false); | 1334 BrowsingDataRemover::REMOVE_FORM_DATA, false); |
| 1335 | 1335 |
| 1336 EXPECT_EQ(BrowsingDataRemover::REMOVE_FORM_DATA, GetRemovalMask()); | 1336 EXPECT_EQ(BrowsingDataRemover::REMOVE_FORM_DATA, GetRemovalMask()); |
| 1337 EXPECT_EQ(BrowsingDataHelper::UNPROTECTED_WEB, GetOriginSetMask()); | 1337 EXPECT_EQ(BrowsingDataHelper::UNPROTECTED_WEB, GetOriginSetMask()); |
| 1338 ASSERT_FALSE(tester.HasProfile()); | 1338 ASSERT_FALSE(tester.HasProfile()); |
| 1339 } | 1339 } |
| OLD | NEW |