Commit 0369c2a2 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Backport some tests in /components/spellcheck to SingleThreadTaskEnvironment

These tests were previously migrated from single-threaded MessageLoop to
a multi-threaded TaskEnvironment (then named ScopedTaskEnvironment) as
part of crbug.com/891670.

//base OWNERS decided in retrospect that it was better to keep a
single-threaded option for TaskEnvironment and introduced
SingleThreadTaskEnvironment. This CL retrofits that decision for
/components/spellcheck.

This CL is a no-op if it passes CQ.

This CL was uploaded by git cl split.

R=groby@chromium.org

Bug: 891670
Change-Id: I49d8195a5ecb42ceacf78c3721550747cd501486
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1786946
Auto-Submit: Gabriel Charette <gab@chromium.org>
Commit-Queue: Rachel Blum <groby@chromium.org>
Reviewed-by: default avatarRachel Blum <groby@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695752}
parent fffe1325
...@@ -27,7 +27,7 @@ class SpellcheckHostMetricsTest : public testing::Test { ...@@ -27,7 +27,7 @@ class SpellcheckHostMetricsTest : public testing::Test {
void RecordWordCountsForTesting() { metrics_->RecordWordCounts(); } void RecordWordCountsForTesting() { metrics_->RecordWordCounts(); }
private: private:
base::test::TaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_;
std::unique_ptr<SpellCheckHostMetrics> metrics_; std::unique_ptr<SpellCheckHostMetrics> metrics_;
}; };
......
...@@ -49,8 +49,8 @@ class SpellcheckPlatformMacTest: public testing::Test { ...@@ -49,8 +49,8 @@ class SpellcheckPlatformMacTest: public testing::Test {
base::Unretained(this))); base::Unretained(this)));
} }
base::test::TaskEnvironment task_environment_{ base::test::SingleThreadTaskEnvironment task_environment_{
base::test::TaskEnvironment::MainThreadType::UI}; base::test::SingleThreadTaskEnvironment::MainThreadType::UI};
spellcheck_platform::ScopedEnglishLanguageForTest scoped_language_; spellcheck_platform::ScopedEnglishLanguageForTest scoped_language_;
}; };
......
...@@ -130,7 +130,7 @@ class SpellCheckTest : public testing::Test { ...@@ -130,7 +130,7 @@ class SpellCheckTest : public testing::Test {
private: private:
spellcheck::EmptyLocalInterfaceProvider embedder_provider_; spellcheck::EmptyLocalInterfaceProvider embedder_provider_;
std::unique_ptr<SpellCheck> spell_check_; std::unique_ptr<SpellCheck> spell_check_;
base::test::TaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_;
}; };
struct MockTextCheckingResult { struct MockTextCheckingResult {
......
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