| 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/message_loop.h" | 6 #include "base/message_loop/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 27 matching lines...) Expand all Loading... |
| 38 const std::string& d, | 38 const std::string& d, |
| 39 const std::string& c) { | 39 const std::string& c) { |
| 40 std::set<std::string> set = Set(a, b, c); | 40 std::set<std::string> set = Set(a, b, c); |
| 41 set.insert(d); | 41 set.insert(d); |
| 42 return set; | 42 return set; |
| 43 } | 43 } |
| 44 | 44 |
| 45 class BlacklistTest : public testing::Test { | 45 class BlacklistTest : public testing::Test { |
| 46 public: | 46 public: |
| 47 BlacklistTest() | 47 BlacklistTest() |
| 48 : test_prefs_(base::MessageLoopProxy::current()), | 48 : test_prefs_(base::MessageLoopProxy::current(), NULL), |
| 49 blacklist_db_(new FakeSafeBrowsingDatabaseManager(false)), | 49 blacklist_db_(new FakeSafeBrowsingDatabaseManager(false)), |
| 50 scoped_blacklist_db_(blacklist_db_) {} | 50 scoped_blacklist_db_(blacklist_db_) {} |
| 51 | 51 |
| 52 protected: | 52 protected: |
| 53 ExtensionPrefs* prefs() { | 53 ExtensionPrefs* prefs() { |
| 54 return test_prefs_.prefs(); | 54 return test_prefs_.prefs(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 FakeSafeBrowsingDatabaseManager* blacklist_db() { | 57 FakeSafeBrowsingDatabaseManager* blacklist_db() { |
| 58 return blacklist_db_.get(); | 58 return blacklist_db_.get(); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 // Prefs are still unaffected for installed extensions, though. | 157 // Prefs are still unaffected for installed extensions, though. |
| 158 EXPECT_TRUE(prefs()->IsExtensionBlacklisted(a)); | 158 EXPECT_TRUE(prefs()->IsExtensionBlacklisted(a)); |
| 159 EXPECT_FALSE(prefs()->IsExtensionBlacklisted(b)); | 159 EXPECT_FALSE(prefs()->IsExtensionBlacklisted(b)); |
| 160 EXPECT_FALSE(prefs()->IsExtensionBlacklisted(c)); | 160 EXPECT_FALSE(prefs()->IsExtensionBlacklisted(c)); |
| 161 EXPECT_FALSE(prefs()->IsExtensionBlacklisted(d)); | 161 EXPECT_FALSE(prefs()->IsExtensionBlacklisted(d)); |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace | 164 } // namespace |
| 165 } // namespace extensions | 165 } // namespace extensions |
| OLD | NEW |