| 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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 MockDomainReliabilityService* const service; | 737 MockDomainReliabilityService* const service; |
| 738 bool attached; | 738 bool attached; |
| 739 | 739 |
| 740 static const void* kKey; | 740 static const void* kKey; |
| 741 }; | 741 }; |
| 742 | 742 |
| 743 // static | 743 // static |
| 744 const void* TestingDomainReliabilityServiceFactoryUserData::kKey = | 744 const void* TestingDomainReliabilityServiceFactoryUserData::kKey = |
| 745 &TestingDomainReliabilityServiceFactoryUserData::kKey; | 745 &TestingDomainReliabilityServiceFactoryUserData::kKey; |
| 746 | 746 |
| 747 KeyedService* TestingDomainReliabilityServiceFactoryFunction( | 747 scoped_ptr<KeyedService> TestingDomainReliabilityServiceFactoryFunction( |
| 748 content::BrowserContext* context) { | 748 content::BrowserContext* context) { |
| 749 const void* kKey = TestingDomainReliabilityServiceFactoryUserData::kKey; | 749 const void* kKey = TestingDomainReliabilityServiceFactoryUserData::kKey; |
| 750 | 750 |
| 751 TestingDomainReliabilityServiceFactoryUserData* data = | 751 TestingDomainReliabilityServiceFactoryUserData* data = |
| 752 static_cast<TestingDomainReliabilityServiceFactoryUserData*>( | 752 static_cast<TestingDomainReliabilityServiceFactoryUserData*>( |
| 753 context->GetUserData(kKey)); | 753 context->GetUserData(kKey)); |
| 754 EXPECT_TRUE(data); | 754 EXPECT_TRUE(data); |
| 755 EXPECT_EQ(data->context, context); | 755 EXPECT_EQ(data->context, context); |
| 756 EXPECT_FALSE(data->attached); | 756 EXPECT_FALSE(data->attached); |
| 757 | 757 |
| 758 data->attached = true; | 758 data->attached = true; |
| 759 return data->service; | 759 return make_scoped_ptr(data->service); |
| 760 } | 760 } |
| 761 | 761 |
| 762 class ClearDomainReliabilityTester { | 762 class ClearDomainReliabilityTester { |
| 763 public: | 763 public: |
| 764 explicit ClearDomainReliabilityTester(TestingProfile* profile) : | 764 explicit ClearDomainReliabilityTester(TestingProfile* profile) : |
| 765 profile_(profile), | 765 profile_(profile), |
| 766 mock_service_(new MockDomainReliabilityService()) { | 766 mock_service_(new MockDomainReliabilityService()) { |
| 767 AttachService(); | 767 AttachService(); |
| 768 } | 768 } |
| 769 | 769 |
| (...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1978 // TODO(ttuttle): This isn't actually testing the no-monitor case, since | 1978 // TODO(ttuttle): This isn't actually testing the no-monitor case, since |
| 1979 // BrowsingDataRemoverTest now creates one unconditionally, since it's needed | 1979 // BrowsingDataRemoverTest now creates one unconditionally, since it's needed |
| 1980 // for some unrelated test cases. This should be fixed so it tests the no- | 1980 // for some unrelated test cases. This should be fixed so it tests the no- |
| 1981 // monitor case again. | 1981 // monitor case again. |
| 1982 TEST_F(BrowsingDataRemoverTest, DISABLED_DomainReliability_NoMonitor) { | 1982 TEST_F(BrowsingDataRemoverTest, DISABLED_DomainReliability_NoMonitor) { |
| 1983 BlockUntilBrowsingDataRemoved( | 1983 BlockUntilBrowsingDataRemoved( |
| 1984 BrowsingDataRemover::EVERYTHING, | 1984 BrowsingDataRemover::EVERYTHING, |
| 1985 BrowsingDataRemover::REMOVE_HISTORY | | 1985 BrowsingDataRemover::REMOVE_HISTORY | |
| 1986 BrowsingDataRemover::REMOVE_COOKIES, false); | 1986 BrowsingDataRemover::REMOVE_COOKIES, false); |
| 1987 } | 1987 } |
| OLD | NEW |