Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(797)

Side by Side Diff: ash/accelerators/accelerator_interactive_uitest_chromeos.cc

Issue 2775973002: Promotes more accessors from WmShell to Shell (Closed)
Patch Set: feedback Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/ash_touch_exploration_manager_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "ash/common/wm/window_state.h" 11 #include "ash/common/wm/window_state.h"
12 #include "ash/common/wm_shell.h"
13 #include "ash/shell.h" 12 #include "ash/shell.h"
14 #include "ash/test/ash_interactive_ui_test_base.h" 13 #include "ash/test/ash_interactive_ui_test_base.h"
15 #include "ash/test/test_screenshot_delegate.h" 14 #include "ash/test/test_screenshot_delegate.h"
16 #include "ash/wm/window_state_aura.h" 15 #include "ash/wm/window_state_aura.h"
17 #include "ash/wm/window_util.h" 16 #include "ash/wm/window_util.h"
18 #include "base/run_loop.h" 17 #include "base/run_loop.h"
19 #include "base/test/user_action_tester.cc" 18 #include "base/test/user_action_tester.cc"
20 #include "chromeos/network/network_handler.h" 19 #include "chromeos/network/network_handler.h"
21 #include "ui/app_list/presenter/app_list.h" 20 #include "ui/app_list/presenter/app_list.h"
22 #include "ui/app_list/presenter/test/test_app_list_presenter.h" 21 #include "ui/app_list/presenter/test/test_app_list_presenter.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 EXPECT_EQ(0, user_action_tester.GetActionCount("Accel_VolumeDown_F9")); 175 EXPECT_EQ(0, user_action_tester.GetActionCount("Accel_VolumeDown_F9"));
177 SendKeyPressSync(ui::VKEY_VOLUME_DOWN, false, false, false); 176 SendKeyPressSync(ui::VKEY_VOLUME_DOWN, false, false, false);
178 EXPECT_EQ(1, user_action_tester.GetActionCount("Accel_VolumeDown_F9")); 177 EXPECT_EQ(1, user_action_tester.GetActionCount("Accel_VolumeDown_F9"));
179 // Test VOLUME_UP. 178 // Test VOLUME_UP.
180 EXPECT_EQ(0, user_action_tester.GetActionCount("Accel_VolumeUp_F10")); 179 EXPECT_EQ(0, user_action_tester.GetActionCount("Accel_VolumeUp_F10"));
181 SendKeyPressSync(ui::VKEY_VOLUME_UP, false, false, false); 180 SendKeyPressSync(ui::VKEY_VOLUME_UP, false, false, false);
182 EXPECT_EQ(1, user_action_tester.GetActionCount("Accel_VolumeUp_F10")); 181 EXPECT_EQ(1, user_action_tester.GetActionCount("Accel_VolumeUp_F10"));
183 182
184 // Test TOGGLE_WIFI. 183 // Test TOGGLE_WIFI.
185 TestNetworkObserver network_observer; 184 TestNetworkObserver network_observer;
186 WmShell::Get()->system_tray_notifier()->AddNetworkObserver(&network_observer); 185 Shell::Get()->system_tray_notifier()->AddNetworkObserver(&network_observer);
187 186
188 EXPECT_FALSE(network_observer.wifi_enabled_status()); 187 EXPECT_FALSE(network_observer.wifi_enabled_status());
189 SendKeyPressSync(ui::VKEY_WLAN, false, false, false); 188 SendKeyPressSync(ui::VKEY_WLAN, false, false, false);
190 EXPECT_TRUE(network_observer.wifi_enabled_status()); 189 EXPECT_TRUE(network_observer.wifi_enabled_status());
191 SendKeyPressSync(ui::VKEY_WLAN, false, false, false); 190 SendKeyPressSync(ui::VKEY_WLAN, false, false, false);
192 EXPECT_FALSE(network_observer.wifi_enabled_status()); 191 EXPECT_FALSE(network_observer.wifi_enabled_status());
193 192
194 WmShell::Get()->system_tray_notifier()->RemoveNetworkObserver( 193 Shell::Get()->system_tray_notifier()->RemoveNetworkObserver(
195 &network_observer); 194 &network_observer);
196 } 195 }
197 196
198 // Tests the app list accelerator. 197 // Tests the app list accelerator.
199 TEST_F(AcceleratorInteractiveUITest, MAYBE_ToggleAppList) { 198 TEST_F(AcceleratorInteractiveUITest, MAYBE_ToggleAppList) {
200 app_list::test::TestAppListPresenter test_app_list_presenter; 199 app_list::test::TestAppListPresenter test_app_list_presenter;
201 Shell::Get()->app_list()->SetAppListPresenter( 200 Shell::Get()->app_list()->SetAppListPresenter(
202 test_app_list_presenter.CreateInterfacePtrAndBind()); 201 test_app_list_presenter.CreateInterfacePtrAndBind());
203 202
204 EXPECT_EQ(0u, test_app_list_presenter.toggle_count()); 203 EXPECT_EQ(0u, test_app_list_presenter.toggle_count());
205 SendKeyPressSync(ui::VKEY_LWIN, false, false, false); 204 SendKeyPressSync(ui::VKEY_LWIN, false, false, false);
206 RunAllPendingInMessageLoop(); 205 RunAllPendingInMessageLoop();
207 EXPECT_EQ(1u, test_app_list_presenter.toggle_count()); 206 EXPECT_EQ(1u, test_app_list_presenter.toggle_count());
208 SendKeyPressSync(ui::VKEY_LWIN, false, false, false); 207 SendKeyPressSync(ui::VKEY_LWIN, false, false, false);
209 RunAllPendingInMessageLoop(); 208 RunAllPendingInMessageLoop();
210 EXPECT_EQ(2u, test_app_list_presenter.toggle_count()); 209 EXPECT_EQ(2u, test_app_list_presenter.toggle_count());
211 } 210 }
212 211
213 } // namespace test 212 } // namespace test
214 } // namespace ash 213 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/ash_touch_exploration_manager_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698