OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "chrome/browser/extensions/blacklist.h" | 8 #include "chrome/browser/extensions/blacklist.h" |
9 #include "chrome/browser/extensions/extension_prefs.h" | 9 #include "chrome/browser/extensions/extension_prefs.h" |
10 #include "chrome/browser/extensions/fake_safe_browsing_database_manager.h" | 10 #include "chrome/browser/extensions/fake_safe_browsing_database_manager.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 new FakeSafeBrowsingDatabaseManager()), | 26 new FakeSafeBrowsingDatabaseManager()), |
27 scoped_blacklist_database_manager_(safe_browsing_database_manager_), | 27 scoped_blacklist_database_manager_(safe_browsing_database_manager_), |
28 blacklist_(prefs_.prefs()) { | 28 blacklist_(prefs_.prefs()) { |
29 } | 29 } |
30 | 30 |
31 bool IsBlacklisted(const Extension* extension) { | 31 bool IsBlacklisted(const Extension* extension) { |
32 return TestBlacklist(&blacklist_).IsBlacklisted(extension->id()); | 32 return TestBlacklist(&blacklist_).IsBlacklisted(extension->id()); |
33 } | 33 } |
34 | 34 |
35 protected: | 35 protected: |
36 MessageLoop message_loop_; | 36 base::MessageLoop message_loop_; |
37 | 37 |
38 TestExtensionPrefs prefs_; | 38 TestExtensionPrefs prefs_; |
39 | 39 |
40 content::TestBrowserThread ui_thread_; | 40 content::TestBrowserThread ui_thread_; |
41 content::TestBrowserThread io_thread_; | 41 content::TestBrowserThread io_thread_; |
42 | 42 |
43 scoped_refptr<FakeSafeBrowsingDatabaseManager> | 43 scoped_refptr<FakeSafeBrowsingDatabaseManager> |
44 safe_browsing_database_manager_; | 44 safe_browsing_database_manager_; |
45 Blacklist::ScopedDatabaseManagerForTest scoped_blacklist_database_manager_; | 45 Blacklist::ScopedDatabaseManagerForTest scoped_blacklist_database_manager_; |
46 | 46 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 bc.insert(extension_c->id()); | 196 bc.insert(extension_c->id()); |
197 safe_browsing_database_manager_->set_unsafe_ids(bc); | 197 safe_browsing_database_manager_->set_unsafe_ids(bc); |
198 } | 198 } |
199 EXPECT_FALSE(IsBlacklisted(extension_a)); | 199 EXPECT_FALSE(IsBlacklisted(extension_a)); |
200 EXPECT_TRUE(IsBlacklisted(extension_b)); | 200 EXPECT_TRUE(IsBlacklisted(extension_b)); |
201 EXPECT_TRUE(IsBlacklisted(extension_c)); | 201 EXPECT_TRUE(IsBlacklisted(extension_c)); |
202 } | 202 } |
203 | 203 |
204 } // namespace extensions | 204 } // namespace extensions |
205 } // namespace | 205 } // namespace |
OLD | NEW |