OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/ui/views/autofill/autofill_dialog_views.h" | 5 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 TestWithBrowserView::TearDown(); | 85 TestWithBrowserView::TearDown(); |
86 } | 86 } |
87 | 87 |
88 MockAutofillDialogViewDelegate* delegate() { return &view_delegate_; } | 88 MockAutofillDialogViewDelegate* delegate() { return &view_delegate_; } |
89 | 89 |
90 TestAutofillDialogViews* dialog() { return dialog_.get(); } | 90 TestAutofillDialogViews* dialog() { return dialog_.get(); } |
91 | 91 |
92 protected: | 92 protected: |
93 void SetSectionsFocusable() { | 93 void SetSectionsFocusable() { |
94 dialog()->GetNotificationAreaForTesting()->SetFocusable(true); | 94 dialog()->GetNotificationAreaForTesting()->SetFocusBehavior( |
95 dialog()->GetScrollableAreaForTesting()->SetFocusable(true); | 95 views::View::FocusBehavior::ALWAYS); |
| 96 dialog()->GetScrollableAreaForTesting()->SetFocusBehavior( |
| 97 views::View::FocusBehavior::ALWAYS); |
96 } | 98 } |
97 | 99 |
98 private: | 100 private: |
99 // Fake dialog delegate and host to isolate test behavior. | 101 // Fake dialog delegate and host to isolate test behavior. |
100 web_modal::TestWebContentsModalDialogManagerDelegate dialog_delegate_; | 102 web_modal::TestWebContentsModalDialogManagerDelegate dialog_delegate_; |
101 std::unique_ptr<web_modal::TestWebContentsModalDialogHost> dialog_host_; | 103 std::unique_ptr<web_modal::TestWebContentsModalDialogHost> dialog_host_; |
102 | 104 |
103 // Mock view delegate as this file only tests the view. | 105 // Mock view delegate as this file only tests the view. |
104 testing::NiceMock<MockAutofillDialogViewDelegate> view_delegate_; | 106 testing::NiceMock<MockAutofillDialogViewDelegate> view_delegate_; |
105 | 107 |
(...skipping 12 matching lines...) Expand all Loading... |
118 views::FocusManager* focus_manager = dialog()->GetWidget()->GetFocusManager(); | 120 views::FocusManager* focus_manager = dialog()->GetWidget()->GetFocusManager(); |
119 views::View* focused_view = focus_manager->GetFocusedView(); | 121 views::View* focused_view = focus_manager->GetFocusedView(); |
120 ASSERT_STREQ(DecoratedTextfield::kViewClassName, | 122 ASSERT_STREQ(DecoratedTextfield::kViewClassName, |
121 focused_view->GetClassName()); | 123 focused_view->GetClassName()); |
122 EXPECT_FALSE(dialog()->HandleKeyEvent( | 124 EXPECT_FALSE(dialog()->HandleKeyEvent( |
123 static_cast<views::Textfield*>(focused_view), | 125 static_cast<views::Textfield*>(focused_view), |
124 ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE))); | 126 ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE))); |
125 } | 127 } |
126 | 128 |
127 } // namespace autofill | 129 } // namespace autofill |
OLD | NEW |