Commit 6ca12ae1 authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

discovery: use MOCK_TIME in unit tests

This knocks ~5% off the total runtime of unit_tests on my workstation, since
most tests in this suite otherwise take multiple seconds to run.

Bug: 1055824
Change-Id: Id911e97ce55efed11f6ee5fb34eaf5409426f19d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2072660Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745047}
parent 26673ad1
...@@ -231,7 +231,8 @@ class ServiceDiscoveryTest : public ::testing::Test { ...@@ -231,7 +231,8 @@ class ServiceDiscoveryTest : public ::testing::Test {
net::MockMDnsSocketFactory socket_factory_; net::MockMDnsSocketFactory socket_factory_;
net::MDnsClientImpl mdns_client_; net::MDnsClientImpl mdns_client_;
ServiceDiscoveryClientImpl service_discovery_client_; ServiceDiscoveryClientImpl service_discovery_client_;
base::test::SingleThreadTaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_{
base::test::TaskEnvironment::TimeSource::MOCK_TIME};
}; };
TEST_F(ServiceDiscoveryTest, AddRemoveService) { TEST_F(ServiceDiscoveryTest, AddRemoveService) {
......
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