Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Unified Diff: media/audio/simple_sources_unittest.cc

Issue 9692038: stopping the audio thread before destroying the AudioManager<Platform> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: used the correct way to delete the fake streams & addressed Tommi's comment Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/audio/simple_sources_unittest.cc
diff --git a/media/audio/simple_sources_unittest.cc b/media/audio/simple_sources_unittest.cc
index ef00ed77c20a96f6c869608bb207f7aeaf37739f..95f2241ffc3997c969ca9f880ab63e6c8d82ffc5 100644
--- a/media/audio/simple_sources_unittest.cc
+++ b/media/audio/simple_sources_unittest.cc
@@ -78,12 +78,13 @@ TEST(SimpleSources, SineWaveAudio16MonoTest) {
oas->Start(&source);
oas->Stop();
- oas->Close();
- ASSERT_TRUE(FakeAudioOutputStream::GetLastFakeStream());
+ FakeAudioOutputStream* current_fake_stream =
+ reinterpret_cast<FakeAudioOutputStream*>(oas);
tommi (sloooow) - chröme 2012/03/13 14:16:52 use static_cast
no longer working on chromium 2012/03/13 15:03:39 Done.
+ ASSERT_TRUE(current_fake_stream);
const int16* last_buffer =
reinterpret_cast<int16*>(
- FakeAudioOutputStream::GetLastFakeStream()->buffer());
+ current_fake_stream->buffer());
ASSERT_TRUE(NULL != last_buffer);
uint32 half_period = AudioParameters::kTelephoneSampleRate / (freq * 2);
@@ -98,4 +99,5 @@ TEST(SimpleSources, SineWaveAudio16MonoTest) {
EXPECT_EQ(-5126, last_buffer[half_period + 1]);
EXPECT_TRUE(last_buffer[half_period + 1] > last_buffer[half_period + 2]);
EXPECT_TRUE(last_buffer[half_period + 2] > last_buffer[half_period + 3]);
+ oas->Close();
}

Powered by Google App Engine
This is Rietveld 408576698