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

Unified Diff: ash/accelerators/accelerator_interactive_uitest_chromeos.cc

Issue 2427913003: Use mojo volume interfaces for mash and classic ash. (Closed)
Patch Set: Split volume and system events observers; only hook up volume. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: ash/accelerators/accelerator_interactive_uitest_chromeos.cc
diff --git a/ash/accelerators/accelerator_interactive_uitest_chromeos.cc b/ash/accelerators/accelerator_interactive_uitest_chromeos.cc
index a32b4bf3ae376816d1f7a8efdb03203bd035bbe5..7663fc47f871d5564a8ed9e78d1f24c66c697c6b 100644
--- a/ash/accelerators/accelerator_interactive_uitest_chromeos.cc
+++ b/ash/accelerators/accelerator_interactive_uitest_chromeos.cc
@@ -8,7 +8,6 @@
#include "ash/common/system/chromeos/network/network_observer.h"
#include "ash/common/system/tray/system_tray_delegate.h"
#include "ash/common/system/tray/system_tray_notifier.h"
-#include "ash/common/test/test_volume_control_delegate.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm_shell.h"
#include "ash/shell.h"
@@ -17,6 +16,7 @@
#include "ash/wm/window_state_aura.h"
#include "ash/wm/window_util.h"
#include "base/run_loop.h"
+#include "base/test/user_action_tester.cc"
#include "chromeos/network/network_handler.h"
#include "ui/base/test/ui_controls.h"
@@ -165,22 +165,19 @@ TEST_F(AcceleratorInteractiveUITest, MAYBE_ChromeOsAccelerators) {
// Press ESC to go out of the partial screenshot mode.
SendKeyPressSync(ui::VKEY_ESCAPE, false, false, false);
- // Test VOLUME_MUTE, VOLUME_DOWN, and VOLUME_UP.
- TestVolumeControlDelegate* volume_delegate = new TestVolumeControlDelegate;
- WmShell::Get()->system_tray_delegate()->SetVolumeControlDelegate(
- std::unique_ptr<VolumeControlDelegate>(volume_delegate));
- // VOLUME_MUTE.
- EXPECT_EQ(0, volume_delegate->handle_volume_mute_count());
+ // Test VOLUME_MUTE.
+ base::UserActionTester user_action_tester;
+ EXPECT_EQ(0, user_action_tester.GetActionCount("Accel_VolumeMute_F8"));
SendKeyPressSync(ui::VKEY_VOLUME_MUTE, false, false, false);
- EXPECT_EQ(1, volume_delegate->handle_volume_mute_count());
- // VOLUME_DOWN.
- EXPECT_EQ(0, volume_delegate->handle_volume_down_count());
+ EXPECT_EQ(1, user_action_tester.GetActionCount("Accel_VolumeMute_F8"));
+ // Test VOLUME_DOWN.
+ EXPECT_EQ(0, user_action_tester.GetActionCount("Accel_VolumeDown_F9"));
SendKeyPressSync(ui::VKEY_VOLUME_DOWN, false, false, false);
- EXPECT_EQ(1, volume_delegate->handle_volume_down_count());
- // VOLUME_UP.
- EXPECT_EQ(0, volume_delegate->handle_volume_up_count());
+ EXPECT_EQ(1, user_action_tester.GetActionCount("Accel_VolumeDown_F9"));
+ // Test VOLUME_UP.
+ EXPECT_EQ(0, user_action_tester.GetActionCount("Accel_VolumeUp_F10"));
SendKeyPressSync(ui::VKEY_VOLUME_UP, false, false, false);
- EXPECT_EQ(1, volume_delegate->handle_volume_up_count());
+ EXPECT_EQ(1, user_action_tester.GetActionCount("Accel_VolumeUp_F10"));
// Test TOGGLE_WIFI.
TestNetworkObserver network_observer;
« no previous file with comments | « ash/accelerators/accelerator_controller_unittest.cc ('k') | ash/common/accelerators/accelerator_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698