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

Side by Side Diff: mojo/edk/test/multiprocess_test_helper.h

Issue 843113003: MultiProcessTest: Update SpawnChild* to return a Process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « ipc/sync_socket_unittest.cc ('k') | mojo/edk/test/multiprocess_test_helper.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 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 #ifndef MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_ 5 #ifndef MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_
6 #define MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_ 6 #define MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/process/process_handle.h" 11 #include "base/process/process.h"
12 #include "base/test/multiprocess_test.h" 12 #include "base/test/multiprocess_test.h"
13 #include "base/test/test_timeouts.h" 13 #include "base/test/test_timeouts.h"
14 #include "mojo/edk/embedder/scoped_platform_handle.h" 14 #include "mojo/edk/embedder/scoped_platform_handle.h"
15 #include "testing/multiprocess_func_list.h" 15 #include "testing/multiprocess_func_list.h"
16 16
17 namespace mojo { 17 namespace mojo {
18 18
19 namespace embedder { 19 namespace embedder {
20 class PlatformChannelPair; 20 class PlatformChannelPair;
21 } 21 }
(...skipping 29 matching lines...) Expand all
51 // For use in the main process: 51 // For use in the main process:
52 embedder::ScopedPlatformHandle server_platform_handle; 52 embedder::ScopedPlatformHandle server_platform_handle;
53 53
54 // For use (and only valid) in the child process: 54 // For use (and only valid) in the child process:
55 static embedder::ScopedPlatformHandle client_platform_handle; 55 static embedder::ScopedPlatformHandle client_platform_handle;
56 56
57 private: 57 private:
58 scoped_ptr<embedder::PlatformChannelPair> platform_channel_pair_; 58 scoped_ptr<embedder::PlatformChannelPair> platform_channel_pair_;
59 59
60 // Valid after |StartChild()| and before |WaitForChildShutdown()|. 60 // Valid after |StartChild()| and before |WaitForChildShutdown()|.
61 base::ProcessHandle test_child_handle_; 61 base::Process test_child_;
62 62
63 DISALLOW_COPY_AND_ASSIGN(MultiprocessTestHelper); 63 DISALLOW_COPY_AND_ASSIGN(MultiprocessTestHelper);
64 }; 64 };
65 65
66 // Use this to declare the child process's "main()" function for tests using 66 // Use this to declare the child process's "main()" function for tests using
67 // |MultiprocessTestHelper|. It returns an |int|, which will be the process's 67 // |MultiprocessTestHelper|. It returns an |int|, which will be the process's
68 // exit code (but see the comment about |WaitForChildShutdown()|). 68 // exit code (but see the comment about |WaitForChildShutdown()|).
69 #define MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) \ 69 #define MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) \
70 MULTIPROCESS_TEST_MAIN_WITH_SETUP( \ 70 MULTIPROCESS_TEST_MAIN_WITH_SETUP( \
71 test_child_name##TestChildMain, \ 71 test_child_name##TestChildMain, \
(...skipping 11 matching lines...) Expand all
83 ::testing::Test::HasNonfatalFailure()) \ 83 ::testing::Test::HasNonfatalFailure()) \
84 ? 1 \ 84 ? 1 \
85 : 0; \ 85 : 0; \
86 } \ 86 } \
87 void test_child_name##TestChildTest() 87 void test_child_name##TestChildTest()
88 88
89 } // namespace test 89 } // namespace test
90 } // namespace mojo 90 } // namespace mojo
91 91
92 #endif // MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_ 92 #endif // MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_
OLDNEW
« no previous file with comments | « ipc/sync_socket_unittest.cc ('k') | mojo/edk/test/multiprocess_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698