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

Unified Diff: media/capture/video/video_capture_device_unittest.cc

Issue 2859273004: Use ScopedTaskEnvironment instead of MessageLoop in media/capture/ unit tests (Closed)
Patch Set: Created 3 years, 7 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/capture/video/linux/v4l2_capture_delegate_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/video_capture_device_unittest.cc
diff --git a/media/capture/video/video_capture_device_unittest.cc b/media/capture/video/video_capture_device_unittest.cc
index 6910b8f225afa21fa5e1e30a9918f5a7aff40152..d1119538a2ad2b9f719f3d58faccaa8a3257e553 100644
--- a/media/capture/video/video_capture_device_unittest.cc
+++ b/media/capture/video/video_capture_device_unittest.cc
@@ -15,6 +15,7 @@
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/test/scoped_task_environment.h"
#include "base/test/test_timeouts.h"
#include "base/threading/thread.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -212,8 +213,7 @@ class VideoCaptureDeviceTest : public testing::TestWithParam<gfx::Size> {
typedef VideoCaptureDevice::Client Client;
VideoCaptureDeviceTest()
- : loop_(new base::MessageLoop()),
- device_descriptors_(new VideoCaptureDeviceDescriptors()),
+ : device_descriptors_(new VideoCaptureDeviceDescriptors()),
video_capture_client_(new MockVideoCaptureClient(
base::Bind(&VideoCaptureDeviceTest::OnFrameCaptured,
base::Unretained(this)))),
@@ -314,7 +314,7 @@ class VideoCaptureDeviceTest : public testing::TestWithParam<gfx::Size> {
#if defined(OS_WIN)
base::win::ScopedCOMInitializer initialize_com_;
#endif
- const std::unique_ptr<base::MessageLoop> loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
std::unique_ptr<VideoCaptureDeviceDescriptors> device_descriptors_;
std::unique_ptr<base::RunLoop> run_loop_;
std::unique_ptr<MockVideoCaptureClient> video_capture_client_;
« no previous file with comments | « media/capture/video/linux/v4l2_capture_delegate_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698