| 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 d65583cfb52799a892c43dddfb1769c78495c43b..a3f4eb56de82c6697807630a529529817eefab4a 100644
|
| --- a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
|
| +++ b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
|
| @@ -190,7 +190,6 @@ class It2MeNativeMessagingHostTest : public testing::Test {
|
|
|
| private:
|
| void StartHost();
|
| - void StopHost();
|
| void ExitTest();
|
|
|
| // Each test creates two unidirectional pipes: "input" and "output".
|
| @@ -239,6 +238,10 @@ void It2MeNativeMessagingHostTest::SetUp() {
|
| }
|
|
|
| void It2MeNativeMessagingHostTest::TearDown() {
|
| + // Release reference to AutoThreadTaskRunner, so the host thread can be shut
|
| + // down.
|
| + host_task_runner_ = nullptr;
|
| +
|
| // Closing the write-end of the input will send an EOF to the native
|
| // messaging reader. This will trigger a host shutdown.
|
| input_write_file_.Close();
|
| @@ -443,28 +446,13 @@ void It2MeNativeMessagingHostTest::StartHost() {
|
| make_scoped_ptr(new MockIt2MeHostFactory())));
|
| it2me_host->Start(pipe_.get());
|
|
|
| - pipe_->Start(it2me_host.Pass(),
|
| - channel.Pass(),
|
| - base::Bind(&It2MeNativeMessagingHostTest::StopHost,
|
| - base::Unretained(this)));
|
| + pipe_->Start(it2me_host.Pass(), channel.Pass());
|
|
|
| // Notify the test that the host has finished starting up.
|
| test_message_loop_->message_loop_proxy()->PostTask(
|
| FROM_HERE, test_run_loop_->QuitClosure());
|
| }
|
|
|
| -void It2MeNativeMessagingHostTest::StopHost() {
|
| - DCHECK(host_task_runner_->RunsTasksOnCurrentThread());
|
| -
|
| - pipe_.reset();
|
| -
|
| - // Wait till all shutdown tasks have completed.
|
| - base::RunLoop().RunUntilIdle();
|
| -
|
| - // Trigger a test shutdown via ExitTest().
|
| - host_task_runner_ = nullptr;
|
| -}
|
| -
|
| void It2MeNativeMessagingHostTest::ExitTest() {
|
| if (!test_message_loop_->message_loop_proxy()->RunsTasksOnCurrentThread()) {
|
| test_message_loop_->message_loop_proxy()->PostTask(
|
|
|