| 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/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/sticky_keys/sticky_keys_controller.h" | 8 #include "ash/sticky_keys/sticky_keys_controller.h" |
| 9 #include "ash/sticky_keys/sticky_keys_overlay.h" | 9 #include "ash/sticky_keys/sticky_keys_overlay.h" |
| 10 #include "ash/system/tray/system_tray.h" | 10 #include "ash/system/tray/system_tray.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 ash::SystemTray* GetSystemTray() { | 52 ash::SystemTray* GetSystemTray() { |
| 53 return ash::Shell::GetInstance()->GetPrimarySystemTray(); | 53 return ash::Shell::GetInstance()->GetPrimarySystemTray(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void SendKeyPress(ui::KeyboardCode key) { | 56 void SendKeyPress(ui::KeyboardCode key) { |
| 57 event_generator_->PressKey(key, ui::EF_NONE); | 57 event_generator_->PressKey(key, ui::EF_NONE); |
| 58 event_generator_->ReleaseKey(key, ui::EF_NONE); | 58 event_generator_->ReleaseKey(key, ui::EF_NONE); |
| 59 } | 59 } |
| 60 | 60 |
| 61 content::NotificationRegistrar registrar_; | 61 content::NotificationRegistrar registrar_; |
| 62 scoped_ptr<ui::test::EventGenerator> event_generator_; | 62 std::unique_ptr<ui::test::EventGenerator> event_generator_; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(StickyKeysBrowserTest); | 64 DISALLOW_COPY_AND_ASSIGN(StickyKeysBrowserTest); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 IN_PROC_BROWSER_TEST_F(StickyKeysBrowserTest, OpenTrayMenu) { | 67 IN_PROC_BROWSER_TEST_F(StickyKeysBrowserTest, OpenTrayMenu) { |
| 68 EnableStickyKeys(); | 68 EnableStickyKeys(); |
| 69 | 69 |
| 70 // Open system tray bubble with shortcut. | 70 // Open system tray bubble with shortcut. |
| 71 SendKeyPress(ui::VKEY_MENU); // alt key. | 71 SendKeyPress(ui::VKEY_MENU); // alt key. |
| 72 SendKeyPress(ui::VKEY_SHIFT); | 72 SendKeyPress(ui::VKEY_SHIFT); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 EXPECT_TRUE(sticky_keys_overlay->is_visible()); | 222 EXPECT_TRUE(sticky_keys_overlay->is_visible()); |
| 223 DisableStickyKeys(); | 223 DisableStickyKeys(); |
| 224 EXPECT_FALSE(controller->GetOverlayForTest()); | 224 EXPECT_FALSE(controller->GetOverlayForTest()); |
| 225 for (auto key_code : modifier_keys) { | 225 for (auto key_code : modifier_keys) { |
| 226 SendKeyPress(key_code); | 226 SendKeyPress(key_code); |
| 227 EXPECT_FALSE(controller->GetOverlayForTest()); | 227 EXPECT_FALSE(controller->GetOverlayForTest()); |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace chromeos | 231 } // namespace chromeos |
| OLD | NEW |