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

Unified Diff: media/audio/sounds/audio_stream_handler_unittest.cc

Issue 1806313003: Pass task runners to AudioManager constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments from patch 48 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 | « media/audio/pulse/audio_manager_pulse.cc ('k') | media/audio/sounds/sounds_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/sounds/audio_stream_handler_unittest.cc
diff --git a/media/audio/sounds/audio_stream_handler_unittest.cc b/media/audio/sounds/audio_stream_handler_unittest.cc
index 1b87ca424ac48794c6c59b5fbfa96d6def94d5d7..4863bc921a8defd0f73681c9e47118e02f83f448 100644
--- a/media/audio/sounds/audio_stream_handler_unittest.cc
+++ b/media/audio/sounds/audio_stream_handler_unittest.cc
@@ -7,8 +7,9 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "base/test/test_message_loop.h"
+#include "base/thread_task_runner_handle.h"
#include "media/audio/audio_io.h"
#include "media/audio/audio_manager.h"
#include "media/audio/simple_sources.h"
@@ -25,7 +26,9 @@ class AudioStreamHandlerTest : public testing::Test {
~AudioStreamHandlerTest() override {}
void SetUp() override {
- audio_manager_.reset(AudioManager::CreateForTesting());
+ audio_manager_ =
+ AudioManager::CreateForTesting(base::ThreadTaskRunnerHandle::Get());
+ base::RunLoop().RunUntilIdle();
base::StringPiece data(kTestAudioData, arraysize(kTestAudioData));
audio_stream_handler_.reset(new AudioStreamHandler(data));
@@ -33,7 +36,7 @@ class AudioStreamHandlerTest : public testing::Test {
void TearDown() override {
audio_stream_handler_.reset();
- audio_manager_.reset();
+ base::RunLoop().RunUntilIdle();
}
AudioStreamHandler* audio_stream_handler() {
@@ -50,10 +53,9 @@ class AudioStreamHandlerTest : public testing::Test {
}
private:
- scoped_ptr<AudioManager> audio_manager_;
+ base::TestMessageLoop message_loop_;
+ ScopedAudioManagerPtr audio_manager_;
scoped_ptr<AudioStreamHandler> audio_stream_handler_;
-
- base::MessageLoop message_loop_;
};
TEST_F(AudioStreamHandlerTest, Play) {
« no previous file with comments | « media/audio/pulse/audio_manager_pulse.cc ('k') | media/audio/sounds/sounds_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698