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 // MSVC++ requires this to be set before any other includes to get M_PI. | 5 // MSVC++ requires this to be set before any other includes to get M_PI. |
6 #define _USE_MATH_DEFINES | 6 #define _USE_MATH_DEFINES |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 } | 389 } |
390 | 390 |
391 mixer_callback_->OnRenderError(); | 391 mixer_callback_->OnRenderError(); |
392 for (size_t i = 0; i < mixer_inputs_.size(); ++i) | 392 for (size_t i = 0; i < mixer_inputs_.size(); ++i) |
393 mixer_inputs_[i]->Stop(); | 393 mixer_inputs_[i]->Stop(); |
394 } | 394 } |
395 | 395 |
396 TEST_P(AudioRendererMixerBehavioralTest, OnRenderErrorPausedInput) { | 396 TEST_P(AudioRendererMixerBehavioralTest, OnRenderErrorPausedInput) { |
397 InitializeInputs(kMixerInputs); | 397 InitializeInputs(kMixerInputs); |
398 | 398 |
399 for (size_t i = 0; i < mixer_inputs_.size(); ++i) | 399 for (size_t i = 0; i < mixer_inputs_.size(); ++i) { |
| 400 mixer_inputs_[i]->Start(); |
400 EXPECT_CALL(*fake_callbacks_[i], OnRenderError()).Times(1); | 401 EXPECT_CALL(*fake_callbacks_[i], OnRenderError()).Times(1); |
| 402 } |
401 | 403 |
402 // Fire the error before attaching any inputs. Ensure an error is recieved | 404 // Fire the error before attaching any inputs. Ensure an error is recieved |
403 // even if the input is not connected. | 405 // even if the input is not connected. |
404 mixer_callback_->OnRenderError(); | 406 mixer_callback_->OnRenderError(); |
405 | 407 |
406 for (size_t i = 0; i < mixer_inputs_.size(); ++i) | 408 for (size_t i = 0; i < mixer_inputs_.size(); ++i) |
407 mixer_inputs_[i]->Stop(); | 409 mixer_inputs_[i]->Stop(); |
408 } | 410 } |
409 | 411 |
410 // Ensure constructing an AudioRendererMixerInput, but not initializing it does | 412 // Ensure constructing an AudioRendererMixerInput, but not initializing it does |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 | 474 |
473 // Test cases for behavior which is independent of parameters. Values() doesn't | 475 // Test cases for behavior which is independent of parameters. Values() doesn't |
474 // support single item lists and we don't want these test cases to run for every | 476 // support single item lists and we don't want these test cases to run for every |
475 // parameter set. | 477 // parameter set. |
476 INSTANTIATE_TEST_CASE_P( | 478 INSTANTIATE_TEST_CASE_P( |
477 AudioRendererMixerBehavioralTest, AudioRendererMixerBehavioralTest, | 479 AudioRendererMixerBehavioralTest, AudioRendererMixerBehavioralTest, |
478 testing::ValuesIn(std::vector<AudioRendererMixerTestData>( | 480 testing::ValuesIn(std::vector<AudioRendererMixerTestData>( |
479 1, std::tr1::make_tuple(44100, 44100, 0)))); | 481 1, std::tr1::make_tuple(44100, 44100, 0)))); |
480 | 482 |
481 } // namespace media | 483 } // namespace media |
OLD | NEW |