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

Side by Side Diff: ui/views/widget/widget_interactive_uitest.cc

Issue 2371113003: Do not give instant focus if a view's toplevelwidget is not active (Closed)
Patch Set: add ClearNativeFocus() Created 4 years, 2 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1691 Widget* deactivate_widget_ = nullptr; 1691 Widget* deactivate_widget_ = nullptr;
1692 1692
1693 DISALLOW_COPY_AND_ASSIGN(WidgetInputMethodInteractiveTest); 1693 DISALLOW_COPY_AND_ASSIGN(WidgetInputMethodInteractiveTest);
1694 }; 1694 };
1695 1695
1696 // Test input method focus changes affected by top window activaction. 1696 // Test input method focus changes affected by top window activaction.
1697 TEST_F(WidgetInputMethodInteractiveTest, Activation) { 1697 TEST_F(WidgetInputMethodInteractiveTest, Activation) {
1698 Widget* widget = CreateWidget(); 1698 Widget* widget = CreateWidget();
1699 Textfield* textfield = new Textfield; 1699 Textfield* textfield = new Textfield;
1700 widget->GetRootView()->AddChildView(textfield); 1700 widget->GetRootView()->AddChildView(textfield);
1701 ShowSync(widget);
1701 textfield->RequestFocus(); 1702 textfield->RequestFocus();
1702 1703
1703 ShowSync(widget);
1704
1705 EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, 1704 EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT,
1706 widget->GetInputMethod()->GetTextInputType()); 1705 widget->GetInputMethod()->GetTextInputType());
1707 1706
1708 DeactivateSync(widget); 1707 DeactivateSync(widget);
1709 1708
1710 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, 1709 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE,
1711 widget->GetInputMethod()->GetTextInputType()); 1710 widget->GetInputMethod()->GetTextInputType());
1712 widget->CloseNow(); 1711 widget->CloseNow();
1713 } 1712 }
1714 1713
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1859 1858
1860 ui::KeyEvent key_event2(key_event); 1859 ui::KeyEvent key_event2(key_event);
1861 widget->OnKeyEvent(&key_event2); 1860 widget->OnKeyEvent(&key_event2);
1862 EXPECT_FALSE(key_event2.stopped_propagation()); 1861 EXPECT_FALSE(key_event2.stopped_propagation());
1863 1862
1864 widget->CloseNow(); 1863 widget->CloseNow();
1865 } 1864 }
1866 1865
1867 } // namespace test 1866 } // namespace test
1868 } // namespace views 1867 } // namespace views
OLDNEW
« ui/views/focus/focus_manager.cc ('K') | « ui/views/widget/root_view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698