| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ash_touch_exploration_manager_chromeos.h" | 5 #include "ash/ash_touch_exploration_manager_chromeos.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 10 #include "chromeos/audio/cras_audio_handler.h" | 10 #include "chromeos/audio/cras_audio_handler.h" |
| 11 | 11 |
| 12 namespace ash { | 12 namespace ash { |
| 13 | 13 |
| 14 typedef test::AshTestBase AshTouchExplorationManagerTest; | 14 typedef test::AshTestBase AshTouchExplorationManagerTest; |
| 15 | 15 |
| 16 TEST_F(AshTouchExplorationManagerTest, AdjustSound) { | 16 TEST_F(AshTouchExplorationManagerTest, AdjustSound) { |
| 17 RootWindowController* controller = Shell::GetPrimaryRootWindowController(); | 17 RootWindowController* controller = Shell::GetPrimaryRootWindowController(); |
| 18 AshTouchExplorationManager touch_exploration_manager(controller); | 18 AshTouchExplorationManager touch_exploration_manager(controller); |
| 19 chromeos::CrasAudioHandler* audio_handler = | 19 chromeos::CrasAudioHandler* audio_handler = chromeos::CrasAudioHandler::Get(); |
| 20 chromeos::CrasAudioHandler::Get(); | |
| 21 | 20 |
| 22 touch_exploration_manager.SetOutputLevel(10); | 21 touch_exploration_manager.SetOutputLevel(10); |
| 23 EXPECT_EQ(audio_handler->GetOutputVolumePercent(), 10); | 22 EXPECT_EQ(audio_handler->GetOutputVolumePercent(), 10); |
| 24 EXPECT_FALSE(audio_handler->IsOutputMuted()); | 23 EXPECT_FALSE(audio_handler->IsOutputMuted()); |
| 25 | 24 |
| 26 touch_exploration_manager.SetOutputLevel(100); | 25 touch_exploration_manager.SetOutputLevel(100); |
| 27 EXPECT_EQ(audio_handler->GetOutputVolumePercent(), 100); | 26 EXPECT_EQ(audio_handler->GetOutputVolumePercent(), 100); |
| 28 EXPECT_FALSE(audio_handler->IsOutputMuted()); | 27 EXPECT_FALSE(audio_handler->IsOutputMuted()); |
| 29 | 28 |
| 30 touch_exploration_manager.SetOutputLevel(0); | 29 touch_exploration_manager.SetOutputLevel(0); |
| 31 EXPECT_EQ(audio_handler->GetOutputVolumePercent(), 0); | 30 EXPECT_EQ(audio_handler->GetOutputVolumePercent(), 0); |
| 32 EXPECT_TRUE(audio_handler->IsOutputMuted()); | 31 EXPECT_TRUE(audio_handler->IsOutputMuted()); |
| 33 | 32 |
| 34 touch_exploration_manager.SetOutputLevel(-10); | 33 touch_exploration_manager.SetOutputLevel(-10); |
| 35 EXPECT_EQ(audio_handler->GetOutputVolumePercent(), 0); | 34 EXPECT_EQ(audio_handler->GetOutputVolumePercent(), 0); |
| 36 EXPECT_TRUE(audio_handler->IsOutputMuted()); | 35 EXPECT_TRUE(audio_handler->IsOutputMuted()); |
| 37 } | 36 } |
| 38 | 37 |
| 39 } // namespace ash | 38 } // namespace ash |
| OLD | NEW |