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

Use ScopedTaskEnvironment instead of MessageLoopForUI in /ui/gfx

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

Change-Id: I682631b97e8a874f9d586520a937929d91953e44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1718025Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#685561}
parent 9798801d
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/i18n/rtl.h" #include "base/i18n/rtl.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_task_environment.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/font.h" #include "ui/gfx/font.h"
...@@ -294,7 +294,8 @@ static void CheckCodeUnitPairs(const base::string16& text, ...@@ -294,7 +294,8 @@ static void CheckCodeUnitPairs(const base::string16& text,
TEST(TextEliderTest, ElideTextAtomicSequences) { TEST(TextEliderTest, ElideTextAtomicSequences) {
#if defined(OS_WIN) #if defined(OS_WIN)
// Needed to bypass DCHECK in GetFallbackFont. // Needed to bypass DCHECK in GetFallbackFont.
base::MessageLoopForUI message_loop; base::test::ScopedTaskEnvironment scoped_task_environment(
base::test::ScopedTaskEnvironment::MainThreadType::UI);
#endif #endif
const FontList font_list; const FontList font_list;
// The below is 'MUSICAL SYMBOL G CLEF' (U+1D11E), which is represented in // The below is 'MUSICAL SYMBOL G CLEF' (U+1D11E), which is represented in
......
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