| 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 <memory> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "ash/common/accessibility_delegate.h" | 8 #include "ash/common/accessibility_delegate.h" |
| 9 #include "ash/common/accessibility_types.h" |
| 9 #include "ash/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
| 10 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 14 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 14 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" | 15 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" |
| 15 #include "chrome/test/base/in_process_browser_test.h" | 16 #include "chrome/test/base/in_process_browser_test.h" |
| 16 #include "chromeos/audio/chromeos_sounds.h" | 17 #include "chromeos/audio/chromeos_sounds.h" |
| 17 #include "chromeos/audio/cras_audio_handler.h" | 18 #include "chromeos/audio/cras_audio_handler.h" |
| 18 #include "chromeos/chromeos_switches.h" | 19 #include "chromeos/chromeos_switches.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 ~VolumeControllerSoundsTest() override {} | 169 ~VolumeControllerSoundsTest() override {} |
| 169 | 170 |
| 170 void SetUpInProcessBrowserTestFixture() override { | 171 void SetUpInProcessBrowserTestFixture() override { |
| 171 sounds_manager_ = new SoundsManagerTestImpl(); | 172 sounds_manager_ = new SoundsManagerTestImpl(); |
| 172 media::SoundsManager::InitializeForTesting(sounds_manager_); | 173 media::SoundsManager::InitializeForTesting(sounds_manager_); |
| 173 } | 174 } |
| 174 | 175 |
| 175 void EnableSpokenFeedback(bool enabled) { | 176 void EnableSpokenFeedback(bool enabled) { |
| 176 chromeos::AccessibilityManager* manager = | 177 chromeos::AccessibilityManager* manager = |
| 177 chromeos::AccessibilityManager::Get(); | 178 chromeos::AccessibilityManager::Get(); |
| 178 manager->EnableSpokenFeedback(enabled, ui::A11Y_NOTIFICATION_NONE); | 179 manager->EnableSpokenFeedback(enabled, ash::A11Y_NOTIFICATION_NONE); |
| 179 } | 180 } |
| 180 | 181 |
| 181 bool is_sound_initialized() const { | 182 bool is_sound_initialized() const { |
| 182 return sounds_manager_->is_sound_initialized(chromeos::SOUND_VOLUME_ADJUST); | 183 return sounds_manager_->is_sound_initialized(chromeos::SOUND_VOLUME_ADJUST); |
| 183 } | 184 } |
| 184 | 185 |
| 185 int num_play_requests() const { | 186 int num_play_requests() const { |
| 186 return sounds_manager_->num_play_requests(chromeos::SOUND_VOLUME_ADJUST); | 187 return sounds_manager_->num_play_requests(chromeos::SOUND_VOLUME_ADJUST); |
| 187 } | 188 } |
| 188 | 189 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 EXPECT_FALSE(is_sound_initialized()); | 258 EXPECT_FALSE(is_sound_initialized()); |
| 258 | 259 |
| 259 // Check that sound isn't played on volume up and volume down. | 260 // Check that sound isn't played on volume up and volume down. |
| 260 audio_handler_->SetOutputVolumePercent(50); | 261 audio_handler_->SetOutputVolumePercent(50); |
| 261 VolumeUp(); | 262 VolumeUp(); |
| 262 VolumeDown(); | 263 VolumeDown(); |
| 263 EXPECT_EQ(0, num_play_requests()); | 264 EXPECT_EQ(0, num_play_requests()); |
| 264 } | 265 } |
| 265 | 266 |
| 266 } // namespace | 267 } // namespace |
| OLD | NEW |