| 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 <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 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 widget.Init(init_params); | 961 widget.Init(init_params); |
| 962 | 962 |
| 963 widget.Show(); | 963 widget.Show(); |
| 964 EXPECT_FALSE(widget.IsActive()); | 964 EXPECT_FALSE(widget.IsActive()); |
| 965 } | 965 } |
| 966 | 966 |
| 967 #if defined(USE_AURA) | 967 #if defined(USE_AURA) |
| 968 // Test that touch selection quick menu is not activated when opened. | 968 // Test that touch selection quick menu is not activated when opened. |
| 969 TEST_F(WidgetTestInteractive, TouchSelectionQuickMenuIsNotActivated) { | 969 TEST_F(WidgetTestInteractive, TouchSelectionQuickMenuIsNotActivated) { |
| 970 #if defined(OS_WIN) | 970 #if defined(OS_WIN) |
| 971 views_delegate()->set_use_desktop_native_widgets(true); | 971 test_views_delegate()->set_use_desktop_native_widgets(true); |
| 972 #endif // !defined(OS_WIN) | 972 #endif // !defined(OS_WIN) |
| 973 | 973 |
| 974 Widget* widget = CreateWidget(); | 974 Widget* widget = CreateWidget(); |
| 975 | 975 |
| 976 Textfield* textfield = new Textfield; | 976 Textfield* textfield = new Textfield; |
| 977 textfield->SetBounds(0, 0, 200, 20); | 977 textfield->SetBounds(0, 0, 200, 20); |
| 978 textfield->SetText(base::ASCIIToUTF16("some text")); | 978 textfield->SetText(base::ASCIIToUTF16("some text")); |
| 979 widget->GetRootView()->AddChildView(textfield); | 979 widget->GetRootView()->AddChildView(textfield); |
| 980 | 980 |
| 981 widget->Show(); | 981 widget->Show(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 992 | 992 |
| 993 EXPECT_TRUE(textfield->HasFocus()); | 993 EXPECT_TRUE(textfield->HasFocus()); |
| 994 EXPECT_TRUE(widget->IsActive()); | 994 EXPECT_TRUE(widget->IsActive()); |
| 995 EXPECT_TRUE(ui::TouchSelectionMenuRunner::GetInstance()->IsRunning()); | 995 EXPECT_TRUE(ui::TouchSelectionMenuRunner::GetInstance()->IsRunning()); |
| 996 widget->CloseNow(); | 996 widget->CloseNow(); |
| 997 } | 997 } |
| 998 #endif // defined(USE_AURA) | 998 #endif // defined(USE_AURA) |
| 999 | 999 |
| 1000 TEST_F(WidgetTestInteractive, DisableViewDoesNotActivateWidget) { | 1000 TEST_F(WidgetTestInteractive, DisableViewDoesNotActivateWidget) { |
| 1001 #if defined(OS_WIN) | 1001 #if defined(OS_WIN) |
| 1002 views_delegate()->set_use_desktop_native_widgets(true); | 1002 test_views_delegate()->set_use_desktop_native_widgets(true); |
| 1003 #endif // !defined(OS_WIN) | 1003 #endif // !defined(OS_WIN) |
| 1004 | 1004 |
| 1005 // Create first widget and view, activate the widget, and focus the view. | 1005 // Create first widget and view, activate the widget, and focus the view. |
| 1006 Widget widget1; | 1006 Widget widget1; |
| 1007 Widget::InitParams params1 = CreateParams(Widget::InitParams::TYPE_POPUP); | 1007 Widget::InitParams params1 = CreateParams(Widget::InitParams::TYPE_POPUP); |
| 1008 params1.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 1008 params1.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 1009 params1.activatable = Widget::InitParams::ACTIVATABLE_YES; | 1009 params1.activatable = Widget::InitParams::ACTIVATABLE_YES; |
| 1010 widget1.Init(params1); | 1010 widget1.Init(params1); |
| 1011 | 1011 |
| 1012 View* view1 = new View(); | 1012 View* view1 = new View(); |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1807 | 1807 |
| 1808 ui::KeyEvent key_event2(key_event); | 1808 ui::KeyEvent key_event2(key_event); |
| 1809 widget->OnKeyEvent(&key_event2); | 1809 widget->OnKeyEvent(&key_event2); |
| 1810 EXPECT_FALSE(key_event2.stopped_propagation()); | 1810 EXPECT_FALSE(key_event2.stopped_propagation()); |
| 1811 | 1811 |
| 1812 widget->CloseNow(); | 1812 widget->CloseNow(); |
| 1813 } | 1813 } |
| 1814 | 1814 |
| 1815 } // namespace test | 1815 } // namespace test |
| 1816 } // namespace views | 1816 } // namespace views |
| OLD | NEW |