| 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 61334cfc45fb3b41172a0dffdc513e07205532bb..56515a9eb712f8e4dbbfe8d0a8ea727b224711cf 100644
|
| --- a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
|
| +++ b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
|
| @@ -17,7 +17,6 @@
|
| #include "net/base/net_util.h"
|
| #include "remoting/base/auto_thread_task_runner.h"
|
| #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/setup/test_util.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -79,9 +78,9 @@ class MockIt2MeHost : public It2MeHost {
|
| directory_bot_jid) {}
|
|
|
| // It2MeHost overrides
|
| - virtual void Connect() override;
|
| - virtual void Disconnect() override;
|
| - virtual void RequestNatPolicy() override;
|
| + virtual void Connect() OVERRIDE;
|
| + virtual void Disconnect() OVERRIDE;
|
| + virtual void RequestNatPolicy() OVERRIDE;
|
|
|
| private:
|
| virtual ~MockIt2MeHost() {}
|
| @@ -154,7 +153,7 @@ class MockIt2MeHostFactory : public It2MeHostFactory {
|
| scoped_refptr<base::SingleThreadTaskRunner> task_runner,
|
| base::WeakPtr<It2MeHost::Observer> observer,
|
| const XmppSignalStrategy::XmppServerConfig& xmpp_server_config,
|
| - const std::string& directory_bot_jid) override {
|
| + const std::string& directory_bot_jid) OVERRIDE {
|
| return new MockIt2MeHost(
|
| context, task_runner, observer, xmpp_server_config, directory_bot_jid);
|
| }
|
| @@ -168,8 +167,8 @@ class It2MeNativeMessagingHostTest : public testing::Test {
|
| It2MeNativeMessagingHostTest() {}
|
| virtual ~It2MeNativeMessagingHostTest() {}
|
|
|
| - virtual void SetUp() override;
|
| - virtual void TearDown() override;
|
| + virtual void SetUp() OVERRIDE;
|
| + virtual void TearDown() OVERRIDE;
|
|
|
| protected:
|
| scoped_ptr<base::DictionaryValue> ReadMessageFromOutputPipe();
|
| @@ -210,7 +209,7 @@ class It2MeNativeMessagingHostTest : public testing::Test {
|
|
|
| // Task runner of the host thread.
|
| scoped_refptr<AutoThreadTaskRunner> host_task_runner_;
|
| - scoped_ptr<remoting::NativeMessagingPipe> pipe_;
|
| + scoped_ptr<remoting::It2MeNativeMessagingHost> host_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(It2MeNativeMessagingHostTest);
|
| };
|
| @@ -432,21 +431,15 @@ void It2MeNativeMessagingHostTest::StartHost() {
|
| // 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()));
|
|
|
| - scoped_ptr<extensions::NativeMessageHost> it2me_host(
|
| - new It2MeNativeMessagingHost(
|
| - host_task_runner_,
|
| - factory.Pass()));
|
| - it2me_host->Start(pipe_.get());
|
| -
|
| - pipe_->Start(it2me_host.Pass(),
|
| - channel.Pass(),
|
| - base::Bind(&It2MeNativeMessagingHostTest::StopHost,
|
| + host_.reset(new It2MeNativeMessagingHost(
|
| + host_task_runner_,
|
| + channel.Pass(),
|
| + factory.Pass()));
|
| + host_->Start(base::Bind(&It2MeNativeMessagingHostTest::StopHost,
|
| base::Unretained(this)));
|
|
|
| // Notify the test that the host has finished starting up.
|
| @@ -457,7 +450,7 @@ void It2MeNativeMessagingHostTest::StartHost() {
|
| void It2MeNativeMessagingHostTest::StopHost() {
|
| DCHECK(host_task_runner_->RunsTasksOnCurrentThread());
|
|
|
| - pipe_.reset();
|
| + host_.reset();
|
|
|
| // Wait till all shutdown tasks have completed.
|
| base::RunLoop().RunUntilIdle();
|
|
|