Remove usage of ScopedTaskScheduler from update_checker_unittest.cc.

ScopedTaskScheduler is deprecated.

Bug: 708584
Change-Id: Icf3671259d2798e7df6296acead2ff71e8ecfaa6
Reviewed-on: https://chromium-review.googlesource.com/586969
Reviewed-by: Sorin Jianu <sorin@chromium.org>
Commit-Queue: Francois Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489993}
diff --git a/components/update_client/update_checker_unittest.cc b/components/update_client/update_checker_unittest.cc
index ba63c7c..70c667fc 100644
--- a/components/update_client/update_checker_unittest.cc
+++ b/components/update_client/update_checker_unittest.cc
@@ -13,10 +13,9 @@
 #include "base/macros.h"
 #include "base/memory/ptr_util.h"
 #include "base/memory/ref_counted.h"
-#include "base/message_loop/message_loop.h"
 #include "base/path_service.h"
 #include "base/run_loop.h"
-#include "base/test/scoped_task_scheduler.h"
+#include "base/test/scoped_task_environment.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/version.h"
 #include "build/build_config.h"
@@ -64,7 +63,6 @@
  protected:
   void Quit();
   void RunThreads();
-  void RunThreadsUntilIdle();
 
   std::unique_ptr<Component> MakeComponent() const;
 
@@ -86,14 +84,15 @@
  private:
   std::unique_ptr<UpdateContext> MakeFakeUpdateContext() const;
 
-  base::MessageLoopForIO loop_;
-  base::test::ScopedTaskScheduler scoped_task_scheduler_;
+  base::test::ScopedTaskEnvironment scoped_task_environment_;
   base::Closure quit_closure_;
 
   DISALLOW_COPY_AND_ASSIGN(UpdateCheckerTest);
 };
 
-UpdateCheckerTest::UpdateCheckerTest() : scoped_task_scheduler_(&loop_) {}
+UpdateCheckerTest::UpdateCheckerTest()
+    : scoped_task_environment_(
+          base::test::ScopedTaskEnvironment::MainThreadType::IO) {}
 
 UpdateCheckerTest::~UpdateCheckerTest() {
 }
@@ -125,7 +124,7 @@
 
   // The PostInterceptor requires the message loop to run to destruct correctly.
   // TODO(sorin): This is fragile and should be fixed.
-  RunThreadsUntilIdle();
+  scoped_task_environment_.RunUntilIdle();
 }
 
 void UpdateCheckerTest::RunThreads() {
@@ -137,11 +136,7 @@
   // intercepts on the IO thread, run the threads until they are
   // idle. The component updater service won't loop again until the loop count
   // is set and the service is started.
-  RunThreadsUntilIdle();
-}
-
-void UpdateCheckerTest::RunThreadsUntilIdle() {
-  base::RunLoop().RunUntilIdle();
+  scoped_task_environment_.RunUntilIdle();
 }
 
 void UpdateCheckerTest::Quit() {