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

Unified Diff: chrome/browser/extensions/test_blacklist.cc

Issue 11415216: Make Blacklist::IsBlacklist asynchronous (it will need to be for safe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix another test Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/test_blacklist.h ('k') | chrome/browser/extensions/test_extension_system.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/test_blacklist.cc
diff --git a/chrome/browser/extensions/test_blacklist.cc b/chrome/browser/extensions/test_blacklist.cc
new file mode 100644
index 0000000000000000000000000000000000000000..138804decfcafb44340020895e2885a234fc46dd
--- /dev/null
+++ b/chrome/browser/extensions/test_blacklist.cc
@@ -0,0 +1,40 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/test_blacklist.h"
+
+#include <set>
+
+#include "base/bind.h"
+#include "base/message_loop.h"
+#include "base/run_loop.h"
+#include "chrome/browser/extensions/blacklist.h"
+
+namespace extensions {
+
+TestBlacklist::TestBlacklist(Blacklist* blacklist)
+ : blacklist_(blacklist) {
+}
+
+namespace {
+
+void Assign(std::set<std::string>* out, const std::set<std::string>& in) {
+ *out = in;
+}
+
+} // namespace
+
+bool TestBlacklist::IsBlacklisted(const std::string& extension_id) {
+ std::set<std::string> id_set;
+ id_set.insert(extension_id);
+ std::set<std::string> blacklist_set;
+ blacklist_->GetBlacklistedIDs(id_set,
+ base::Bind(&Assign, &blacklist_set));
+ base::RunLoop run_loop;
+ MessageLoop::current()->PostTask(FROM_HERE, run_loop.QuitClosure());
+ run_loop.Run();
+ return blacklist_set.count(extension_id) > 0;
+}
+
+} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/test_blacklist.h ('k') | chrome/browser/extensions/test_extension_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698