| Index: remoting/host/it2me/it2me_native_messaging_host_unittest.cc
|
| diff --git a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
|
| index 18d5c85edb80e2ba81d76c705e2b1dc019395d28..89702b13c952e993da67544e224cf01bbdf95016 100644
|
| --- a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
|
| +++ b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
|
| @@ -19,7 +19,6 @@
|
| #include "remoting/host/chromoting_host_context.h"
|
| #include "remoting/host/native_messaging/native_messaging_pipe.h"
|
| #include "remoting/host/native_messaging/pipe_messaging_channel.h"
|
| -#include "remoting/host/policy_hack/policy_watcher.h"
|
| #include "remoting/host/setup/test_util.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -68,13 +67,13 @@
|
|
|
| class MockIt2MeHost : public It2MeHost {
|
| public:
|
| - MockIt2MeHost(scoped_ptr<ChromotingHostContext> context,
|
| - scoped_ptr<policy_hack::PolicyWatcher> policy_watcher,
|
| + MockIt2MeHost(ChromotingHostContext* context,
|
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner,
|
| base::WeakPtr<It2MeHost::Observer> observer,
|
| const XmppSignalStrategy::XmppServerConfig& xmpp_server_config,
|
| const std::string& directory_bot_jid)
|
| - : It2MeHost(context.Pass(),
|
| - policy_watcher.Pass(),
|
| + : It2MeHost(context,
|
| + task_runner,
|
| observer,
|
| xmpp_server_config,
|
| directory_bot_jid) {}
|
| @@ -149,14 +148,15 @@
|
|
|
| class MockIt2MeHostFactory : public It2MeHostFactory {
|
| public:
|
| - MockIt2MeHostFactory() : It2MeHostFactory() {}
|
| + MockIt2MeHostFactory() {}
|
| scoped_refptr<It2MeHost> CreateIt2MeHost(
|
| - scoped_ptr<ChromotingHostContext> context,
|
| + ChromotingHostContext* context,
|
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner,
|
| base::WeakPtr<It2MeHost::Observer> observer,
|
| const XmppSignalStrategy::XmppServerConfig& xmpp_server_config,
|
| const std::string& directory_bot_jid) override {
|
| - return new MockIt2MeHost(context.Pass(), nullptr, observer,
|
| - xmpp_server_config, directory_bot_jid);
|
| + return new MockIt2MeHost(
|
| + context, task_runner, observer, xmpp_server_config, directory_bot_jid);
|
| }
|
|
|
| private:
|
| @@ -429,17 +429,19 @@
|
| ASSERT_TRUE(MakePipe(&input_read_file, &input_write_file_));
|
| ASSERT_TRUE(MakePipe(&output_read_file_, &output_write_file));
|
|
|
| + // Creating a native messaging host with a mock It2MeHostFactory.
|
| + scoped_ptr<It2MeHostFactory> factory(new MockIt2MeHostFactory());
|
| +
|
| pipe_.reset(new NativeMessagingPipe());
|
|
|
| scoped_ptr<extensions::NativeMessagingChannel> channel(
|
| new PipeMessagingChannel(input_read_file.Pass(),
|
| output_write_file.Pass()));
|
|
|
| - // Creating a native messaging host with a mock It2MeHostFactory.
|
| scoped_ptr<extensions::NativeMessageHost> it2me_host(
|
| new It2MeNativeMessagingHost(
|
| - ChromotingHostContext::Create(host_task_runner_),
|
| - make_scoped_ptr(new MockIt2MeHostFactory())));
|
| + host_task_runner_,
|
| + factory.Pass()));
|
| it2me_host->Start(pipe_.get());
|
|
|
| pipe_->Start(it2me_host.Pass(),
|
|
|