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

Side by Side Diff: remoting/host/chromoting_host_context_unittest.cc

Issue 11419265: Revert 170360 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/chromoting_host_context.cc ('k') | remoting/host/chromoting_host_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/run_loop.h" 6 #include "base/message_loop_proxy.h"
7 #include "remoting/base/auto_thread_task_runner.h" 7 #include "remoting/base/auto_thread_task_runner.h"
8 #include "remoting/host/chromoting_host_context.h" 8 #include "remoting/host/chromoting_host_context.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace remoting { 11 namespace remoting {
12 12
13 // A simple test that starts and stop the context. This tests the context 13 // A simple test that starts and stop the context. This tests the context
14 // operates properly and all threads and message loops are valid. 14 // operates properly and all threads and message loops are valid.
15 TEST(ChromotingHostContextTest, StartAndStop) { 15 TEST(ChromotingHostContextTest, StartAndStop) {
16 MessageLoopForUI message_loop; 16 MessageLoopForUI message_loop;
17 base::RunLoop run_loop; 17 ChromotingHostContext context(new AutoThreadTaskRunner(
18 base::MessageLoopProxy::current()));
18 19
19 scoped_ptr<ChromotingHostContext> context = 20 context.Start();
20 ChromotingHostContext::Create(new AutoThreadTaskRunner( 21 EXPECT_TRUE(context.audio_task_runner());
21 message_loop.message_loop_proxy(), run_loop.QuitClosure())); 22 EXPECT_TRUE(context.video_capture_task_runner());
22 23 EXPECT_TRUE(context.video_encode_task_runner());
23 EXPECT_TRUE(context); 24 EXPECT_TRUE(context.file_task_runner());
24 if (!context) 25 EXPECT_TRUE(context.input_task_runner());
25 return; 26 EXPECT_TRUE(context.network_task_runner());
26 EXPECT_TRUE(context->audio_task_runner()); 27 EXPECT_TRUE(context.ui_task_runner());
27 EXPECT_TRUE(context->video_capture_task_runner());
28 EXPECT_TRUE(context->video_encode_task_runner());
29 EXPECT_TRUE(context->file_task_runner());
30 EXPECT_TRUE(context->input_task_runner());
31 EXPECT_TRUE(context->network_task_runner());
32 EXPECT_TRUE(context->ui_task_runner());
33
34 context.reset();
35 run_loop.Run();
36 } 28 }
37 29
38 } // namespace remoting 30 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/chromoting_host_context.cc ('k') | remoting/host/chromoting_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698