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

Unified Diff: media/audio/audio_output_controller_unittest.cc

Issue 2443573003: Factor out AudioOutputDelegate from AudioRendererHost. (Closed)
Patch Set: Remove [&] from lambda. Created 4 years, 1 month 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 0fc47c828b70607082b27963d54666677dbe1629..6ab79adf7bac40c594b31db7aa48bc8b53a59bf2 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);
@@ -125,7 +125,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(
@@ -139,8 +139,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.
@@ -151,19 +151,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.
@@ -174,9 +174,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())
@@ -228,9 +229,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());
@@ -250,7 +252,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