OLD | NEW |
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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 widget.Show(); | 887 widget.Show(); |
888 EXPECT_FALSE(widget.IsActive()); | 888 EXPECT_FALSE(widget.IsActive()); |
889 } | 889 } |
890 | 890 |
891 #if defined(USE_AURA) | 891 #if defined(USE_AURA) |
892 // Test that touch selection quick menu is not activated when opened. | 892 // Test that touch selection quick menu is not activated when opened. |
893 TEST_F(WidgetTestInteractive, TouchSelectionQuickMenuIsNotActivated) { | 893 TEST_F(WidgetTestInteractive, TouchSelectionQuickMenuIsNotActivated) { |
894 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 894 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
895 switches::kEnableTouchEditing); | 895 switches::kEnableTouchEditing); |
896 #if defined(OS_WIN) | 896 #if defined(OS_WIN) |
897 views_delegate().set_use_desktop_native_widgets(true); | 897 views_delegate()->set_use_desktop_native_widgets(true); |
898 #endif // !defined(OS_WIN) | 898 #endif // !defined(OS_WIN) |
899 | 899 |
900 Widget* widget = CreateWidget(); | 900 Widget* widget = CreateWidget(); |
901 | 901 |
902 Textfield* textfield = new Textfield; | 902 Textfield* textfield = new Textfield; |
903 textfield->SetBounds(0, 0, 200, 20); | 903 textfield->SetBounds(0, 0, 200, 20); |
904 textfield->SetText(base::ASCIIToUTF16("some text")); | 904 textfield->SetText(base::ASCIIToUTF16("some text")); |
905 widget->GetRootView()->AddChildView(textfield); | 905 widget->GetRootView()->AddChildView(textfield); |
906 | 906 |
907 widget->Show(); | 907 widget->Show(); |
(...skipping 10 matching lines...) Expand all Loading... |
918 | 918 |
919 EXPECT_TRUE(textfield->HasFocus()); | 919 EXPECT_TRUE(textfield->HasFocus()); |
920 EXPECT_TRUE(widget->IsActive()); | 920 EXPECT_TRUE(widget->IsActive()); |
921 EXPECT_TRUE(ui::TouchSelectionMenuRunner::GetInstance()->IsRunning()); | 921 EXPECT_TRUE(ui::TouchSelectionMenuRunner::GetInstance()->IsRunning()); |
922 widget->CloseNow(); | 922 widget->CloseNow(); |
923 } | 923 } |
924 #endif // defined(USE_AURA) | 924 #endif // defined(USE_AURA) |
925 | 925 |
926 TEST_F(WidgetTestInteractive, DisableViewDoesNotActivateWidget) { | 926 TEST_F(WidgetTestInteractive, DisableViewDoesNotActivateWidget) { |
927 #if defined(OS_WIN) | 927 #if defined(OS_WIN) |
928 views_delegate().set_use_desktop_native_widgets(true); | 928 views_delegate()->set_use_desktop_native_widgets(true); |
929 #endif // !defined(OS_WIN) | 929 #endif // !defined(OS_WIN) |
930 | 930 |
931 // Create first widget and view, activate the widget, and focus the view. | 931 // Create first widget and view, activate the widget, and focus the view. |
932 Widget widget1; | 932 Widget widget1; |
933 Widget::InitParams params1 = CreateParams(Widget::InitParams::TYPE_POPUP); | 933 Widget::InitParams params1 = CreateParams(Widget::InitParams::TYPE_POPUP); |
934 params1.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 934 params1.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
935 params1.activatable = Widget::InitParams::ACTIVATABLE_YES; | 935 params1.activatable = Widget::InitParams::ACTIVATABLE_YES; |
936 widget1.Init(params1); | 936 widget1.Init(params1); |
937 | 937 |
938 View* view1 = new View(); | 938 View* view1 = new View(); |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1625 widget->GetInputMethod()->GetTextInputType()); | 1625 widget->GetInputMethod()->GetTextInputType()); |
1626 | 1626 |
1627 textfield->SetReadOnly(true); | 1627 textfield->SetReadOnly(true); |
1628 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, | 1628 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, |
1629 widget->GetInputMethod()->GetTextInputType()); | 1629 widget->GetInputMethod()->GetTextInputType()); |
1630 widget->CloseNow(); | 1630 widget->CloseNow(); |
1631 } | 1631 } |
1632 | 1632 |
1633 } // namespace test | 1633 } // namespace test |
1634 } // namespace views | 1634 } // namespace views |
OLD | NEW |