Commit 4bd59ad2 authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

[scheduling] Use ScopedTaskEnvironment instead of MessageLoop in certificate_transparency

MessageLoop will go away, eventually.

BUG=891670

Change-Id: I044cd0590ade65e2a8620b0e9e4c463eb2d3c9ac
Reviewed-on: https://chromium-review.googlesource.com/c/1353879Reviewed-by: default avatarAsanka Herath <asanka@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#611740}
parent 3ec55a05
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
#include <iterator> #include <iterator>
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/sequenced_task_runner.h" #include "base/sequenced_task_runner.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "base/test/scoped_task_environment.h"
#include "base/test/test_message_loop.h" #include "base/test/test_message_loop.h"
#include "base/values.h" #include "base/values.h"
#include "components/certificate_transparency/pref_names.h" #include "components/certificate_transparency/pref_names.h"
...@@ -29,8 +29,6 @@ namespace { ...@@ -29,8 +29,6 @@ namespace {
class ChromeRequireCTDelegateTest : public ::testing::Test { class ChromeRequireCTDelegateTest : public ::testing::Test {
public: public:
ChromeRequireCTDelegateTest() : message_loop_(base::MessageLoop::TYPE_IO) {}
void SetUp() override { void SetUp() override {
cert_ = net::CreateCertificateChainFromFile( cert_ = net::CreateCertificateChainFromFile(
net::GetTestCertsDirectory(), "ok_cert.pem", net::GetTestCertsDirectory(), "ok_cert.pem",
...@@ -41,7 +39,8 @@ class ChromeRequireCTDelegateTest : public ::testing::Test { ...@@ -41,7 +39,8 @@ class ChromeRequireCTDelegateTest : public ::testing::Test {
} }
protected: protected:
base::TestMessageLoop message_loop_; base::test::ScopedTaskEnvironment task_environment_{
base::test::ScopedTaskEnvironment::MainThreadType::IO};
scoped_refptr<net::X509Certificate> cert_; scoped_refptr<net::X509Certificate> cert_;
net::HashValueVector hashes_; net::HashValueVector hashes_;
}; };
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
#include <vector> #include <vector>
#include "base/format_macros.h" #include "base/format_macros.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h" #include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_task_environment.h"
#include "base/test/test_timeouts.h" #include "base/test/test_timeouts.h"
#include "components/certificate_transparency/mock_log_dns_traffic.h" #include "components/certificate_transparency/mock_log_dns_traffic.h"
#include "crypto/sha2.h" #include "crypto/sha2.h"
...@@ -135,7 +135,8 @@ class LogDnsClientTest : public ::testing::TestWithParam<net::IoMode> { ...@@ -135,7 +135,8 @@ class LogDnsClientTest : public ::testing::TestWithParam<net::IoMode> {
std::unique_ptr<net::NetworkChangeNotifier> network_change_notifier_; std::unique_ptr<net::NetworkChangeNotifier> network_change_notifier_;
// Queues and handles asynchronous DNS tasks. Indirectly used by LogDnsClient, // Queues and handles asynchronous DNS tasks. Indirectly used by LogDnsClient,
// the underlying net::DnsClient, and NetworkChangeNotifier. // the underlying net::DnsClient, and NetworkChangeNotifier.
base::MessageLoopForIO message_loop_; base::test::ScopedTaskEnvironment task_environment_{
base::test::ScopedTaskEnvironment::MainThreadType::IO};
// Allows mock DNS sockets to be setup. // Allows mock DNS sockets to be setup.
MockLogDnsTraffic mock_dns_; MockLogDnsTraffic mock_dns_;
// Tests that histograms are populated as expected. // Tests that histograms are populated as expected.
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
#include <memory> #include <memory>
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
#include "base/test/metrics/histogram_tester.h" #include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_task_environment.h"
#include "components/base32/base32.h" #include "components/base32/base32.h"
#include "components/certificate_transparency/log_dns_client.h" #include "components/certificate_transparency/log_dns_client.h"
#include "components/certificate_transparency/mock_log_dns_traffic.h" #include "components/certificate_transparency/mock_log_dns_traffic.h"
...@@ -265,7 +265,8 @@ class SingleTreeTrackerTest : public ::testing::Test { ...@@ -265,7 +265,8 @@ class SingleTreeTrackerTest : public ::testing::Test {
return logged_success == expected_success; return logged_success == expected_success;
} }
base::MessageLoopForIO message_loop_; base::test::ScopedTaskEnvironment task_environment_{
base::test::ScopedTaskEnvironment::MainThreadType::IO};
MockLogDnsTraffic mock_dns_; MockLogDnsTraffic mock_dns_;
scoped_refptr<const net::CTLogVerifier> log_; scoped_refptr<const net::CTLogVerifier> log_;
std::unique_ptr<net::NetworkChangeNotifier> net_change_notifier_; std::unique_ptr<net::NetworkChangeNotifier> net_change_notifier_;
......
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/test/scoped_feature_list.h" #include "base/test/scoped_feature_list.h"
#include "base/test/scoped_task_environment.h"
#include "components/certificate_transparency/features.h" #include "components/certificate_transparency/features.h"
#include "net/base/net_errors.h" #include "net/base/net_errors.h"
#include "net/cert/ct_log_verifier.h" #include "net/cert/ct_log_verifier.h"
...@@ -56,7 +56,8 @@ class TreeStateTrackerTest : public ::testing::Test { ...@@ -56,7 +56,8 @@ class TreeStateTrackerTest : public ::testing::Test {
} }
protected: protected:
base::MessageLoopForIO message_loop_; base::test::ScopedTaskEnvironment task_environment_{
base::test::ScopedTaskEnvironment::MainThreadType::IO};
scoped_refptr<const net::CTLogVerifier> log_; scoped_refptr<const net::CTLogVerifier> log_;
net::MockCachingHostResolver host_resolver_; net::MockCachingHostResolver host_resolver_;
std::unique_ptr<TreeStateTracker> tree_tracker_; std::unique_ptr<TreeStateTracker> tree_tracker_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment