Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: ui/views/ime/input_method_bridge_unittest.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/ime/input_method_bridge.cc ('k') | ui/views/ime/input_method_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/aura/client/aura_constants.h"
6 #include "ui/aura/window.h"
7 #include "ui/base/ime/dummy_input_method_delegate.h"
8 #include "ui/base/ime/input_method_minimal.h"
9 #include "ui/base/ime/text_input_client.h"
10 #include "ui/views/ime/input_method.h"
11 #include "ui/views/test/views_test_base.h"
12 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
13 #include "ui/views/widget/native_widget_aura.h"
14 #include "ui/views/widget/widget.h"
15
16 namespace views {
17
18 typedef ViewsTestBase InputMethodBridgeTest;
19
20 TEST_F(InputMethodBridgeTest, DestructTest) {
21 ui::internal::DummyInputMethodDelegate input_method_delegate;
22 ui::InputMethodMinimal input_method(&input_method_delegate);
23
24 GetContext()->SetProperty(aura::client::kRootWindowInputMethodKey,
25 static_cast<ui::InputMethod*>(&input_method));
26
27 Widget* toplevel = new Widget;
28 Widget::InitParams toplevel_params =
29 CreateParams(Widget::InitParams::TYPE_WINDOW);
30 // |child| owns |native_widget|.
31 toplevel_params.native_widget = new DesktopNativeWidgetAura(toplevel);
32 toplevel->Init(toplevel_params);
33
34 Widget* child = new Widget;
35 Widget::InitParams child_params =
36 CreateParams(Widget::InitParams::TYPE_POPUP);
37 child_params.parent = toplevel->GetNativeView();
38 // |child| owns |native_widget|.
39 child_params.native_widget = new NativeWidgetAura(child);
40 child->Init(child_params);
41
42 child->GetInputMethod()->OnFocus();
43
44 toplevel->CloseNow();
45
46 GetContext()->SetProperty(aura::client::kRootWindowInputMethodKey,
47 static_cast<ui::InputMethod*>(NULL));
48 }
49
50 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/ime/input_method_bridge.cc ('k') | ui/views/ime/input_method_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698