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

Unified Diff: net/cert/nss_cert_database_chromeos_unittest.cc

Issue 2603173002: Use TaskScheduler instead of WorkerPool in nss_cert_database.cc. (Closed)
Patch Set: self-review Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/nss_cert_database_chromeos.cc ('k') | net/cert/nss_cert_database_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/nss_cert_database_chromeos_unittest.cc
diff --git a/net/cert/nss_cert_database_chromeos_unittest.cc b/net/cert/nss_cert_database_chromeos_unittest.cc
index 9cd226411e2939163de34f3c37cbdc004a0e2853..11710419460cce294a6b70031052b2628a3f4aa1 100644
--- a/net/cert/nss_cert_database_chromeos_unittest.cc
+++ b/net/cert/nss_cert_database_chromeos_unittest.cc
@@ -8,7 +8,9 @@
#include "base/bind.h"
#include "base/callback.h"
+#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "base/test/scoped_task_scheduler.h"
#include "base/threading/thread_task_runner_handle.h"
#include "crypto/nss_util_internal.h"
#include "crypto/scoped_test_nss_chromeos_user.h"
@@ -48,7 +50,10 @@ class NSSCertDatabaseChromeOSTest : public testing::Test,
public CertDatabase::Observer {
public:
NSSCertDatabaseChromeOSTest()
- : observer_added_(false), user_1_("user1"), user_2_("user2") {}
+ : scoped_task_scheduler_(base::MessageLoop::current()),
+ observer_added_(false),
+ user_1_("user1"),
+ user_2_("user2") {}
void SetUp() override {
// Initialize nss_util slots.
@@ -63,7 +68,6 @@ class NSSCertDatabaseChromeOSTest : public testing::Test,
crypto::GetPrivateSlotForChromeOSUser(
user_1_.username_hash(),
base::Callback<void(crypto::ScopedPK11Slot)>())));
- db_1_->SetSlowTaskRunnerForTest(base::ThreadTaskRunnerHandle::Get());
db_1_->SetSystemSlot(
crypto::ScopedPK11Slot(PK11_ReferenceSlot(system_db_.slot())));
db_2_.reset(new NSSCertDatabaseChromeOS(
@@ -71,7 +75,6 @@ class NSSCertDatabaseChromeOSTest : public testing::Test,
crypto::GetPrivateSlotForChromeOSUser(
user_2_.username_hash(),
base::Callback<void(crypto::ScopedPK11Slot)>())));
- db_2_->SetSlowTaskRunnerForTest(base::ThreadTaskRunnerHandle::Get());
// Add observer to CertDatabase for checking that notifications from
// NSSCertDatabaseChromeOS are proxied to the CertDatabase.
@@ -90,6 +93,8 @@ class NSSCertDatabaseChromeOSTest : public testing::Test,
}
protected:
+ base::test::ScopedTaskScheduler scoped_task_scheduler_;
+
bool observer_added_;
// Certificates that were passed to the CertDatabase observers.
std::vector<CERTCertificate*> added_ca_;
« no previous file with comments | « net/cert/nss_cert_database_chromeos.cc ('k') | net/cert/nss_cert_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698