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