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

Unified Diff: media/audio/alsa/alsa_output_unittest.cc

Issue 1901583005: Revert of Pass task runners to AudioManager constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « content/browser/speech/speech_recognizer_impl_unittest.cc ('k') | media/audio/alsa/audio_manager_alsa.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/alsa/alsa_output_unittest.cc
diff --git a/media/audio/alsa/alsa_output_unittest.cc b/media/audio/alsa/alsa_output_unittest.cc
index acf6d2881552324f3d582fcd34e9f15a1cba6934..1b1386347f9437c21865c9fa64b71936090ee735 100644
--- a/media/audio/alsa/alsa_output_unittest.cc
+++ b/media/audio/alsa/alsa_output_unittest.cc
@@ -5,10 +5,7 @@
#include <stdint.h>
#include "base/macros.h"
-#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
-#include "base/test/test_message_loop.h"
-#include "base/thread_task_runner_handle.h"
#include "media/audio/alsa/alsa_output.h"
#include "media/audio/alsa/alsa_wrapper.h"
#include "media/audio/alsa/audio_manager_alsa.h"
@@ -75,10 +72,7 @@
class MockAudioManagerAlsa : public AudioManagerAlsa {
public:
- MockAudioManagerAlsa()
- : AudioManagerAlsa(base::ThreadTaskRunnerHandle::Get(),
- base::ThreadTaskRunnerHandle::Get(),
- &fake_audio_log_factory_) {}
+ MockAudioManagerAlsa() : AudioManagerAlsa(&fake_audio_log_factory_) {}
MOCK_METHOD0(Init, void());
MOCK_METHOD0(HasAudioOutputDevices, bool());
MOCK_METHOD0(HasAudioInputDevices, bool());
@@ -97,6 +91,12 @@
void ReleaseOutputStream(AudioOutputStream* stream) override {
DCHECK(stream);
delete stream;
+ }
+
+ // We don't mock this method since all tests will do the same thing
+ // and use the current task runner.
+ scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override {
+ return base::MessageLoop::current()->task_runner();
}
private:
@@ -168,10 +168,9 @@
static void* kFakeHints[];
static char kGenericSurround50[];
- base::TestMessageLoop message_loop_;
StrictMock<MockAlsaWrapper> mock_alsa_wrapper_;
- std::unique_ptr<StrictMock<MockAudioManagerAlsa>, AudioManagerDeleter>
- mock_manager_;
+ scoped_ptr<StrictMock<MockAudioManagerAlsa> > mock_manager_;
+ base::MessageLoop message_loop_;
scoped_refptr<media::DataBuffer> packet_;
private:
@@ -443,7 +442,7 @@
// call Stop() immediately after to ensure we don't run the message loop
// forever.
test_stream->Stop();
- base::RunLoop().RunUntilIdle();
+ message_loop_.RunUntilIdle();
EXPECT_CALL(mock_alsa_wrapper_, PcmClose(kFakeHandle))
.WillOnce(Return(0));
« no previous file with comments | « content/browser/speech/speech_recognizer_impl_unittest.cc ('k') | media/audio/alsa/audio_manager_alsa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698