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

Side by Side Diff: mojo/shell/child_process_host_unittest.cc

Issue 313653005: Mojo: Add an extremely skeletal mojo_shell_tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: get rid of extraneous mojo::(shell::)s Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « mojo/mojo.gyp ('k') | mojo/shell/desktop/mojo_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Note: This file also tests child_process.*.
6
7 #include "mojo/shell/child_process_host.h"
8
9 #include "base/logging.h"
10 #include "base/macros.h"
11 #include "base/message_loop/message_loop.h"
12 #include "mojo/common/message_pump_mojo.h"
13 #include "mojo/shell/context.h"
14 #include "mojo/shell/shell_test_base.h"
15 #include "testing/gtest/include/gtest/gtest.h"
16
17 namespace mojo {
18 namespace shell {
19 namespace test {
20 namespace {
21
22 class TestChildProcessHostDelegate : public ChildProcessHost::Delegate {
23 public:
24 TestChildProcessHostDelegate() {}
25 virtual ~TestChildProcessHostDelegate() {}
26 virtual void WillStart() OVERRIDE {
27 VLOG(2) << "TestChildProcessHostDelegate::WillStart()";
28 }
29 virtual void DidStart(bool success) OVERRIDE {
30 VLOG(2) << "TestChildProcessHostDelegate::DidStart(" << success << ")";
31 base::MessageLoop::current()->QuitWhenIdle();
32 }
33 };
34
35 typedef ShellTestBase ChildProcessHostTest;
36
37 TEST_F(ChildProcessHostTest, Basic) {
38 base::MessageLoop message_loop(
39 scoped_ptr<base::MessagePump>(new common::MessagePumpMojo()));
40
41 Context context;
42 TestChildProcessHostDelegate child_process_host_delegate;
43 ChildProcessHost child_process_host(&context,
44 &child_process_host_delegate,
45 ChildProcess::TYPE_TEST);
46 child_process_host.Start();
47 message_loop.Run();
48 int exit_code = child_process_host.Join();
49 VLOG(2) << "Joined child: exit_code = " << exit_code;
50 EXPECT_EQ(0, exit_code);
51 }
52
53 } // namespace
54 } // namespace test
55 } // namespace shell
56 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/mojo.gyp ('k') | mojo/shell/desktop/mojo_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698