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

Side by Side Diff: mojo/common/test/multiprocess_test_helper.cc

Issue 194593007: Mojo: MultiprocessTestHelper: Allow {ASSERT,EXPECT}_...() to be used in child. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment fix Created 6 years, 9 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
OLDNEW
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 "mojo/common/test/multiprocess_test_helper.h" 5 #include "mojo/common/test/multiprocess_test_helper.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/process/kill.h" 9 #include "base/process/kill.h"
10 #include "base/process/process_handle.h" 10 #include "base/process/process_handle.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 CHECK_NE(test_child_handle_, base::kNullProcessHandle); 59 CHECK_NE(test_child_handle_, base::kNullProcessHandle);
60 60
61 int rv = -1; 61 int rv = -1;
62 CHECK(base::WaitForExitCodeWithTimeout( 62 CHECK(base::WaitForExitCodeWithTimeout(
63 test_child_handle_, &rv, TestTimeouts::action_timeout())); 63 test_child_handle_, &rv, TestTimeouts::action_timeout()));
64 base::CloseProcessHandle(test_child_handle_); 64 base::CloseProcessHandle(test_child_handle_);
65 test_child_handle_ = base::kNullProcessHandle; 65 test_child_handle_ = base::kNullProcessHandle;
66 return rv; 66 return rv;
67 } 67 }
68 68
69 bool MultiprocessTestHelper::WaitForChildTestShutdown() {
70 return WaitForChildShutdown() == 0;
71 }
72
69 // static 73 // static
70 void MultiprocessTestHelper::ChildSetup() { 74 void MultiprocessTestHelper::ChildSetup() {
71 CHECK(CommandLine::InitializedForCurrentProcess()); 75 CHECK(CommandLine::InitializedForCurrentProcess());
72 client_platform_handle = 76 client_platform_handle =
73 embedder::PlatformChannelPair::PassClientHandleFromParentProcess( 77 embedder::PlatformChannelPair::PassClientHandleFromParentProcess(
74 *CommandLine::ForCurrentProcess()); 78 *CommandLine::ForCurrentProcess());
75 } 79 }
76 80
77 // static 81 // static
78 embedder::ScopedPlatformHandle MultiprocessTestHelper::client_platform_handle; 82 embedder::ScopedPlatformHandle MultiprocessTestHelper::client_platform_handle;
79 83
80 } // namespace test 84 } // namespace test
81 } // namespace mojo 85 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/common/test/multiprocess_test_helper.h ('k') | mojo/common/test/multiprocess_test_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698