| 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..d6a4d26432f3ee870a4bb34e1ac1c9f09d46f2e5
|
| --- /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 IsBlacklistedCallback(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> blacklist_set;
|
| + blacklist_->IsBlacklisted(
|
| + extension_id,
|
| + base::Bind(&IsBlacklistedCallback, &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
|
|
|