| 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 e0f98f278bc4693e32bca1baaaa53c2160df658c..27d885b2ccdcc239ec7466d25032e0ac286d635a 100644
|
| --- a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
|
| +++ b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
|
| @@ -19,6 +19,7 @@
|
| #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"
|
|
|
| @@ -67,13 +68,13 @@ void VerifyCommonProperties(scoped_ptr<base::DictionaryValue> response,
|
|
|
| class MockIt2MeHost : public It2MeHost {
|
| public:
|
| - MockIt2MeHost(ChromotingHostContext* context,
|
| - scoped_refptr<base::SingleThreadTaskRunner> task_runner,
|
| + MockIt2MeHost(scoped_ptr<ChromotingHostContext> context,
|
| + scoped_ptr<policy_hack::PolicyWatcher> policy_watcher,
|
| base::WeakPtr<It2MeHost::Observer> observer,
|
| const XmppSignalStrategy::XmppServerConfig& xmpp_server_config,
|
| const std::string& directory_bot_jid)
|
| - : It2MeHost(context,
|
| - task_runner,
|
| + : It2MeHost(context.Pass(),
|
| + policy_watcher.Pass(),
|
| observer,
|
| xmpp_server_config,
|
| directory_bot_jid) {}
|
| @@ -148,15 +149,14 @@ void MockIt2MeHost::RunSetState(It2MeHostState state) {
|
|
|
| class MockIt2MeHostFactory : public It2MeHostFactory {
|
| public:
|
| - MockIt2MeHostFactory() {}
|
| + MockIt2MeHostFactory() : It2MeHostFactory(nullptr) {}
|
| scoped_refptr<It2MeHost> CreateIt2MeHost(
|
| - ChromotingHostContext* context,
|
| - scoped_refptr<base::SingleThreadTaskRunner> task_runner,
|
| + scoped_ptr<ChromotingHostContext> context,
|
| base::WeakPtr<It2MeHost::Observer> observer,
|
| const XmppSignalStrategy::XmppServerConfig& xmpp_server_config,
|
| const std::string& directory_bot_jid) override {
|
| - return new MockIt2MeHost(
|
| - context, task_runner, observer, xmpp_server_config, directory_bot_jid);
|
| + return new MockIt2MeHost(context.Pass(), nullptr, observer,
|
| + xmpp_server_config, directory_bot_jid);
|
| }
|
|
|
| private:
|
| @@ -429,19 +429,17 @@ void It2MeNativeMessagingHostTest::StartHost() {
|
| 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(
|
| - host_task_runner_,
|
| - factory.Pass()));
|
| + ChromotingHostContext::Create(host_task_runner_),
|
| + make_scoped_ptr(new MockIt2MeHostFactory())));
|
| it2me_host->Start(pipe_.get());
|
|
|
| pipe_->Start(it2me_host.Pass(),
|
|
|