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/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
11 | 12 |
12 #include "base/test/histogram_tester.h" | 13 #include "base/test/histogram_tester.h" |
13 #include "components/pref_registry/testing_pref_service_syncable.h" | 14 #include "components/pref_registry/testing_pref_service_syncable.h" |
14 #include "components/suggestions/proto/suggestions.pb.h" | 15 #include "components/suggestions/proto/suggestions.pb.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
16 | 17 |
17 using user_prefs::TestingPrefServiceSyncable; | 18 using user_prefs::TestingPrefServiceSyncable; |
18 | 19 |
19 namespace suggestions { | 20 namespace suggestions { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 EXPECT_TRUE(blacklist_store->BlacklistUrl(GURL(kTestUrlB))); | 188 EXPECT_TRUE(blacklist_store->BlacklistUrl(GURL(kTestUrlB))); |
188 | 189 |
189 // Create a new BlacklistStore and verify the counts. | 190 // Create a new BlacklistStore and verify the counts. |
190 blacklist_store.reset(new BlacklistStore(pref_service())); | 191 blacklist_store.reset(new BlacklistStore(pref_service())); |
191 histogram_tester.ExpectTotalCount("Suggestions.LocalBlacklistSize", 2); | 192 histogram_tester.ExpectTotalCount("Suggestions.LocalBlacklistSize", 2); |
192 histogram_tester.ExpectBucketCount("Suggestions.LocalBlacklistSize", 0, 1); | 193 histogram_tester.ExpectBucketCount("Suggestions.LocalBlacklistSize", 0, 1); |
193 histogram_tester.ExpectBucketCount("Suggestions.LocalBlacklistSize", 2, 1); | 194 histogram_tester.ExpectBucketCount("Suggestions.LocalBlacklistSize", 2, 1); |
194 } | 195 } |
195 | 196 |
196 } // namespace suggestions | 197 } // namespace suggestions |
OLD | NEW |