OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/omnibox/omnibox_view_views.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 class TestingOmniboxEditController : public ChromeOmniboxEditController { | 62 class TestingOmniboxEditController : public ChromeOmniboxEditController { |
63 public: | 63 public: |
64 explicit TestingOmniboxEditController(CommandUpdater* command_updater) | 64 explicit TestingOmniboxEditController(CommandUpdater* command_updater) |
65 : ChromeOmniboxEditController(command_updater) {} | 65 : ChromeOmniboxEditController(command_updater) {} |
66 | 66 |
67 protected: | 67 protected: |
68 // ChromeOmniboxEditController: | 68 // ChromeOmniboxEditController: |
69 void UpdateWithoutTabRestore() override {} | 69 void UpdateWithoutTabRestore() override {} |
70 void OnChanged() override {} | 70 void OnChanged() override {} |
71 void ShowURL() override {} | |
72 ToolbarModel* GetToolbarModel() override { return nullptr; } | 71 ToolbarModel* GetToolbarModel() override { return nullptr; } |
73 const ToolbarModel* GetToolbarModel() const override { return nullptr; } | 72 const ToolbarModel* GetToolbarModel() const override { return nullptr; } |
74 content::WebContents* GetWebContents() override { return nullptr; } | 73 content::WebContents* GetWebContents() override { return nullptr; } |
75 | 74 |
76 private: | 75 private: |
77 DISALLOW_COPY_AND_ASSIGN(TestingOmniboxEditController); | 76 DISALLOW_COPY_AND_ASSIGN(TestingOmniboxEditController); |
78 }; | 77 }; |
79 | 78 |
80 } // namespace | 79 } // namespace |
81 | 80 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 TEST_F(OmniboxViewViewsTest, ScheduledTextEditCommand) { | 156 TEST_F(OmniboxViewViewsTest, ScheduledTextEditCommand) { |
158 omnibox_textfield()->SetTextEditCommandForNextKeyEvent( | 157 omnibox_textfield()->SetTextEditCommandForNextKeyEvent( |
159 ui::TextEditCommand::MOVE_UP); | 158 ui::TextEditCommand::MOVE_UP); |
160 EXPECT_EQ(ui::TextEditCommand::MOVE_UP, scheduled_text_edit_command()); | 159 EXPECT_EQ(ui::TextEditCommand::MOVE_UP, scheduled_text_edit_command()); |
161 | 160 |
162 ui::KeyEvent up_pressed(ui::ET_KEY_PRESSED, ui::VKEY_UP, 0); | 161 ui::KeyEvent up_pressed(ui::ET_KEY_PRESSED, ui::VKEY_UP, 0); |
163 omnibox_textfield()->OnKeyEvent(&up_pressed); | 162 omnibox_textfield()->OnKeyEvent(&up_pressed); |
164 EXPECT_EQ(ui::TextEditCommand::INVALID_COMMAND, | 163 EXPECT_EQ(ui::TextEditCommand::INVALID_COMMAND, |
165 scheduled_text_edit_command()); | 164 scheduled_text_edit_command()); |
166 } | 165 } |
OLD | NEW |