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 "ash/shell.h" | 5 #include "ash/shell.h" |
6 #include "ash/system/tray/system_tray.h" | 6 #include "ash/system/tray/system_tray.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 9 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_window.h" |
| 13 #include "chrome/browser/ui/location_bar/location_bar.h" |
| 14 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
12 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
13 #include "chrome/browser/ui/view_ids.h" | 16 #include "chrome/browser/ui/view_ids.h" |
14 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
15 #include "chrome/test/base/in_process_browser_test.h" | 18 #include "chrome/test/base/in_process_browser_test.h" |
16 #include "chrome/test/base/interactive_test_utils.h" | 19 #include "chrome/test/base/interactive_test_utils.h" |
17 #include "ui/aura/window_event_dispatcher.h" | 20 #include "ui/aura/window_event_dispatcher.h" |
18 #include "ui/events/keycodes/keyboard_codes.h" | 21 #include "ui/events/keycodes/keyboard_codes.h" |
19 #include "ui/gfx/native_widget_types.h" | 22 #include "ui/gfx/native_widget_types.h" |
20 | 23 |
21 namespace chromeos { | 24 namespace chromeos { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 ui_test_utils::ClickOnView(browser(), VIEW_ID_HOME_BUTTON); | 135 ui_test_utils::ClickOnView(browser(), VIEW_ID_HOME_BUTTON); |
133 EXPECT_EQ(tab_count, tab_strip_model->count()); | 136 EXPECT_EQ(tab_count, tab_strip_model->count()); |
134 | 137 |
135 // Test disabling sticky keys prevent modified mouse click. | 138 // Test disabling sticky keys prevent modified mouse click. |
136 DisableStickyKeys(); | 139 DisableStickyKeys(); |
137 SendKeyPress(ui::VKEY_CONTROL); | 140 SendKeyPress(ui::VKEY_CONTROL); |
138 ui_test_utils::ClickOnView(browser(), VIEW_ID_HOME_BUTTON); | 141 ui_test_utils::ClickOnView(browser(), VIEW_ID_HOME_BUTTON); |
139 EXPECT_EQ(tab_count, tab_strip_model->count()); | 142 EXPECT_EQ(tab_count, tab_strip_model->count()); |
140 } | 143 } |
141 | 144 |
| 145 IN_PROC_BROWSER_TEST_F(StickyKeysBrowserTest, SearchLeftOmnibox) { |
| 146 EnableStickyKeys(); |
| 147 |
| 148 OmniboxView* omnibox = |
| 149 browser()->window()->GetLocationBar()->GetOmniboxView(); |
| 150 |
| 151 // Give the omnibox focus. |
| 152 omnibox->ShowURL(); |
| 153 |
| 154 // Type 'foo'. |
| 155 SendKeyPress(ui::VKEY_F); |
| 156 SendKeyPress(ui::VKEY_O); |
| 157 SendKeyPress(ui::VKEY_O); |
| 158 |
| 159 // Verify the location of the caret. |
| 160 size_t start, end; |
| 161 omnibox->GetSelectionBounds(&start, &end); |
| 162 ASSERT_EQ(3U, start); |
| 163 ASSERT_EQ(3U, end); |
| 164 |
| 165 // Hit Home by sequencing Search (left Windows) and Left (arrow). |
| 166 SendKeyPress(ui::VKEY_LWIN); |
| 167 SendKeyPress(ui::VKEY_LEFT); |
| 168 |
| 169 // Verify caret moved to the beginning. |
| 170 omnibox->GetSelectionBounds(&start, &end); |
| 171 ASSERT_EQ(0U, start); |
| 172 ASSERT_EQ(0U, end); |
| 173 } |
| 174 |
142 } // namespace chromeos | 175 } // namespace chromeos |
OLD | NEW |