Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ash/common/accelerators/accelerator_controller.h" | 5 #include "ash/common/accelerators/accelerator_controller.h" |
| 6 | 6 |
| 7 #include "ash/common/shell_observer.h" | 7 #include "ash/common/shell_observer.h" |
| 8 #include "ash/common/system/chromeos/network/network_observer.h" | 8 #include "ash/common/system/chromeos/network/network_observer.h" |
| 9 #include "ash/common/system/tray/system_tray_delegate.h" | 9 #include "ash/common/system/tray/system_tray_delegate.h" |
| 10 #include "ash/common/system/tray/system_tray_notifier.h" | 10 #include "ash/common/system/tray/system_tray_notifier.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 // using ui_controls::Send*() functions. | 55 // using ui_controls::Send*() functions. |
| 56 // This is to catch any future regressions (crbug.com/469235). | 56 // This is to catch any future regressions (crbug.com/469235). |
| 57 class AcceleratorInteractiveUITest : public AshInteractiveUITestBase, | 57 class AcceleratorInteractiveUITest : public AshInteractiveUITestBase, |
| 58 public ShellObserver { | 58 public ShellObserver { |
| 59 public: | 59 public: |
| 60 AcceleratorInteractiveUITest() : is_in_overview_mode_(false) {} | 60 AcceleratorInteractiveUITest() : is_in_overview_mode_(false) {} |
| 61 | 61 |
| 62 void SetUp() override { | 62 void SetUp() override { |
| 63 AshInteractiveUITestBase::SetUp(); | 63 AshInteractiveUITestBase::SetUp(); |
| 64 | 64 |
| 65 WmShell::Get()->AddShellObserver(this); | 65 Shell::GetInstance()->AddShellObserver(this); |
|
msw
2017/03/08 19:52:23
tangential: wdyt about adding Shell::Get and phasi
sky
2017/03/08 20:26:06
+1 will do it separately.
| |
| 66 | 66 |
| 67 chromeos::NetworkHandler::Initialize(); | 67 chromeos::NetworkHandler::Initialize(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void TearDown() override { | 70 void TearDown() override { |
| 71 chromeos::NetworkHandler::Shutdown(); | 71 chromeos::NetworkHandler::Shutdown(); |
| 72 | 72 |
| 73 WmShell::Get()->RemoveShellObserver(this); | 73 Shell::GetInstance()->RemoveShellObserver(this); |
| 74 | 74 |
| 75 AshInteractiveUITestBase::TearDown(); | 75 AshInteractiveUITestBase::TearDown(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 // Sends a key press event and waits synchronously until it's completely | 78 // Sends a key press event and waits synchronously until it's completely |
| 79 // processed. | 79 // processed. |
| 80 void SendKeyPressSync(ui::KeyboardCode key, | 80 void SendKeyPressSync(ui::KeyboardCode key, |
| 81 bool control, | 81 bool control, |
| 82 bool shift, | 82 bool shift, |
| 83 bool alt) { | 83 bool alt) { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 SendKeyPressSync(ui::VKEY_LWIN, false, false, false); | 207 SendKeyPressSync(ui::VKEY_LWIN, false, false, false); |
| 208 RunAllPendingInMessageLoop(); | 208 RunAllPendingInMessageLoop(); |
| 209 EXPECT_EQ(1u, test_app_list_presenter.toggle_count()); | 209 EXPECT_EQ(1u, test_app_list_presenter.toggle_count()); |
| 210 SendKeyPressSync(ui::VKEY_LWIN, false, false, false); | 210 SendKeyPressSync(ui::VKEY_LWIN, false, false, false); |
| 211 RunAllPendingInMessageLoop(); | 211 RunAllPendingInMessageLoop(); |
| 212 EXPECT_EQ(2u, test_app_list_presenter.toggle_count()); | 212 EXPECT_EQ(2u, test_app_list_presenter.toggle_count()); |
| 213 } | 213 } |
| 214 | 214 |
| 215 } // namespace test | 215 } // namespace test |
| 216 } // namespace ash | 216 } // namespace ash |
| OLD | NEW |