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

Unified Diff: remoting/host/chromoting_host_unittest.cc

Issue 2080723008: [Chromoting] Use device::PowerSaveBlocker to block screen saver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve review comments Created 4 years, 6 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
Index: remoting/host/chromoting_host_unittest.cc
diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc
index 6b65884a58b2259ca0ff76200343eaa6d5fbfd27..50c278f24ff4862e412640f52393af57f2c605ee 100644
--- a/remoting/host/chromoting_host_unittest.cc
+++ b/remoting/host/chromoting_host_unittest.cc
@@ -58,17 +58,16 @@ class ChromotingHostTest : public testing::Test {
ChromotingHostTest() {}
void SetUp() override {
- task_runner_ = new AutoThreadTaskRunner(message_loop_.task_runner(),
- base::Bind(&base::DoNothing));
-
desktop_environment_factory_.reset(new FakeDesktopEnvironmentFactory());
session_manager_ = new protocol::MockSessionManager();
+ context_ = ChromotingHostContext::CreateForTest(
+ new AutoThreadTaskRunner(message_loop_.task_runner(),
+ base::Bind(&base::DoNothing)));
host_.reset(new ChromotingHost(
desktop_environment_factory_.get(), base::WrapUnique(session_manager_),
protocol::TransportContext::ForTests(protocol::TransportRole::SERVER),
- task_runner_, // Audio
- task_runner_)); // Video encode
+ *context_));
host_->AddStatusObserver(&host_status_observer_);
xmpp_login_ = "host@domain";
@@ -125,9 +124,8 @@ class ChromotingHostTest : public testing::Test {
std::unique_ptr<protocol::ConnectionToClient> connection = std::move(
(connection_index == 0) ? owned_connection1_ : owned_connection2_);
protocol::ConnectionToClient* connection_ptr = connection.get();
- std::unique_ptr<ClientSession> client(new ClientSession(
- host_.get(), task_runner_ /* audio_task_runner */,
- std::move(connection), desktop_environment_factory_.get(),
+ std::unique_ptr<ClientSession> client(new ClientSession(*context_,
+ host_.get(), std::move(connection), desktop_environment_factory_.get(),
base::TimeDelta(), nullptr, std::vector<HostExtension*>()));
ClientSession* client_ptr = client.get();
@@ -150,7 +148,7 @@ class ChromotingHostTest : public testing::Test {
void TearDown() override {
if (host_)
ShutdownHost();
- task_runner_ = nullptr;
+ context_ = nullptr;
message_loop_.RunUntilIdle();
}
@@ -205,7 +203,7 @@ class ChromotingHostTest : public testing::Test {
protected:
base::MessageLoop message_loop_;
- scoped_refptr<AutoThreadTaskRunner> task_runner_;
+ std::unique_ptr<ChromotingHostContext> context_;
MockConnectionToClientEventHandler handler_;
std::unique_ptr<FakeDesktopEnvironmentFactory> desktop_environment_factory_;
MockHostStatusObserver host_status_observer_;

Powered by Google App Engine
This is Rietveld 408576698