| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 audio_device_->Initialize(default_audio_parameters_, | 158 audio_device_->Initialize(default_audio_parameters_, |
| 159 &callback_); | 159 &callback_); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void AudioOutputDeviceTest::ReceiveAuthorization(OutputDeviceStatus status) { | 162 void AudioOutputDeviceTest::ReceiveAuthorization(OutputDeviceStatus status) { |
| 163 device_status_ = status; | 163 device_status_ = status; |
| 164 if (device_status_ != OUTPUT_DEVICE_STATUS_OK) | 164 if (device_status_ != OUTPUT_DEVICE_STATUS_OK) |
| 165 EXPECT_CALL(*audio_output_ipc_, CloseStream()); | 165 EXPECT_CALL(*audio_output_ipc_, CloseStream()); |
| 166 | 166 |
| 167 audio_device_->OnDeviceAuthorized(device_status_, default_audio_parameters_); | 167 audio_device_->OnDeviceAuthorized(device_status_, default_audio_parameters_, |
| 168 kDefaultDeviceId); |
| 168 io_loop_.RunUntilIdle(); | 169 io_loop_.RunUntilIdle(); |
| 169 } | 170 } |
| 170 | 171 |
| 171 void AudioOutputDeviceTest::StartAudioDevice() { | 172 void AudioOutputDeviceTest::StartAudioDevice() { |
| 172 if (device_status_ == OUTPUT_DEVICE_STATUS_OK) | 173 if (device_status_ == OUTPUT_DEVICE_STATUS_OK) |
| 173 EXPECT_CALL(*audio_output_ipc_, CreateStream(audio_device_.get(), _)); | 174 EXPECT_CALL(*audio_output_ipc_, CreateStream(audio_device_.get(), _)); |
| 174 else | 175 else |
| 175 EXPECT_CALL(callback_, OnRenderError()); | 176 EXPECT_CALL(callback_, OnRenderError()); |
| 176 | 177 |
| 177 audio_device_->Start(); | 178 audio_device_->Start(); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 | 313 |
| 313 TEST_P(AudioOutputDeviceTest, UnauthorizedDevice) { | 314 TEST_P(AudioOutputDeviceTest, UnauthorizedDevice) { |
| 314 SetDevice(kUnauthorizedDeviceId); | 315 SetDevice(kUnauthorizedDeviceId); |
| 315 StartAudioDevice(); | 316 StartAudioDevice(); |
| 316 StopAudioDevice(); | 317 StopAudioDevice(); |
| 317 } | 318 } |
| 318 | 319 |
| 319 INSTANTIATE_TEST_CASE_P(Render, AudioOutputDeviceTest, Values(false)); | 320 INSTANTIATE_TEST_CASE_P(Render, AudioOutputDeviceTest, Values(false)); |
| 320 | 321 |
| 321 } // namespace media. | 322 } // namespace media. |
| OLD | NEW |