Use ScopedTaskEnvironment instead of MessageLoop in /ppapi/proxy

MessageLoop will go away, eventually.

ScopedTaskEnvironment will per default start a ThreadPool, which should
be fine in most of the cases. If you belive your test needs to make sure
that no ThreadPool runs let me know and I will update the patch.

BUG=891670
This CL was uploaded by git cl split.

R=piman@chromium.org

Change-Id: Ida93c455e32bf058063b6bf48800b289c972823b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1649326
Auto-Submit: Carlos Caballero <carlscab@google.com>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Antoine Labour <piman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#667191}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 87cbd6e88422ea70e50167d7113d2229b89e1497
diff --git a/proxy/ppapi_proxy_test.h b/proxy/ppapi_proxy_test.h
index 01ac6a7..3f39598 100644
--- a/proxy/ppapi_proxy_test.h
+++ b/proxy/ppapi_proxy_test.h
@@ -14,9 +14,9 @@
 #include "base/compiler_specific.h"
 #include "base/macros.h"
 #include "base/memory/ref_counted.h"
-#include "base/message_loop/message_loop.h"
 #include "base/synchronization/waitable_event.h"
 #include "base/task_runner.h"
+#include "base/test/scoped_task_environment.h"
 #include "base/threading/simple_thread.h"
 #include "base/threading/thread.h"
 #include "ppapi/c/pp_instance.h"
@@ -202,7 +202,7 @@
   virtual void SetUp();
   virtual void TearDown();
  private:
-  base::MessageLoop message_loop_;
+  base::test::ScopedTaskEnvironment scoped_task_environment_;
 };
 
 // This class provides support for multi-thread testing. A secondary thread is
@@ -334,7 +334,7 @@
   virtual void SetUp();
   virtual void TearDown();
  private:
-  base::MessageLoop message_loop_;
+  base::test::ScopedTaskEnvironment scoped_task_environment_;
 };
 
 // Use this base class to test both sides of a proxy.
@@ -372,7 +372,7 @@
   // The plugin side of the proxy runs on its own thread.
   base::Thread plugin_thread_;
   // The message loop for the main (host) thread.
-  base::MessageLoop message_loop_;
+  base::test::ScopedTaskEnvironment scoped_task_environment_;
 
   // Aliases for the host and plugin harnesses; if we're testing a PPP
   // interface, remote_harness will point to plugin_, and local_harness
diff --git a/proxy/raw_var_data_unittest.cc b/proxy/raw_var_data_unittest.cc
index 712ee67..59c5664 100644
--- a/proxy/raw_var_data_unittest.cc
+++ b/proxy/raw_var_data_unittest.cc
@@ -12,7 +12,7 @@
 #include "base/bind.h"
 #include "base/logging.h"
 #include "base/memory/ref_counted.h"
-#include "base/message_loop/message_loop.h"
+#include "base/test/scoped_task_environment.h"
 #include "base/values.h"
 #include "ppapi/c/pp_bool.h"
 #include "ppapi/c/pp_var.h"
@@ -52,7 +52,8 @@
   }
 
  private:
-  base::MessageLoop message_loop_;  // Required to receive callbacks.
+  base::test::ScopedTaskEnvironment
+      scoped_task_environment_;  // Required to receive callbacks.
   TestGlobals globals_;
 };