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

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

Issue 1112573002: [chrome/browser/extensions] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed other nits Created 5 years, 7 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
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/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 "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/thread_task_runner_handle.h"
9 #include "chrome/browser/extensions/blacklist.h" 10 #include "chrome/browser/extensions/blacklist.h"
10 #include "chrome/browser/extensions/blacklist_state_fetcher.h" 11 #include "chrome/browser/extensions/blacklist_state_fetcher.h"
11 #include "chrome/browser/extensions/fake_safe_browsing_database_manager.h" 12 #include "chrome/browser/extensions/fake_safe_browsing_database_manager.h"
12 #include "chrome/browser/extensions/test_blacklist.h" 13 #include "chrome/browser/extensions/test_blacklist.h"
13 #include "chrome/browser/extensions/test_blacklist_state_fetcher.h" 14 #include "chrome/browser/extensions/test_blacklist_state_fetcher.h"
14 #include "chrome/browser/extensions/test_extension_prefs.h" 15 #include "chrome/browser/extensions/test_extension_prefs.h"
15 #include "content/public/test/test_browser_thread_bundle.h" 16 #include "content/public/test/test_browser_thread_bundle.h"
16 #include "extensions/browser/extension_prefs.h" 17 #include "extensions/browser/extension_prefs.h"
17 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
18 19
(...skipping 22 matching lines...) Expand all
41 const std::string& c, 42 const std::string& c,
42 const std::string& d) { 43 const std::string& d) {
43 std::set<std::string> set = Set(a, b, c); 44 std::set<std::string> set = Set(a, b, c);
44 set.insert(d); 45 set.insert(d);
45 return set; 46 return set;
46 } 47 }
47 48
48 class BlacklistTest : public testing::Test { 49 class BlacklistTest : public testing::Test {
49 public: 50 public:
50 BlacklistTest() 51 BlacklistTest()
51 : test_prefs_(base::MessageLoopProxy::current()) {} 52 : test_prefs_(base::ThreadTaskRunnerHandle::Get()) {}
52 53
53 protected: 54 protected:
54 ExtensionPrefs* prefs() { 55 ExtensionPrefs* prefs() {
55 return test_prefs_.prefs(); 56 return test_prefs_.prefs();
56 } 57 }
57 58
58 std::string AddExtension(const std::string& id) { 59 std::string AddExtension(const std::string& id) {
59 return test_prefs_.AddExtension(id)->id(); 60 return test_prefs_.AddExtension(id)->id();
60 } 61 }
61 62
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 base::RunLoop().RunUntilIdle(); 254 base::RunLoop().RunUntilIdle();
254 255
255 // No new fetchers. 256 // No new fetchers.
256 EXPECT_FALSE(fetcher_tester.HandleFetcher(2)); 257 EXPECT_FALSE(fetcher_tester.HandleFetcher(2));
257 EXPECT_EQ(BLACKLISTED_CWS_POLICY_VIOLATION, cached_states[a]); 258 EXPECT_EQ(BLACKLISTED_CWS_POLICY_VIOLATION, cached_states[a]);
258 EXPECT_EQ(BLACKLISTED_POTENTIALLY_UNWANTED, cached_states[b]); 259 EXPECT_EQ(BLACKLISTED_POTENTIALLY_UNWANTED, cached_states[b]);
259 EXPECT_EQ(0U, cached_states.count(c)); 260 EXPECT_EQ(0U, cached_states.count(c));
260 } 261 }
261 262
262 } // namespace extensions 263 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698