Commit dccc717d authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

Use ScopedTaskEnvironment instead of MessageLoop in /chromecast/media

MessageLoop will go away, eventually.

ScopedTaskEnvironment will per default start a ThreadPool, which should
be fine in most of the cases. If you belive your test needs to make sure
that no ThreadPool runs let me know and I will update the patch.

BUG=891670
This CL was uploaded by git cl split.

R=kmackay@chromium.org

Change-Id: I1ac52d598e71f6569f544c0cdaee67c07ffd7f1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1648269
Auto-Submit: Carlos Caballero <carlscab@google.com>
Reviewed-by: default avatarKenneth MacKay <kmackay@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#669598}
parent 2837f82c
......@@ -7,8 +7,8 @@
#include <memory>
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/test/scoped_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -62,8 +62,8 @@ class MediaResourceTrackerTest : public ::testing::Test {
test_mocks_.reset(new MediaResourceTrackerTestMocks());
resource_tracker_ = new TestMediaResourceTracker(
test_mocks_.get(), message_loop_.task_runner(),
message_loop_.task_runner());
test_mocks_.get(), scoped_task_environment_.GetMainThreadTaskRunner(),
scoped_task_environment_.GetMainThreadTaskRunner());
}
void InitializeMediaLib() {
......@@ -72,7 +72,7 @@ class MediaResourceTrackerTest : public ::testing::Test {
base::RunLoop().RunUntilIdle();
}
base::MessageLoop message_loop_;
base::test::ScopedTaskEnvironment scoped_task_environment_;
TestMediaResourceTracker* resource_tracker_;
std::unique_ptr<MediaResourceTrackerTestMocks> test_mocks_;
......
......@@ -15,8 +15,8 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/test/scoped_task_environment.h"
#include "base/threading/thread_checker.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
......@@ -152,7 +152,7 @@ class MultizoneBackendTest : public testing::TestWithParam<TestParams> {
void OnEndOfStream();
private:
base::MessageLoop message_loop_;
base::test::ScopedTaskEnvironment scoped_task_environment_;
std::vector<std::unique_ptr<BufferFeeder>> effects_feeders_;
std::unique_ptr<BufferFeeder> audio_feeder_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment