OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/privacy_blacklist/blacklist_manager.h" | 5 #include "chrome/browser/privacy_blacklist/blacklist_manager.h" |
6 | 6 |
7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 delete match; | 26 delete match; |
27 return true; | 27 return true; |
28 } | 28 } |
29 | 29 |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 class BlacklistManagerBrowserTest : public ExtensionBrowserTest { | 32 class BlacklistManagerBrowserTest : public ExtensionBrowserTest { |
33 public: | 33 public: |
34 void InitializeBlacklistManager() { | 34 void InitializeBlacklistManager() { |
35 Profile* profile = browser()->profile(); | 35 Profile* profile = browser()->profile(); |
36 blacklist_manager_ = new BlacklistManager(profile, | 36 blacklist_manager_ = new BlacklistManager(); |
37 profile->GetExtensionsService()); | 37 blacklist_manager_->Initialize(profile, profile->GetExtensionsService()); |
38 WaitForBlacklistUpdate(); | 38 WaitForBlacklistUpdate(); |
39 } | 39 } |
40 | 40 |
41 virtual void CleanUpOnMainThread() { | 41 virtual void CleanUpOnMainThread() { |
42 blacklist_manager_ = NULL; | 42 blacklist_manager_ = NULL; |
43 ExtensionBrowserTest::CleanUpOnMainThread(); | 43 ExtensionBrowserTest::CleanUpOnMainThread(); |
44 } | 44 } |
45 | 45 |
46 // NotificationObserver | 46 // NotificationObserver |
47 virtual void Observe(NotificationType type, | 47 virtual void Observe(NotificationType type, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 browser()->profile()->GetExtensionsService(); | 90 browser()->profile()->GetExtensionsService(); |
91 ASSERT_EQ(1U, extensions_service->extensions()->size()); | 91 ASSERT_EQ(1U, extensions_service->extensions()->size()); |
92 UnloadExtension(extensions_service->extensions()->front()->id()); | 92 UnloadExtension(extensions_service->extensions()->front()->id()); |
93 if (BlacklistHasMatch(blacklist_manager_->GetCompiledBlacklist(), | 93 if (BlacklistHasMatch(blacklist_manager_->GetCompiledBlacklist(), |
94 kTestUrl)) { | 94 kTestUrl)) { |
95 WaitForBlacklistUpdate(); | 95 WaitForBlacklistUpdate(); |
96 } | 96 } |
97 EXPECT_FALSE(BlacklistHasMatch(blacklist_manager_->GetCompiledBlacklist(), | 97 EXPECT_FALSE(BlacklistHasMatch(blacklist_manager_->GetCompiledBlacklist(), |
98 kTestUrl)); | 98 kTestUrl)); |
99 } | 99 } |
OLD | NEW |