| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 Widget* toplevel = CreateTopLevelPlatformWidget(); | 986 Widget* toplevel = CreateTopLevelPlatformWidget(); |
| 987 View* container = toplevel->client_view(); | 987 View* container = toplevel->client_view(); |
| 988 | 988 |
| 989 Textfield* textfield = new Textfield(); | 989 Textfield* textfield = new Textfield(); |
| 990 textfield->SetText(base::ASCIIToUTF16("some text")); | 990 textfield->SetText(base::ASCIIToUTF16("some text")); |
| 991 container->AddChildView(textfield); | 991 container->AddChildView(textfield); |
| 992 toplevel->Show(); | 992 toplevel->Show(); |
| 993 textfield->RequestFocus(); | 993 textfield->RequestFocus(); |
| 994 | 994 |
| 995 // The press gets handled. The release doesn't have an effect. | 995 // The press gets handled. The release doesn't have an effect. |
| 996 ui::KeyEvent backspace_p(ui::ET_KEY_PRESSED, ui::VKEY_DELETE, 0, false); | 996 ui::KeyEvent backspace_p(ui::ET_KEY_PRESSED, ui::VKEY_DELETE, ui::EF_NONE); |
| 997 toplevel->OnKeyEvent(&backspace_p); | 997 toplevel->OnKeyEvent(&backspace_p); |
| 998 EXPECT_TRUE(backspace_p.stopped_propagation()); | 998 EXPECT_TRUE(backspace_p.stopped_propagation()); |
| 999 ui::KeyEvent backspace_r(ui::ET_KEY_RELEASED, ui::VKEY_DELETE, 0, false); | 999 ui::KeyEvent backspace_r(ui::ET_KEY_RELEASED, ui::VKEY_DELETE, ui::EF_NONE); |
| 1000 toplevel->OnKeyEvent(&backspace_r); | 1000 toplevel->OnKeyEvent(&backspace_r); |
| 1001 EXPECT_FALSE(backspace_r.handled()); | 1001 EXPECT_FALSE(backspace_r.handled()); |
| 1002 | 1002 |
| 1003 toplevel->Close(); | 1003 toplevel->Close(); |
| 1004 } | 1004 } |
| 1005 | 1005 |
| 1006 // Verifies bubbles result in a focus lost when shown. | 1006 // Verifies bubbles result in a focus lost when shown. |
| 1007 // TODO(msw): this tests relies on focus, it needs to be in | 1007 // TODO(msw): this tests relies on focus, it needs to be in |
| 1008 // interactive_ui_tests. | 1008 // interactive_ui_tests. |
| 1009 TEST_F(WidgetTest, DISABLED_FocusChangesOnBubble) { | 1009 TEST_F(WidgetTest, DISABLED_FocusChangesOnBubble) { |
| (...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2728 EXPECT_EQ(3, view->GetEventCount(ui::ET_MOUSE_PRESSED)); | 2728 EXPECT_EQ(3, view->GetEventCount(ui::ET_MOUSE_PRESSED)); |
| 2729 EXPECT_EQ(3, view->GetEventCount(ui::ET_MOUSE_RELEASED)); | 2729 EXPECT_EQ(3, view->GetEventCount(ui::ET_MOUSE_RELEASED)); |
| 2730 EXPECT_EQ(1, view->GetEventCount(ui::ET_MOUSE_DRAGGED)); | 2730 EXPECT_EQ(1, view->GetEventCount(ui::ET_MOUSE_DRAGGED)); |
| 2731 EXPECT_EQ(ui::EF_LEFT_MOUSE_BUTTON, view->last_flags()); | 2731 EXPECT_EQ(ui::EF_LEFT_MOUSE_BUTTON, view->last_flags()); |
| 2732 | 2732 |
| 2733 widget->CloseNow(); | 2733 widget->CloseNow(); |
| 2734 } | 2734 } |
| 2735 | 2735 |
| 2736 } // namespace test | 2736 } // namespace test |
| 2737 } // namespace views | 2737 } // namespace views |
| OLD | NEW |