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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 | 455 |
456 void It2MeNativeMessagingHostTest::StopHost() { | 456 void It2MeNativeMessagingHostTest::StopHost() { |
457 DCHECK(host_task_runner_->RunsTasksOnCurrentThread()); | 457 DCHECK(host_task_runner_->RunsTasksOnCurrentThread()); |
458 | 458 |
459 pipe_.reset(); | 459 pipe_.reset(); |
460 | 460 |
461 // Wait till all shutdown tasks have completed. | 461 // Wait till all shutdown tasks have completed. |
462 base::RunLoop().RunUntilIdle(); | 462 base::RunLoop().RunUntilIdle(); |
463 | 463 |
464 // Trigger a test shutdown via ExitTest(). | 464 // Trigger a test shutdown via ExitTest(). |
465 host_task_runner_ = NULL; | 465 host_task_runner_ = nullptr; |
466 } | 466 } |
467 | 467 |
468 void It2MeNativeMessagingHostTest::ExitTest() { | 468 void It2MeNativeMessagingHostTest::ExitTest() { |
469 if (!test_message_loop_->message_loop_proxy()->RunsTasksOnCurrentThread()) { | 469 if (!test_message_loop_->message_loop_proxy()->RunsTasksOnCurrentThread()) { |
470 test_message_loop_->message_loop_proxy()->PostTask( | 470 test_message_loop_->message_loop_proxy()->PostTask( |
471 FROM_HERE, | 471 FROM_HERE, |
472 base::Bind(&It2MeNativeMessagingHostTest::ExitTest, | 472 base::Bind(&It2MeNativeMessagingHostTest::ExitTest, |
473 base::Unretained(this))); | 473 base::Unretained(this))); |
474 return; | 474 return; |
475 } | 475 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 | 553 |
554 // Verify rejection if type is unrecognized. | 554 // Verify rejection if type is unrecognized. |
555 TEST_F(It2MeNativeMessagingHostTest, InvalidType) { | 555 TEST_F(It2MeNativeMessagingHostTest, InvalidType) { |
556 base::DictionaryValue message; | 556 base::DictionaryValue message; |
557 message.SetString("type", "xxx"); | 557 message.SetString("type", "xxx"); |
558 TestBadRequest(message, true); | 558 TestBadRequest(message, true); |
559 } | 559 } |
560 | 560 |
561 } // namespace remoting | 561 } // namespace remoting |
562 | 562 |
OLD | NEW |