Commit d372d6a1 authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

Remove references of MessageLoopForIO in /extensions/renderer

MessageLoopForIO will go away soon use ScopedTaskEnvironment instead.

ScopedTaskEnvironment will per default start a ThreadPool, which should
be fine in most of the cases. If you believe 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=rdevlin.cronin@chromium.org

Change-Id: I011ff9c037debc4092850caff94f52f4d7667ea0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733610Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#684443}
parent f75bb60b
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
#include "base/environment.h" #include "base/environment.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/rand_util.h" #include "base/rand_util.h"
#include "base/test/scoped_task_environment.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "extensions/renderer/extension_throttle_entry.h" #include "extensions/renderer/extension_throttle_entry.h"
#include "extensions/renderer/extension_throttle_test_support.h" #include "extensions/renderer/extension_throttle_test_support.h"
...@@ -507,7 +507,8 @@ void SimulateAttack(Server* server, ...@@ -507,7 +507,8 @@ void SimulateAttack(Server* server,
} }
TEST(URLRequestThrottlerSimulation, HelpsInAttack) { TEST(URLRequestThrottlerSimulation, HelpsInAttack) {
base::MessageLoopForIO message_loop; base::test::ScopedTaskEnvironment scoped_task_environment(
base::test::ScopedTaskEnvironment::MainThreadType::IO);
Server unprotected_server(30, 1.0); Server unprotected_server(30, 1.0);
RequesterResults unprotected_attacker_results; RequesterResults unprotected_attacker_results;
RequesterResults unprotected_client_results; RequesterResults unprotected_client_results;
...@@ -587,7 +588,8 @@ double SimulateDowntime(const TimeDelta& duration, ...@@ -587,7 +588,8 @@ double SimulateDowntime(const TimeDelta& duration,
} }
TEST(URLRequestThrottlerSimulation, PerceivedDowntimeRatio) { TEST(URLRequestThrottlerSimulation, PerceivedDowntimeRatio) {
base::MessageLoopForIO message_loop; base::test::ScopedTaskEnvironment scoped_task_environment(
base::test::ScopedTaskEnvironment::MainThreadType::IO);
struct Stats { struct Stats {
// Expected interval that we expect the ratio of downtime when anti-DDoS // Expected interval that we expect the ratio of downtime when anti-DDoS
// is enabled and downtime when anti-DDoS is not enabled to fall within. // is enabled and downtime when anti-DDoS is not enabled to fall within.
......
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