| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/host/it2me/it2me_native_messaging_host.h" | 5 #include "remoting/host/it2me/it2me_native_messaging_host.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 scoped_ptr<It2MeHostFactory> factory(new MockIt2MeHostFactory()); | 433 scoped_ptr<It2MeHostFactory> factory(new MockIt2MeHostFactory()); |
| 434 | 434 |
| 435 pipe_.reset(new NativeMessagingPipe()); | 435 pipe_.reset(new NativeMessagingPipe()); |
| 436 | 436 |
| 437 scoped_ptr<extensions::NativeMessagingChannel> channel( | 437 scoped_ptr<extensions::NativeMessagingChannel> channel( |
| 438 new PipeMessagingChannel(input_read_file.Pass(), | 438 new PipeMessagingChannel(input_read_file.Pass(), |
| 439 output_write_file.Pass())); | 439 output_write_file.Pass())); |
| 440 | 440 |
| 441 scoped_ptr<extensions::NativeMessageHost> it2me_host( | 441 scoped_ptr<extensions::NativeMessageHost> it2me_host( |
| 442 new It2MeNativeMessagingHost( | 442 new It2MeNativeMessagingHost( |
| 443 host_task_runner_, | 443 ChromotingHostContext::Create(host_task_runner_.get()), |
| 444 factory.Pass())); | 444 factory.Pass())); |
| 445 it2me_host->Start(pipe_.get()); | 445 it2me_host->Start(pipe_.get()); |
| 446 | 446 |
| 447 pipe_->Start(it2me_host.Pass(), | 447 pipe_->Start(it2me_host.Pass(), |
| 448 channel.Pass(), | 448 channel.Pass(), |
| 449 base::Bind(&It2MeNativeMessagingHostTest::StopHost, | 449 base::Bind(&It2MeNativeMessagingHostTest::StopHost, |
| 450 base::Unretained(this))); | 450 base::Unretained(this))); |
| 451 | 451 |
| 452 // Notify the test that the host has finished starting up. | 452 // Notify the test that the host has finished starting up. |
| 453 test_message_loop_->message_loop_proxy()->PostTask( | 453 test_message_loop_->message_loop_proxy()->PostTask( |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 | 554 |
| 555 // Verify rejection if type is unrecognized. | 555 // Verify rejection if type is unrecognized. |
| 556 TEST_F(It2MeNativeMessagingHostTest, InvalidType) { | 556 TEST_F(It2MeNativeMessagingHostTest, InvalidType) { |
| 557 base::DictionaryValue message; | 557 base::DictionaryValue message; |
| 558 message.SetString("type", "xxx"); | 558 message.SetString("type", "xxx"); |
| 559 TestBadRequest(message, true); | 559 TestBadRequest(message, true); |
| 560 } | 560 } |
| 561 | 561 |
| 562 } // namespace remoting | 562 } // namespace remoting |
| 563 | 563 |
| OLD | NEW |