| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "ash/common/system/tray/system_tray.h" | 7 #include "ash/common/system/tray/system_tray.h" |
| 8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/sticky_keys/sticky_keys_controller.h" | 10 #include "ash/sticky_keys/sticky_keys_controller.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 EnableStickyKeys(); | 156 EnableStickyKeys(); |
| 157 | 157 |
| 158 OmniboxView* omnibox = | 158 OmniboxView* omnibox = |
| 159 browser()->window()->GetLocationBar()->GetOmniboxView(); | 159 browser()->window()->GetLocationBar()->GetOmniboxView(); |
| 160 | 160 |
| 161 // Give the omnibox focus. | 161 // Give the omnibox focus. |
| 162 omnibox->SetFocus(); | 162 omnibox->SetFocus(); |
| 163 | 163 |
| 164 // Make sure that the AppList is not erroneously displayed and the omnibox | 164 // Make sure that the AppList is not erroneously displayed and the omnibox |
| 165 // doesn't lose focus. | 165 // doesn't lose focus. |
| 166 EXPECT_FALSE(ash::WmShell::Get()->GetAppListTargetVisibility()); | 166 EXPECT_FALSE(ash::Shell::Get()->GetAppListTargetVisibility()); |
| 167 EXPECT_TRUE(omnibox->GetNativeView()->HasFocus()); | 167 EXPECT_TRUE(omnibox->GetNativeView()->HasFocus()); |
| 168 | 168 |
| 169 // Type 'foo'. | 169 // Type 'foo'. |
| 170 SendKeyPress(ui::VKEY_F); | 170 SendKeyPress(ui::VKEY_F); |
| 171 SendKeyPress(ui::VKEY_O); | 171 SendKeyPress(ui::VKEY_O); |
| 172 SendKeyPress(ui::VKEY_O); | 172 SendKeyPress(ui::VKEY_O); |
| 173 | 173 |
| 174 // Verify the location of the caret. | 174 // Verify the location of the caret. |
| 175 size_t start, end; | 175 size_t start, end; |
| 176 omnibox->GetSelectionBounds(&start, &end); | 176 omnibox->GetSelectionBounds(&start, &end); |
| 177 ASSERT_EQ(3U, start); | 177 ASSERT_EQ(3U, start); |
| 178 ASSERT_EQ(3U, end); | 178 ASSERT_EQ(3U, end); |
| 179 | 179 |
| 180 EXPECT_FALSE(ash::WmShell::Get()->GetAppListTargetVisibility()); | 180 EXPECT_FALSE(ash::Shell::Get()->GetAppListTargetVisibility()); |
| 181 EXPECT_TRUE(omnibox->GetNativeView()->HasFocus()); | 181 EXPECT_TRUE(omnibox->GetNativeView()->HasFocus()); |
| 182 | 182 |
| 183 // Hit Home by sequencing Search (left Windows) and Left (arrow). | 183 // Hit Home by sequencing Search (left Windows) and Left (arrow). |
| 184 SendKeyPress(ui::VKEY_LWIN); | 184 SendKeyPress(ui::VKEY_LWIN); |
| 185 SendKeyPress(ui::VKEY_LEFT); | 185 SendKeyPress(ui::VKEY_LEFT); |
| 186 | 186 |
| 187 EXPECT_FALSE(ash::WmShell::Get()->GetAppListTargetVisibility()); | 187 EXPECT_FALSE(ash::Shell::Get()->GetAppListTargetVisibility()); |
| 188 EXPECT_TRUE(omnibox->GetNativeView()->HasFocus()); | 188 EXPECT_TRUE(omnibox->GetNativeView()->HasFocus()); |
| 189 | 189 |
| 190 // Verify caret moved to the beginning. | 190 // Verify caret moved to the beginning. |
| 191 omnibox->GetSelectionBounds(&start, &end); | 191 omnibox->GetSelectionBounds(&start, &end); |
| 192 ASSERT_EQ(0U, start); | 192 ASSERT_EQ(0U, start); |
| 193 ASSERT_EQ(0U, end); | 193 ASSERT_EQ(0U, end); |
| 194 } | 194 } |
| 195 | 195 |
| 196 IN_PROC_BROWSER_TEST_F(StickyKeysBrowserTest, OverlayShown) { | 196 IN_PROC_BROWSER_TEST_F(StickyKeysBrowserTest, OverlayShown) { |
| 197 const ui::KeyboardCode modifier_keys[] = { ui::VKEY_CONTROL, | 197 const ui::KeyboardCode modifier_keys[] = { ui::VKEY_CONTROL, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 225 EXPECT_TRUE(sticky_keys_overlay->is_visible()); | 225 EXPECT_TRUE(sticky_keys_overlay->is_visible()); |
| 226 DisableStickyKeys(); | 226 DisableStickyKeys(); |
| 227 EXPECT_FALSE(controller->GetOverlayForTest()); | 227 EXPECT_FALSE(controller->GetOverlayForTest()); |
| 228 for (auto key_code : modifier_keys) { | 228 for (auto key_code : modifier_keys) { |
| 229 SendKeyPress(key_code); | 229 SendKeyPress(key_code); |
| 230 EXPECT_FALSE(controller->GetOverlayForTest()); | 230 EXPECT_FALSE(controller->GetOverlayForTest()); |
| 231 } | 231 } |
| 232 } | 232 } |
| 233 | 233 |
| 234 } // namespace chromeos | 234 } // namespace chromeos |
| OLD | NEW |