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

Unified Diff: content/renderer/media_recorder/media_recorder_handler_unittest.cc

Issue 2846933002: Use ScopedTaskEnvironment instead of MessageLoopForUI in content tests. (Closed)
Patch Set: self-review Created 3 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/renderer/media_capture_from_element/html_video_element_capturer_source_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media_recorder/media_recorder_handler_unittest.cc
diff --git a/content/renderer/media_recorder/media_recorder_handler_unittest.cc b/content/renderer/media_recorder/media_recorder_handler_unittest.cc
index 396c1d74b4365a0061d98d15c358f43f31577ffc..593204139579ddac3f1d90c4fcc99b25e07470cf 100644
--- a/content/renderer/media_recorder/media_recorder_handler_unittest.cc
+++ b/content/renderer/media_recorder/media_recorder_handler_unittest.cc
@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/scoped_task_environment.h"
#include "base/time/time.h"
#include "content/child/child_process.h"
#include "content/renderer/media/mock_media_stream_registry.h"
@@ -72,7 +73,9 @@ class MediaRecorderHandlerTest : public TestWithParam<MediaRecorderTestParams>,
public blink::WebMediaRecorderHandlerClient {
public:
MediaRecorderHandlerTest()
- : media_recorder_handler_(new MediaRecorderHandler()),
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI),
+ media_recorder_handler_(new MediaRecorderHandler()),
audio_source_(kTestAudioChannels,
440 /* freq */,
kTestAudioSampleRate) {
@@ -132,7 +135,7 @@ class MediaRecorderHandlerTest : public TestWithParam<MediaRecorderTestParams>,
// A ChildProcess and a MessageLoopForUI are both needed to fool the Tracks
// and Sources in |registry_| into believing they are on the right threads.
- const base::MessageLoopForUI message_loop_;
+ const base::test::ScopedTaskEnvironment scoped_task_environment_;
const ChildProcess child_process_;
MockMediaStreamRegistry registry_;
« no previous file with comments | « content/renderer/media_capture_from_element/html_video_element_capturer_source_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698