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

Unified Diff: remoting/test/it2me_standalone_host.cc

Issue 2846943002: Use ScopedTaskEnvironment instead of MessageLoopForUI in remoting tests. (Closed)
Patch Set: add-deps 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 | « remoting/test/it2me_standalone_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/test/it2me_standalone_host.cc
diff --git a/remoting/test/it2me_standalone_host.cc b/remoting/test/it2me_standalone_host.cc
index e6b74ded23e75ae83fb3bfbf32a85af3918b15fc..eed5c9133059982cc653cd50a8757ee5346efac9 100644
--- a/remoting/test/it2me_standalone_host.cc
+++ b/remoting/test/it2me_standalone_host.cc
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/host/chromoting_host_context.h"
@@ -36,24 +37,26 @@ constexpr char kSessionJid[] = "user@domain/rest-of-jid";
using ::remoting::protocol::MockSession;
It2MeStandaloneHost::It2MeStandaloneHost()
- : context_(ChromotingHostContext::Create(
- new AutoThreadTaskRunner(
- message_loop_.task_runner(), run_loop_.QuitClosure()))),
- main_task_runner_(context_->file_task_runner()),
- factory_(main_task_runner_,
- context_->video_capture_task_runner(),
- context_->input_task_runner(),
- context_->ui_task_runner()),
- connection_(base::WrapUnique(new testing::NiceMock<MockSession>())),
- session_jid_(kSessionJid),
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI),
+ context_(ChromotingHostContext::Create(
+ new AutoThreadTaskRunner(base::ThreadTaskRunnerHandle::Get(),
+ run_loop_.QuitClosure()))),
+ main_task_runner_(context_->file_task_runner()),
+ factory_(main_task_runner_,
+ context_->video_capture_task_runner(),
+ context_->input_task_runner(),
+ context_->ui_task_runner()),
+ connection_(base::WrapUnique(new testing::NiceMock<MockSession>())),
+ session_jid_(kSessionJid),
#if defined(OS_LINUX)
- // We cannot support audio capturing for linux, since a pipe name is
- // needed to initialize AudioCapturerLinux.
- config_(protocol::SessionConfig::ForTest()),
+ // We cannot support audio capturing for linux, since a pipe name is
+ // needed to initialize AudioCapturerLinux.
+ config_(protocol::SessionConfig::ForTest()),
#else
- config_(protocol::SessionConfig::ForTestWithAudio()),
+ config_(protocol::SessionConfig::ForTestWithAudio()),
#endif
- event_logger_(&connection_) {
+ event_logger_(&connection_) {
EXPECT_CALL(*static_cast<MockSession*>(connection_.session()), jid())
.WillRepeatedly(testing::ReturnRef(session_jid_));
EXPECT_CALL(*static_cast<MockSession*>(connection_.session()), config())
« no previous file with comments | « remoting/test/it2me_standalone_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698