| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "media/audio/audio_manager.h" | 9 #include "media/audio/audio_manager.h" |
| 10 #include "media/audio/audio_manager_base.h" | 10 #include "media/audio/audio_manager_base.h" |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 MockAudioSourceCallback callback_; | 410 MockAudioSourceCallback callback_; |
| 411 AudioParameters params_; | 411 AudioParameters params_; |
| 412 }; | 412 }; |
| 413 | 413 |
| 414 class AudioOutputResamplerTest : public AudioOutputProxyTest { | 414 class AudioOutputResamplerTest : public AudioOutputProxyTest { |
| 415 public: | 415 public: |
| 416 virtual void TearDown() { | 416 virtual void TearDown() { |
| 417 AudioOutputProxyTest::TearDown(); | 417 AudioOutputProxyTest::TearDown(); |
| 418 } | 418 } |
| 419 | 419 |
| 420 virtual void InitDispatcher(base::TimeDelta close_delay) OVERRIDE { | 420 virtual void InitDispatcher(base::TimeDelta close_delay) override { |
| 421 // Use a low sample rate and large buffer size when testing otherwise the | 421 // Use a low sample rate and large buffer size when testing otherwise the |
| 422 // FakeAudioOutputStream will keep the message loop busy indefinitely; i.e., | 422 // FakeAudioOutputStream will keep the message loop busy indefinitely; i.e., |
| 423 // RunUntilIdle() will never terminate. | 423 // RunUntilIdle() will never terminate. |
| 424 resampler_params_ = AudioParameters( | 424 resampler_params_ = AudioParameters( |
| 425 AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO, | 425 AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO, |
| 426 16000, 16, 1024); | 426 16000, 16, 1024); |
| 427 resampler_ = new AudioOutputResampler( | 427 resampler_ = new AudioOutputResampler( |
| 428 &manager(), params_, resampler_params_, std::string(), close_delay); | 428 &manager(), params_, resampler_params_, std::string(), close_delay); |
| 429 } | 429 } |
| 430 | 430 |
| 431 virtual void OnStart() OVERRIDE { | 431 virtual void OnStart() override { |
| 432 // Let Start() run for a bit. | 432 // Let Start() run for a bit. |
| 433 base::RunLoop run_loop; | 433 base::RunLoop run_loop; |
| 434 message_loop_.PostDelayedTask( | 434 message_loop_.PostDelayedTask( |
| 435 FROM_HERE, | 435 FROM_HERE, |
| 436 run_loop.QuitClosure(), | 436 run_loop.QuitClosure(), |
| 437 base::TimeDelta::FromMilliseconds(kStartRunTimeMs)); | 437 base::TimeDelta::FromMilliseconds(kStartRunTimeMs)); |
| 438 run_loop.Run(); | 438 run_loop.Run(); |
| 439 } | 439 } |
| 440 | 440 |
| 441 protected: | 441 protected: |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 proxy1->Stop(); | 670 proxy1->Stop(); |
| 671 CloseAndWaitForCloseTimer(proxy1, &stream1); | 671 CloseAndWaitForCloseTimer(proxy1, &stream1); |
| 672 | 672 |
| 673 EXPECT_TRUE(stream1.stop_called()); | 673 EXPECT_TRUE(stream1.stop_called()); |
| 674 EXPECT_TRUE(stream1.start_called()); | 674 EXPECT_TRUE(stream1.start_called()); |
| 675 EXPECT_TRUE(stream2.stop_called()); | 675 EXPECT_TRUE(stream2.stop_called()); |
| 676 EXPECT_TRUE(stream2.start_called()); | 676 EXPECT_TRUE(stream2.start_called()); |
| 677 } | 677 } |
| 678 | 678 |
| 679 } // namespace media | 679 } // namespace media |
| OLD | NEW |