Chromium Code Reviews| Index: ui/views/ime/input_method_bridge_unittest.cc |
| diff --git a/ui/views/ime/input_method_bridge_unittest.cc b/ui/views/ime/input_method_bridge_unittest.cc |
| index 510264544ed7f1c6641680b18bad811b545c48a4..bcec009511c11f527facc5b9a64ecaf5869c5fef 100644 |
| --- a/ui/views/ime/input_method_bridge_unittest.cc |
| +++ b/ui/views/ime/input_method_bridge_unittest.cc |
| @@ -2,41 +2,34 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "ui/aura/window.h" |
| -#include "ui/base/ime/dummy_input_method_delegate.h" |
| -#include "ui/base/ime/input_method_minimal.h" |
| -#include "ui/base/ime/text_input_client.h" |
| #include "ui/views/ime/input_method.h" |
| -#include "ui/views/test/views_test_base.h" |
| -#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| -#include "ui/views/widget/native_widget_aura.h" |
| +#include "ui/views/test/widget_test.h" |
| #include "ui/views/widget/widget.h" |
| namespace views { |
| -typedef ViewsTestBase InputMethodBridgeTest; |
| +using InputMethodBridgeTest = test::WidgetTest; |
| TEST_F(InputMethodBridgeTest, DestructTest) { |
| - ui::internal::DummyInputMethodDelegate input_method_delegate; |
| - ui::InputMethodMinimal input_method(&input_method_delegate); |
|
tapted
2015/06/24 05:24:22
http://crrev.com/333698 removed a line below this
|
| - |
| - Widget* toplevel = new Widget; |
| - Widget::InitParams toplevel_params = |
| - CreateParams(Widget::InitParams::TYPE_WINDOW); |
| - // |child| owns |native_widget|. |
| - toplevel_params.native_widget = new DesktopNativeWidgetAura(toplevel); |
| - toplevel->Init(toplevel_params); |
| + Widget* toplevel = CreateNativeDesktopWidget(); |
| Widget* child = new Widget; |
| Widget::InitParams child_params = |
| CreateParams(Widget::InitParams::TYPE_POPUP); |
| child_params.parent = toplevel->GetNativeView(); |
| // |child| owns |native_widget|. |
| - child_params.native_widget = new NativeWidgetAura(child); |
| + child_params.native_widget = new PlatformNativeWidget(child); |
| child->Init(child_params); |
| + // Both the views::InputMethod and the "host" ui::InputMethod are created |
| + // lazily. Requesting the views::InputMethod (owned by Widget) will also |
| + // create the ui::InputMethod (owned by NativeWidget) to build the bridge. |
| + EXPECT_TRUE(child->GetInputMethod()); |
| child->GetInputMethod()->OnFocus(); |
| + EXPECT_TRUE(toplevel->GetInputMethod()); |
| + toplevel->GetInputMethod()->OnFocus(); |
| + |
| toplevel->CloseNow(); |
| } |