OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <memory> |
5 #include <vector> | 6 #include <vector> |
6 | 7 |
7 #include "ash/accessibility_delegate.h" | 8 #include "ash/accessibility_delegate.h" |
8 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 13 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
14 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" | 14 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" |
15 #include "chrome/test/base/in_process_browser_test.h" | 15 #include "chrome/test/base/in_process_browser_test.h" |
16 #include "chromeos/audio/chromeos_sounds.h" | 16 #include "chromeos/audio/chromeos_sounds.h" |
17 #include "chromeos/audio/cras_audio_handler.h" | 17 #include "chromeos/audio/cras_audio_handler.h" |
18 #include "chromeos/chromeos_switches.h" | 18 #include "chromeos/chromeos_switches.h" |
19 #include "media/audio/sounds/sounds_manager.h" | 19 #include "media/audio/sounds/sounds_manager.h" |
20 #include "ui/base/accelerators/accelerator.h" | 20 #include "ui/base/accelerators/accelerator.h" |
21 | 21 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 volume_controller_->HandleVolumeUp(ui::Accelerator()); | 82 volume_controller_->HandleVolumeUp(ui::Accelerator()); |
83 } | 83 } |
84 | 84 |
85 void VolumeDown() { | 85 void VolumeDown() { |
86 volume_controller_->HandleVolumeDown(ui::Accelerator()); | 86 volume_controller_->HandleVolumeDown(ui::Accelerator()); |
87 } | 87 } |
88 | 88 |
89 chromeos::CrasAudioHandler* audio_handler_; // Not owned. | 89 chromeos::CrasAudioHandler* audio_handler_; // Not owned. |
90 | 90 |
91 private: | 91 private: |
92 scoped_ptr<VolumeController> volume_controller_; | 92 std::unique_ptr<VolumeController> volume_controller_; |
93 | 93 |
94 DISALLOW_COPY_AND_ASSIGN(VolumeControllerTest); | 94 DISALLOW_COPY_AND_ASSIGN(VolumeControllerTest); |
95 }; | 95 }; |
96 | 96 |
97 IN_PROC_BROWSER_TEST_F(VolumeControllerTest, VolumeUpAndDown) { | 97 IN_PROC_BROWSER_TEST_F(VolumeControllerTest, VolumeUpAndDown) { |
98 // Set initial value as 50% | 98 // Set initial value as 50% |
99 const int kInitVolume = 50; | 99 const int kInitVolume = 50; |
100 audio_handler_->SetOutputVolumePercent(kInitVolume); | 100 audio_handler_->SetOutputVolumePercent(kInitVolume); |
101 | 101 |
102 EXPECT_EQ(audio_handler_->GetOutputVolumePercent(), kInitVolume); | 102 EXPECT_EQ(audio_handler_->GetOutputVolumePercent(), kInitVolume); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 EXPECT_FALSE(is_sound_initialized()); | 257 EXPECT_FALSE(is_sound_initialized()); |
258 | 258 |
259 // Check that sound isn't played on volume up and volume down. | 259 // Check that sound isn't played on volume up and volume down. |
260 audio_handler_->SetOutputVolumePercent(50); | 260 audio_handler_->SetOutputVolumePercent(50); |
261 VolumeUp(); | 261 VolumeUp(); |
262 VolumeDown(); | 262 VolumeDown(); |
263 EXPECT_EQ(0, num_play_requests()); | 263 EXPECT_EQ(0, num_play_requests()); |
264 } | 264 } |
265 | 265 |
266 } // namespace | 266 } // namespace |
OLD | NEW |