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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 card.set_guid(base::GenerateGUID()); | 644 card.set_guid(base::GenerateGUID()); |
645 card.set_origin(kChromeOrigin); | 645 card.set_origin(kChromeOrigin); |
646 cards.push_back(card); | 646 cards.push_back(card); |
647 | 647 |
648 personal_data_manager_->SetCreditCards(&cards); | 648 personal_data_manager_->SetCreditCards(&cards); |
649 base::MessageLoop::current()->Run(); | 649 base::MessageLoop::current()->Run(); |
650 } | 650 } |
651 | 651 |
652 private: | 652 private: |
653 void OnPersonalDataChanged() override { | 653 void OnPersonalDataChanged() override { |
654 base::MessageLoop::current()->Quit(); | 654 base::MessageLoop::current()->QuitWhenIdle(); |
655 } | 655 } |
656 | 656 |
657 autofill::PersonalDataManager* personal_data_manager_; | 657 autofill::PersonalDataManager* personal_data_manager_; |
658 DISALLOW_COPY_AND_ASSIGN(RemoveAutofillTester); | 658 DISALLOW_COPY_AND_ASSIGN(RemoveAutofillTester); |
659 }; | 659 }; |
660 | 660 |
661 class RemoveLocalStorageTester { | 661 class RemoveLocalStorageTester { |
662 public: | 662 public: |
663 explicit RemoveLocalStorageTester(TestingProfile* profile) | 663 explicit RemoveLocalStorageTester(TestingProfile* profile) |
664 : profile_(profile) { | 664 : profile_(profile) { |
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2111 TEST_F(BrowsingDataRemoverTest, RemoveSameOriginDownloads) { | 2111 TEST_F(BrowsingDataRemoverTest, RemoveSameOriginDownloads) { |
2112 RemoveDownloadsTester tester(GetProfile()); | 2112 RemoveDownloadsTester tester(GetProfile()); |
2113 const url::Origin expectedOrigin(kOrigin1); | 2113 const url::Origin expectedOrigin(kOrigin1); |
2114 | 2114 |
2115 EXPECT_CALL(*tester.download_manager(), | 2115 EXPECT_CALL(*tester.download_manager(), |
2116 RemoveDownloadsByOriginAndTime(SameOrigin(expectedOrigin), _, _)); | 2116 RemoveDownloadsByOriginAndTime(SameOrigin(expectedOrigin), _, _)); |
2117 | 2117 |
2118 BlockUntilOriginDataRemoved(BrowsingDataRemover::EVERYTHING, | 2118 BlockUntilOriginDataRemoved(BrowsingDataRemover::EVERYTHING, |
2119 BrowsingDataRemover::REMOVE_DOWNLOADS, kOrigin1); | 2119 BrowsingDataRemover::REMOVE_DOWNLOADS, kOrigin1); |
2120 } | 2120 } |
OLD | NEW |