Backport some tests in /components/network_time to SingleThreadTaskEnvironment

These tests were previously migrated from single-threaded MessageLoop to
a multi-threaded TaskEnvironment (then named ScopedTaskEnvironment) as
part of

//base OWNERS decided in retrospect that it was better to keep a
single-threaded option for TaskEnvironment and introduced
SingleThreadTaskEnvironment. This CL retrofits that decision for

This CL is a no-op if it passes CQ.

This CL was uploaded by git cl split.

Bug: 891670
Change-Id: I444ad4c122f248c1a1116752cc253d55da465708
Auto-Submit: Gabriel Charette <>
Commit-Queue: Nicolas Zea <>
Reviewed-by: Nicolas Zea <>
Cr-Commit-Position: refs/heads/master@{#695722}
diff --git a/components/network_time/ b/components/network_time/
index e1c844e..b71a3fb 100644
--- a/components/network_time/
+++ b/components/network_time/
@@ -48,7 +48,8 @@
   ~NetworkTimeTrackerTest() override {}
-      : task_environment_(base::test::TaskEnvironment::MainThreadType::IO),
+      : task_environment_(
+            base::test::SingleThreadTaskEnvironment::MainThreadType::IO),
         field_trial_test_(new FieldTrialTest()),
         clock_(new base::SimpleTestClock),
         tick_clock_(new base::SimpleTestTickClock),
@@ -155,7 +156,7 @@
-  base::test::TaskEnvironment task_environment_;
+  base::test::SingleThreadTaskEnvironment task_environment_;
   std::unique_ptr<FieldTrialTest> field_trial_test_;
   base::TimeDelta resolution_;
   base::TimeDelta latency_;