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

Side by Side Diff: chrome/browser/extensions/blacklist_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 months 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698