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

Unified Diff: ash/accelerators/accelerator_controller_unittest.cc

Issue 10825264: Consolidate volume control code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + Fix virutal function name. Created 8 years, 4 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
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | ash/system/audio/tray_volume.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller_unittest.cc
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc
index 9f48103e715a171b99e4c39d4a8aa01309310170..25804d228f742bdfcd1abf12fb6f9540b402f8d2 100644
--- a/ash/accelerators/accelerator_controller_unittest.cc
+++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -11,6 +11,7 @@
#include "ash/shell_window_ids.h"
#include "ash/system/brightness/brightness_control_delegate.h"
#include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h"
+#include "ash/system/tray/system_tray_delegate.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/test_shell_delegate.h"
#include "ash/volume_control_delegate.h"
@@ -143,6 +144,16 @@ class DummyVolumeControlDelegate : public VolumeControlDelegate {
}
virtual void SetVolumePercent(double percent) OVERRIDE {
}
+ virtual bool IsAudioMuted() const OVERRIDE {
+ return false;
+ }
+ virtual void SetAudioMuted(bool muted) OVERRIDE {
+ }
+ virtual float GetVolumeLevel() const OVERRIDE {
+ return 0.0;
+ }
+ virtual void SetVolumeLevel(float level) OVERRIDE {
+ }
int handle_volume_mute_count() const {
return handle_volume_mute_count_;
@@ -615,12 +626,12 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) {
const ui::Accelerator f9(ui::VKEY_F9, ui::EF_NONE);
const ui::Accelerator f10(ui::VKEY_F10, ui::EF_NONE);
{
- EXPECT_FALSE(GetController()->Process(f8));
- EXPECT_FALSE(GetController()->Process(f9));
- EXPECT_FALSE(GetController()->Process(f10));
+ EXPECT_TRUE(GetController()->Process(f8));
+ EXPECT_TRUE(GetController()->Process(f9));
+ EXPECT_TRUE(GetController()->Process(f10));
DummyVolumeControlDelegate* delegate =
new DummyVolumeControlDelegate(false);
- GetController()->SetVolumeControlDelegate(
+ ash::Shell::GetInstance()->tray_delegate()->SetVolumeControlDelegate(
scoped_ptr<VolumeControlDelegate>(delegate).Pass());
EXPECT_EQ(0, delegate->handle_volume_mute_count());
EXPECT_FALSE(GetController()->Process(f8));
@@ -637,7 +648,7 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) {
}
{
DummyVolumeControlDelegate* delegate = new DummyVolumeControlDelegate(true);
- GetController()->SetVolumeControlDelegate(
+ ash::Shell::GetInstance()->tray_delegate()->SetVolumeControlDelegate(
scoped_ptr<VolumeControlDelegate>(delegate).Pass());
EXPECT_EQ(0, delegate->handle_volume_mute_count());
EXPECT_TRUE(GetController()->Process(f8));
@@ -658,7 +669,7 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) {
{
DummyVolumeControlDelegate* delegate =
new DummyVolumeControlDelegate(false);
- GetController()->SetVolumeControlDelegate(
+ ash::Shell::GetInstance()->tray_delegate()->SetVolumeControlDelegate(
scoped_ptr<VolumeControlDelegate>(delegate).Pass());
EXPECT_EQ(0, delegate->handle_volume_mute_count());
EXPECT_FALSE(GetController()->Process(volume_mute));
@@ -675,7 +686,7 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) {
}
{
DummyVolumeControlDelegate* delegate = new DummyVolumeControlDelegate(true);
- GetController()->SetVolumeControlDelegate(
+ ash::Shell::GetInstance()->tray_delegate()->SetVolumeControlDelegate(
scoped_ptr<VolumeControlDelegate>(delegate).Pass());
EXPECT_EQ(0, delegate->handle_volume_mute_count());
EXPECT_TRUE(GetController()->Process(volume_mute));
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | ash/system/audio/tray_volume.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698