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

Unified Diff: media/cast/audio_receiver/audio_decoder_unittest.cc

Issue 145443005: Fixes for memory and threading issues in cast (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compile Created 6 years, 11 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/cast/audio_receiver/audio_decoder_unittest.cc
diff --git a/media/cast/audio_receiver/audio_decoder_unittest.cc b/media/cast/audio_receiver/audio_decoder_unittest.cc
index 4c29169074b1f7c87f06cb8ee5efa81f73d722f4..f01f0efac1bb28bf9155272a7e2c68240f8d8f1d 100644
--- a/media/cast/audio_receiver/audio_decoder_unittest.cc
+++ b/media/cast/audio_receiver/audio_decoder_unittest.cc
@@ -27,9 +27,11 @@ class TestRtpPayloadFeedback : public RtpPayloadFeedback {
class AudioDecoderTest : public ::testing::Test {
protected:
AudioDecoderTest() {
- testing_clock_.Advance(base::TimeDelta::FromMilliseconds(1234));
- task_runner_ = new test::FakeTaskRunner(&testing_clock_);
- cast_environment_ = new CastEnvironment(&testing_clock_, task_runner_,
+ testing_clock_ = new base::SimpleTestTickClock();
+ testing_clock_->Advance(base::TimeDelta::FromMilliseconds(1234));
+ task_runner_ = new test::FakeTaskRunner(testing_clock_);
+ cast_environment_ = new CastEnvironment(
+ scoped_ptr<base::TickClock>(testing_clock_).Pass(), task_runner_,
task_runner_, task_runner_, task_runner_, task_runner_, task_runner_,
GetDefaultCastReceiverLoggingConfig());
}
@@ -41,7 +43,8 @@ class AudioDecoderTest : public ::testing::Test {
}
TestRtpPayloadFeedback cast_feedback_;
- base::SimpleTestTickClock testing_clock_;
+ // Owned by CastEnvironment.
+ base::SimpleTestTickClock* testing_clock_;
scoped_refptr<test::FakeTaskRunner> task_runner_;
scoped_refptr<CastEnvironment> cast_environment_;
scoped_ptr<AudioDecoder> audio_decoder_;
@@ -162,7 +165,7 @@ TEST_F(AudioDecoderTest, Pcm16StereoNoResampleTwoPackets) {
}
// Test cast callback.
audio_decoder_->SendCastMessage();
- testing_clock_.Advance(base::TimeDelta::FromMilliseconds(33));
+ testing_clock_->Advance(base::TimeDelta::FromMilliseconds(33));
audio_decoder_->SendCastMessage();
}
« no previous file with comments | « chrome/renderer/media/cast_session_delegate.cc ('k') | media/cast/audio_receiver/audio_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698