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

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

Issue 633263002: Mojo: Combine mojo/edk/{system,embedder}/PRESUBMIT.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « mojo/edk/system/memory.cc ('k') | mojo/edk/test/multiprocess_test_helper_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 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/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // Valid after |StartChild()| and before |WaitForChildShutdown()|. 61 // Valid after |StartChild()| and before |WaitForChildShutdown()|.
62 base::ProcessHandle test_child_handle_; 62 base::ProcessHandle test_child_handle_;
63 63
64 DISALLOW_COPY_AND_ASSIGN(MultiprocessTestHelper); 64 DISALLOW_COPY_AND_ASSIGN(MultiprocessTestHelper);
65 }; 65 };
66 66
67 // Use this to declare the child process's "main()" function for tests using 67 // Use this to declare the child process's "main()" function for tests using
68 // |MultiprocessTestHelper|. It returns an |int|, which will be the process's 68 // |MultiprocessTestHelper|. It returns an |int|, which will be the process's
69 // exit code (but see the comment about |WaitForChildShutdown()|). 69 // exit code (but see the comment about |WaitForChildShutdown()|).
70 #define MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) \ 70 #define MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) \
71 MULTIPROCESS_TEST_MAIN_WITH_SETUP( \ 71 MULTIPROCESS_TEST_MAIN_WITH_SETUP( \
72 test_child_name ## TestChildMain, \ 72 test_child_name##TestChildMain, \
73 ::mojo::test::MultiprocessTestHelper::ChildSetup) 73 ::mojo::test::MultiprocessTestHelper::ChildSetup)
74 74
75 // Use this (and |WaitForChildTestShutdown()|) for the child process's "main()", 75 // Use this (and |WaitForChildTestShutdown()|) for the child process's "main()",
76 // if you want to use |EXPECT_...()| or |ASSERT_...()|; it has a |void| return 76 // if you want to use |EXPECT_...()| or |ASSERT_...()|; it has a |void| return
77 // type. (Note that while an |ASSERT_...()| failure will abort the test in the 77 // type. (Note that while an |ASSERT_...()| failure will abort the test in the
78 // child, it will not abort the test in the parent.) 78 // child, it will not abort the test in the parent.)
79 #define MOJO_MULTIPROCESS_TEST_CHILD_TEST(test_child_name) \ 79 #define MOJO_MULTIPROCESS_TEST_CHILD_TEST(test_child_name) \
80 void test_child_name ## TestChildTest(); \ 80 void test_child_name##TestChildTest(); \
81 MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) { \ 81 MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) { \
82 test_child_name ## TestChildTest(); \ 82 test_child_name##TestChildTest(); \
83 return (::testing::Test::HasFatalFailure() || \ 83 return (::testing::Test::HasFatalFailure() || \
84 ::testing::Test::HasNonfatalFailure()) ? 1 : 0; \ 84 ::testing::Test::HasNonfatalFailure()) \
85 } \ 85 ? 1 \
86 void test_child_name ## TestChildTest() 86 : 0; \
87 } \
88 void test_child_name##TestChildTest()
87 89
88 } // namespace test 90 } // namespace test
89 } // namespace mojo 91 } // namespace mojo
90 92
91 #endif // MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_ 93 #endif // MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/memory.cc ('k') | mojo/edk/test/multiprocess_test_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698