Commit 87cbd6e8 authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

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: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667191}
parent 26598d43
......@@ -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 @@ class PluginProxyTest : public PluginProxyTestHarness, public testing::Test {
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 @@ class HostProxyTest : public HostProxyTestHarness, public testing::Test {
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 @@ class TwoWayTest : public testing::Test {
// 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
......
......@@ -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 @@ class RawVarDataTest : public testing::Test {
}
private:
base::MessageLoop message_loop_; // Required to receive callbacks.
base::test::ScopedTaskEnvironment
scoped_task_environment_; // Required to receive callbacks.
TestGlobals globals_;
};
......
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