OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/suggestions/blacklist_store.h" | 5 #include "components/suggestions/blacklist_store.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
51 } // namespace | 51 } // namespace |
52 | 52 |
53 class BlacklistStoreTest : public testing::Test { | 53 class BlacklistStoreTest : public testing::Test { |
54 public: | 54 public: |
55 BlacklistStoreTest() | 55 BlacklistStoreTest() |
56 : pref_service_(new user_prefs::TestingPrefServiceSyncable) {} | 56 : pref_service_(new user_prefs::TestingPrefServiceSyncable) {} |
57 | 57 |
58 virtual void SetUp() OVERRIDE { | 58 virtual void SetUp() override { |
59 BlacklistStore::RegisterProfilePrefs(pref_service()->registry()); | 59 BlacklistStore::RegisterProfilePrefs(pref_service()->registry()); |
60 } | 60 } |
61 | 61 |
62 user_prefs::TestingPrefServiceSyncable* pref_service() { | 62 user_prefs::TestingPrefServiceSyncable* pref_service() { |
63 return pref_service_.get(); | 63 return pref_service_.get(); |
64 } | 64 } |
65 | 65 |
66 private: | 66 private: |
67 scoped_ptr<user_prefs::TestingPrefServiceSyncable> pref_service_; | 67 scoped_ptr<user_prefs::TestingPrefServiceSyncable> pref_service_; |
68 | 68 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 // Create a new BlacklistStore and verify the counts. | 148 // Create a new BlacklistStore and verify the counts. |
149 blacklist_store.reset(new BlacklistStore(pref_service())); | 149 blacklist_store.reset(new BlacklistStore(pref_service())); |
150 | 150 |
151 histogram_tester.ExpectTotalCount("Suggestions.LocalBlacklistSize", 2); | 151 histogram_tester.ExpectTotalCount("Suggestions.LocalBlacklistSize", 2); |
152 histogram_tester.ExpectBucketCount("Suggestions.LocalBlacklistSize", 0, 1); | 152 histogram_tester.ExpectBucketCount("Suggestions.LocalBlacklistSize", 0, 1); |
153 histogram_tester.ExpectBucketCount("Suggestions.LocalBlacklistSize", 2, 1); | 153 histogram_tester.ExpectBucketCount("Suggestions.LocalBlacklistSize", 2, 1); |
154 } | 154 } |
155 | 155 |
156 } // namespace suggestions | 156 } // namespace suggestions |
OLD | NEW |