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

Unified Diff: media/audio/audio_output_controller_unittest.cc

Issue 2443573003: Factor out AudioOutputDelegate from AudioRendererHost. (Closed)
Patch Set: Add AudioOutputDelegate::Deleter. Created 4 years, 2 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_controller_unittest.cc
diff --git a/media/audio/audio_output_controller_unittest.cc b/media/audio/audio_output_controller_unittest.cc
index 62058dacef55ff36d42055bb9b14f6bdb64d1828..3664c9bd4e797a6d4c7b87e76798d303707abb2a 100644
--- a/media/audio/audio_output_controller_unittest.cc
+++ b/media/audio/audio_output_controller_unittest.cc
@@ -48,10 +48,10 @@ class MockAudioOutputControllerEventHandler
public:
MockAudioOutputControllerEventHandler() {}
- MOCK_METHOD0(OnCreated, void());
- MOCK_METHOD0(OnPlaying, void());
- MOCK_METHOD0(OnPaused, void());
- MOCK_METHOD0(OnError, void());
+ MOCK_METHOD0(OnControllerCreated, void());
+ MOCK_METHOD0(OnControllerPlaying, void());
+ MOCK_METHOD0(OnControllerPaused, void());
+ MOCK_METHOD0(OnControllerError, void());
private:
DISALLOW_COPY_AND_ASSIGN(MockAudioOutputControllerEventHandler);
@@ -123,7 +123,7 @@ class AudioOutputControllerTest : public testing::Test {
kSampleRate, kBitsPerSample, samples_per_packet);
if (params_.IsValid()) {
- EXPECT_CALL(mock_event_handler_, OnCreated());
+ EXPECT_CALL(mock_event_handler_, OnControllerCreated());
}
controller_ = AudioOutputController::Create(
@@ -137,8 +137,8 @@ class AudioOutputControllerTest : public testing::Test {
}
void Play() {
- // Expect the event handler to receive one OnPlaying() call.
- EXPECT_CALL(mock_event_handler_, OnPlaying());
+ // Expect the event handler to receive one OnControllerPlaying() call.
+ EXPECT_CALL(mock_event_handler_, OnControllerPlaying());
// During playback, the mock pretends to provide audio data rendered and
// sent from the render process.
@@ -149,19 +149,19 @@ class AudioOutputControllerTest : public testing::Test {
}
void Pause() {
- // Expect the event handler to receive one OnPaused() call.
- EXPECT_CALL(mock_event_handler_, OnPaused());
+ // Expect the event handler to receive one OnControllerPaused() call.
+ EXPECT_CALL(mock_event_handler_, OnControllerPaused());
controller_->Pause();
base::RunLoop().RunUntilIdle();
}
void ChangeDevice() {
- // Expect the event handler to receive one OnPaying() call and no OnPaused()
+ // Expect the event handler to receive one OnControllerPaying() call and no
+ // OnControllerPaused()
// call.
- EXPECT_CALL(mock_event_handler_, OnPlaying());
- EXPECT_CALL(mock_event_handler_, OnPaused())
- .Times(0);
+ EXPECT_CALL(mock_event_handler_, OnControllerPlaying());
+ EXPECT_CALL(mock_event_handler_, OnControllerPaused()).Times(0);
// Simulate a device change event to AudioOutputController from the
// AudioManager.
@@ -172,9 +172,10 @@ class AudioOutputControllerTest : public testing::Test {
void Divert(bool was_playing, int num_times_to_be_started) {
if (was_playing) {
- // Expect the handler to receive one OnPlaying() call as a result of the
+ // Expect the handler to receive one OnControllerPlaying() call as a
+ // result of the
// stream switching.
- EXPECT_CALL(mock_event_handler_, OnPlaying());
+ EXPECT_CALL(mock_event_handler_, OnControllerPlaying());
}
EXPECT_CALL(mock_stream_, Open())
@@ -226,9 +227,10 @@ class AudioOutputControllerTest : public testing::Test {
void Revert(bool was_playing) {
if (was_playing) {
- // Expect the handler to receive one OnPlaying() call as a result of the
+ // Expect the handler to receive one OnControllerPlaying() call as a
+ // result of the
// stream switching back.
- EXPECT_CALL(mock_event_handler_, OnPlaying());
+ EXPECT_CALL(mock_event_handler_, OnControllerPlaying());
}
EXPECT_CALL(mock_stream_, Close());
@@ -248,7 +250,7 @@ class AudioOutputControllerTest : public testing::Test {
// Expect the current stream to close and a new stream to start
// playing if not diverting. When diverting, nothing happens
// until diverting is stopped.
- EXPECT_CALL(mock_event_handler_, OnPlaying());
+ EXPECT_CALL(mock_event_handler_, OnControllerPlaying());
}
controller_->SwitchOutputDevice(

Powered by Google App Engine
This is Rietveld 408576698