OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/message_loop_proxy.h" | 6 #include "base/message_loop_proxy.h" |
7 #include "remoting/host/chromoting_host_context.h" | 7 #include "remoting/host/chromoting_host_context.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace remoting { | 10 namespace remoting { |
11 | 11 |
12 // A simple test that starts and stop the context. This tests the context | 12 // A simple test that starts and stop the context. This tests the context |
13 // operates properly and all threads and message loops are valid. | 13 // operates properly and all threads and message loops are valid. |
14 TEST(ChromotingHostContextTest, StartAndStop) { | 14 TEST(ChromotingHostContextTest, StartAndStop) { |
15 MessageLoop message_loop; | 15 MessageLoop message_loop; |
16 ChromotingHostContext context( | 16 ChromotingHostContext context( |
17 base::MessageLoopProxy::current()); | 17 base::MessageLoopProxy::current()); |
18 | 18 |
19 context.Start(); | 19 context.Start(); |
20 EXPECT_TRUE(context.jingle_thread()); | 20 EXPECT_TRUE(context.jingle_thread()); |
21 EXPECT_TRUE(context.main_message_loop()); | 21 EXPECT_TRUE(context.main_message_loop()); |
22 EXPECT_TRUE(context.encode_message_loop()); | 22 EXPECT_TRUE(context.encode_message_loop()); |
23 context.Stop(); | |
24 | |
25 // Expect all the threads are stopped. | |
26 EXPECT_FALSE(context.main_thread_.IsRunning()); | |
27 EXPECT_FALSE(context.encode_thread_.IsRunning()); | |
28 } | 23 } |
29 | 24 |
30 } // namespace remoting | 25 } // namespace remoting |
OLD | NEW |