OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/widget/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
9 #include "ui/views/controls/textfield/textfield.h" | 9 #include "ui/views/controls/textfield/textfield.h" |
10 #include "ui/views/test/native_widget_factory.h" | 10 #include "ui/views/test/native_widget_factory.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 using NativeWidgetAuraTest = ViewsInteractiveUITestBase; | 45 using NativeWidgetAuraTest = ViewsInteractiveUITestBase; |
46 | 46 |
47 // When requesting view focus from a non-active top level widget, focus is not | 47 // When requesting view focus from a non-active top level widget, focus is not |
48 // instantly given. Instead, the view is firstly stored and then it is attempted | 48 // instantly given. Instead, the view is firstly stored and then it is attempted |
49 // to activate the widget. If widget is currently not activatable, focus should | 49 // to activate the widget. If widget is currently not activatable, focus should |
50 // not be grabbed. And focus will be given/restored the next time the widget is | 50 // not be grabbed. And focus will be given/restored the next time the widget is |
51 // made active. (crbug.com/621791) | 51 // made active. (crbug.com/621791) |
52 TEST_F(NativeWidgetAuraTest, NonActiveWindowRequestImeFocus) { | 52 TEST_F(NativeWidgetAuraTest, NonActiveWindowRequestImeFocus) { |
53 // TODO: test uses GetContext(), which is not applicable to aura-mus. | 53 // TODO: test uses GetContext(), which is not applicable to aura-mus. |
54 // http://crbug.com/663809. | 54 // http://crbug.com/663809. |
55 if (IsAuraMusClient()) | 55 if (IsMus()) |
56 return; | 56 return; |
57 | 57 |
58 TestFocusRules* test_focus_rules = new TestFocusRules; | 58 TestFocusRules* test_focus_rules = new TestFocusRules; |
59 std::unique_ptr<wm::FocusController> focus_controller = | 59 std::unique_ptr<wm::FocusController> focus_controller = |
60 base::MakeUnique<wm::FocusController>(test_focus_rules); | 60 base::MakeUnique<wm::FocusController>(test_focus_rules); |
61 aura::client::SetActivationClient(GetContext(), focus_controller.get()); | 61 aura::client::SetActivationClient(GetContext(), focus_controller.get()); |
62 | 62 |
63 Widget* widget1 = new Widget; | 63 Widget* widget1 = new Widget; |
64 Widget::InitParams params1(Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 64 Widget::InitParams params1(Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
65 params1.context = GetContext(); | 65 params1.context = GetContext(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 EXPECT_TRUE(textfield2a->HasFocus()); | 106 EXPECT_TRUE(textfield2a->HasFocus()); |
107 EXPECT_FALSE(textfield2b->HasFocus()); | 107 EXPECT_FALSE(textfield2b->HasFocus()); |
108 EXPECT_FALSE(textfield1->HasFocus()); | 108 EXPECT_FALSE(textfield1->HasFocus()); |
109 | 109 |
110 widget1->CloseNow(); | 110 widget1->CloseNow(); |
111 widget2->CloseNow(); | 111 widget2->CloseNow(); |
112 } | 112 } |
113 | 113 |
114 } // namespace test | 114 } // namespace test |
115 } // namespace views | 115 } // namespace views |
OLD | NEW |