Chromium Code Reviews| Index: media/audio/audio_output_proxy_unittest.cc |
| =================================================================== |
| --- media/audio/audio_output_proxy_unittest.cc (revision 111157) |
| +++ media/audio/audio_output_proxy_unittest.cc (working copy) |
| @@ -85,10 +85,15 @@ |
| AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, |
| CHANNEL_LAYOUT_STEREO, 44100, 16, 1024); |
| dispatcher_ = new AudioOutputDispatcher(&manager_, params, close_delay_ms); |
| + |
| + // Necessary to know how long the dispatcher will wait before posting |
| + // StopStreamTask. |
| + pause_delay_milliseconds_ = dispatcher_->pause_delay_milliseconds_; |
| } |
| MessageLoop message_loop_; |
| scoped_refptr<AudioOutputDispatcher> dispatcher_; |
| + int64 pause_delay_milliseconds_; |
| MockAudioManager manager_; |
| MockAudioSourceCallback callback_; |
| }; |
| @@ -187,9 +192,12 @@ |
| proxy->Start(&callback_); |
| proxy->Stop(); |
| - // Simulate a delay. |
| + // Wait for StreamStopped to post StopStreamTask. |
|
Sergey Ulanov
2011/11/23 19:12:18
nit: StreamStopped() and StopStreamTask() to make
Reid Kleckner (google)
2011/11/23 19:23:04
Done.
|
| + base::PlatformThread::Sleep(pause_delay_milliseconds_ * 3); |
|
Sergey Ulanov
2011/11/23 19:12:18
I think sleeping pause_delay_milliseconds_ should
Reid Kleckner (google)
2011/11/23 19:23:04
Done.
|
| message_loop_.RunAllPending(); |
| - base::PlatformThread::Sleep(kTestCloseDelayMs * 10); |
| + |
| + // Wait for the close timer to fire. |
| + base::PlatformThread::Sleep(kTestCloseDelayMs * 3); |
|
Sergey Ulanov
2011/11/23 19:12:18
"*2" and can you please update two other tests tha
Reid Kleckner (google)
2011/11/23 19:23:04
Done.
|
| message_loop_.RunAllPending(); |
| // Verify expectation before calling Close(). |