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

Use ScopedTaskEnvironment instead of MessageLoopForUI in...

Use ScopedTaskEnvironment instead of MessageLoopForUI in /base/memory/memory_pressure_monitor_win_unittest.cc

MessageLoopForUI will go away, eventually.

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=brucedawson@chromium.org

Change-Id: I212a7534542ecb94ed6414190e285f7eeaff2288
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715363
Auto-Submit: Carlos Caballero <carlscab@google.com>
Reviewed-by: default avatarBruce Dawson <brucedawson@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#682198}
parent f688443e
......@@ -7,8 +7,8 @@
#include "base/bind.h"
#include "base/macros.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/test/scoped_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -147,7 +147,8 @@ class WinMemoryPressureMonitorTest : public testing::Test {
monitor->CalculateCurrentPressureLevel());
}
base::MessageLoopForUI message_loop_;
base::test::ScopedTaskEnvironment scoped_task_environment_{
base::test::ScopedTaskEnvironment::MainThreadType::UI};
};
// Tests the fundamental direct calculation of memory pressure with automatic
......
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