Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: remoting/host/it2me/it2me_native_messaging_host_unittest.cc

Issue 639233002: Remote assistance on Chrome OS Part IV - It2MeHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedbacks Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 431
432 // Creating a native messaging host with a mock It2MeHostFactory. 432 // Creating a native messaging host with a mock It2MeHostFactory.
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 It2MeNativeMessagingHost::Create(
443 host_task_runner_, 443 ChromotingHostContext::Create(host_task_runner_.get()),
Wez 2014/10/17 17:58:01 Don't use get() here.
kelvinp 2014/10/20 00:21:18 Done.
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(
454 FROM_HERE, test_run_loop_->QuitClosure()); 454 FROM_HERE, test_run_loop_->QuitClosure());
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698