Commit ec30509d authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

SetUpInputMethodFactoryForTesting for ExoTestBase

ui::CreateInputMethod is called implicitly within the Setup of
AshTestBase (somewhere within ash::Shell::Init()), which conflicts
with ui::SetUpInputMethodFactoryForTesting(). So the CHECK fails
if TextInputTest runs along with other tests in exo (i.e. without
gtest_filter flags).

Actually SetUpInputMethodFactoryForTesting can be called for
every tests in exo, so that is moved there.

BUG=870690
TEST=exo_unittests succeed without --gtest_filter flag

Change-Id: I9e9bb009b7b5af3715759ee29ac6c94f9614eecf
Reviewed-on: https://chromium-review.googlesource.com/1162621Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Jun Mukai <mukai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580637}
parent 443da379
......@@ -8,6 +8,7 @@
#include "components/exo/test/exo_test_helper.h"
#include "components/exo/test/test_client_controlled_state_delegate.h"
#include "components/exo/wm_helper.h"
#include "ui/base/ime/input_method_factory.h"
#include "ui/wm/core/wm_core_switches.h"
namespace exo {
......@@ -24,6 +25,7 @@ void ExoTestBase::SetUp() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
// Disable window animation when running tests.
command_line->AppendSwitch(wm::switches::kWindowAnimationsDisabled);
ui::SetUpInputMethodFactoryForTesting();
AshTestBase::SetUp();
wm_helper_ = std::make_unique<WMHelper>();
WMHelper::SetInstance(wm_helper_.get());
......
......@@ -13,7 +13,6 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/ime/composition_text.h"
#include "ui/base/ime/input_method_factory.h"
#include "ui/base/ime/input_method_observer.h"
#include "ui/views/widget/widget.h"
......@@ -74,7 +73,6 @@ class TextInputTest : public test::ExoTestBase {
TextInputTest() = default;
void SetUp() override {
ui::SetUpInputMethodFactoryForTesting();
test::ExoTestBase::SetUp();
text_input_ =
std::make_unique<TextInput>(std::make_unique<MockTextInputDelegate>());
......
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