Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/browser/privacy_blacklist/blacklist_manager_browsertest.cc

Issue 361030: Fix threading issues in BlacklistManager, using new ChromeThread. (Closed)
Patch Set: fix compile after the dtor has been made private Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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( 36 blacklist_manager_ = new BlacklistManager(profile,
37 profile, profile->GetExtensionsService(), 37 profile->GetExtensionsService());
38 g_browser_process->io_thread());
39 WaitForBlacklistUpdate(); 38 WaitForBlacklistUpdate();
40 } 39 }
41 40
42 virtual void CleanUpOnMainThread() { 41 virtual void CleanUpOnMainThread() {
43 blacklist_manager_ = NULL; 42 blacklist_manager_ = NULL;
44 ExtensionBrowserTest::CleanUpOnMainThread(); 43 ExtensionBrowserTest::CleanUpOnMainThread();
45 } 44 }
46 45
47 // NotificationObserver 46 // NotificationObserver
48 virtual void Observe(NotificationType type, 47 virtual void Observe(NotificationType type,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 browser()->profile()->GetExtensionsService(); 90 browser()->profile()->GetExtensionsService();
92 ASSERT_EQ(1U, extensions_service->extensions()->size()); 91 ASSERT_EQ(1U, extensions_service->extensions()->size());
93 UnloadExtension(extensions_service->extensions()->front()->id()); 92 UnloadExtension(extensions_service->extensions()->front()->id());
94 if (BlacklistHasMatch(blacklist_manager_->GetCompiledBlacklist(), 93 if (BlacklistHasMatch(blacklist_manager_->GetCompiledBlacklist(),
95 kTestUrl)) { 94 kTestUrl)) {
96 WaitForBlacklistUpdate(); 95 WaitForBlacklistUpdate();
97 } 96 }
98 EXPECT_FALSE(BlacklistHasMatch(blacklist_manager_->GetCompiledBlacklist(), 97 EXPECT_FALSE(BlacklistHasMatch(blacklist_manager_->GetCompiledBlacklist(),
99 kTestUrl)); 98 kTestUrl));
100 } 99 }
OLDNEW
« no previous file with comments | « chrome/browser/privacy_blacklist/blacklist_manager.cc ('k') | chrome/browser/privacy_blacklist/blacklist_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698