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

Unified Diff: media/audio/audio_output_proxy_unittest.cc

Issue 506683002: Remove implicit conversions from scoped_refptr to T* in media/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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/audio_output_proxy_unittest.cc
diff --git a/media/audio/audio_output_proxy_unittest.cc b/media/audio/audio_output_proxy_unittest.cc
index b8f23acaa9274421fa27bdea085b054bcda34948..0ccf78e7a0c55cfc246be7912c065764e8f0d524 100644
--- a/media/audio/audio_output_proxy_unittest.cc
+++ b/media/audio/audio_output_proxy_unittest.cc
@@ -445,82 +445,90 @@ class AudioOutputResamplerTest : public AudioOutputProxyTest {
};
TEST_F(AudioOutputProxyTest, CreateAndClose) {
- AudioOutputProxy* proxy = new AudioOutputProxy(dispatcher_impl_);
+ AudioOutputProxy* proxy = new AudioOutputProxy(dispatcher_impl_.get());
proxy->Close();
}
TEST_F(AudioOutputResamplerTest, CreateAndClose) {
- AudioOutputProxy* proxy = new AudioOutputProxy(resampler_);
+ AudioOutputProxy* proxy = new AudioOutputProxy(resampler_.get());
proxy->Close();
}
TEST_F(AudioOutputProxyTest, OpenAndClose) {
- OpenAndClose(dispatcher_impl_);
+ OpenAndClose(dispatcher_impl_.get());
}
TEST_F(AudioOutputResamplerTest, OpenAndClose) {
- OpenAndClose(resampler_);
+ OpenAndClose(resampler_.get());
}
// Create a stream, and verify that it is closed after kTestCloseDelayMs.
// if it doesn't start playing.
TEST_F(AudioOutputProxyTest, CreateAndWait) {
- CreateAndWait(dispatcher_impl_);
+ CreateAndWait(dispatcher_impl_.get());
}
// Create a stream, and verify that it is closed after kTestCloseDelayMs.
// if it doesn't start playing.
TEST_F(AudioOutputResamplerTest, CreateAndWait) {
- CreateAndWait(resampler_);
+ CreateAndWait(resampler_.get());
}
TEST_F(AudioOutputProxyTest, StartAndStop) {
- StartAndStop(dispatcher_impl_);
+ StartAndStop(dispatcher_impl_.get());
}
TEST_F(AudioOutputResamplerTest, StartAndStop) {
- StartAndStop(resampler_);
+ StartAndStop(resampler_.get());
}
TEST_F(AudioOutputProxyTest, CloseAfterStop) {
- CloseAfterStop(dispatcher_impl_);
+ CloseAfterStop(dispatcher_impl_.get());
}
TEST_F(AudioOutputResamplerTest, CloseAfterStop) {
- CloseAfterStop(resampler_);
+ CloseAfterStop(resampler_.get());
}
-TEST_F(AudioOutputProxyTest, TwoStreams) { TwoStreams(dispatcher_impl_); }
+TEST_F(AudioOutputProxyTest, TwoStreams) {
+ TwoStreams(dispatcher_impl_.get());
+}
-TEST_F(AudioOutputResamplerTest, TwoStreams) { TwoStreams(resampler_); }
+TEST_F(AudioOutputResamplerTest, TwoStreams) {
+ TwoStreams(resampler_.get());
+}
// Two streams: verify that second stream is allocated when the first
// starts playing.
TEST_F(AudioOutputProxyTest, OneStream_TwoPlays) {
- OneStream_TwoPlays(dispatcher_impl_);
+ OneStream_TwoPlays(dispatcher_impl_.get());
}
TEST_F(AudioOutputResamplerTest, OneStream_TwoPlays) {
- OneStream_TwoPlays(resampler_);
+ OneStream_TwoPlays(resampler_.get());
}
// Two streams, both are playing. Dispatcher should not open a third stream.
TEST_F(AudioOutputProxyTest, TwoStreams_BothPlaying) {
- TwoStreams_BothPlaying(dispatcher_impl_);
+ TwoStreams_BothPlaying(dispatcher_impl_.get());
}
TEST_F(AudioOutputResamplerTest, TwoStreams_BothPlaying) {
- TwoStreams_BothPlaying(resampler_);
+ TwoStreams_BothPlaying(resampler_.get());
}
-TEST_F(AudioOutputProxyTest, OpenFailed) { OpenFailed(dispatcher_impl_); }
+TEST_F(AudioOutputProxyTest, OpenFailed) {
+ OpenFailed(dispatcher_impl_.get());
+}
// Start() method failed.
TEST_F(AudioOutputProxyTest, StartFailed) {
- StartFailed(dispatcher_impl_);
+ StartFailed(dispatcher_impl_.get());
}
-TEST_F(AudioOutputResamplerTest, StartFailed) { StartFailed(resampler_); }
+TEST_F(AudioOutputResamplerTest, StartFailed) {
+ StartFailed(resampler_.get());
+}
// Simulate AudioOutputStream::Create() failure with a low latency stream and
// ensure AudioOutputResampler falls back to the high latency path.
@@ -533,7 +541,7 @@ TEST_F(AudioOutputResamplerTest, LowLatencyCreateFailedFallback) {
EXPECT_CALL(stream, Open())
.WillOnce(Return(true));
- AudioOutputProxy* proxy = new AudioOutputProxy(resampler_);
+ AudioOutputProxy* proxy = new AudioOutputProxy(resampler_.get());
EXPECT_TRUE(proxy->Open());
CloseAndWaitForCloseTimer(proxy, &stream);
}
@@ -554,7 +562,7 @@ TEST_F(AudioOutputResamplerTest, LowLatencyOpenFailedFallback) {
EXPECT_CALL(okay_stream, Open())
.WillOnce(Return(true));
- AudioOutputProxy* proxy = new AudioOutputProxy(resampler_);
+ AudioOutputProxy* proxy = new AudioOutputProxy(resampler_.get());
EXPECT_TRUE(proxy->Open());
CloseAndWaitForCloseTimer(proxy, &okay_stream);
}
@@ -588,7 +596,7 @@ TEST_F(AudioOutputResamplerTest, HighLatencyFallbackFailed) {
EXPECT_CALL(okay_stream, Open())
.WillOnce(Return(true));
- AudioOutputProxy* proxy = new AudioOutputProxy(resampler_);
+ AudioOutputProxy* proxy = new AudioOutputProxy(resampler_.get());
EXPECT_TRUE(proxy->Open());
CloseAndWaitForCloseTimer(proxy, &okay_stream);
}
@@ -608,7 +616,7 @@ TEST_F(AudioOutputResamplerTest, AllFallbackFailed) {
.Times(kFallbackCount)
.WillRepeatedly(Return(static_cast<AudioOutputStream*>(NULL)));
- AudioOutputProxy* proxy = new AudioOutputProxy(resampler_);
+ AudioOutputProxy* proxy = new AudioOutputProxy(resampler_.get());
EXPECT_FALSE(proxy->Open());
proxy->Close();
}
@@ -638,19 +646,19 @@ TEST_F(AudioOutputResamplerTest, LowLatencyOpenEventuallyFails) {
.Times(1);
// Open and start the first proxy and stream.
- AudioOutputProxy* proxy1 = new AudioOutputProxy(resampler_);
+ AudioOutputProxy* proxy1 = new AudioOutputProxy(resampler_.get());
EXPECT_TRUE(proxy1->Open());
proxy1->Start(&callback_);
OnStart();
// Open and start the second proxy and stream.
- AudioOutputProxy* proxy2 = new AudioOutputProxy(resampler_);
+ AudioOutputProxy* proxy2 = new AudioOutputProxy(resampler_.get());
EXPECT_TRUE(proxy2->Open());
proxy2->Start(&callback_);
OnStart();
// Attempt to open the third stream which should fail.
- AudioOutputProxy* proxy3 = new AudioOutputProxy(resampler_);
+ AudioOutputProxy* proxy3 = new AudioOutputProxy(resampler_.get());
EXPECT_FALSE(proxy3->Open());
proxy3->Close();

Powered by Google App Engine
This is Rietveld 408576698