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

Side by Side Diff: util/test/multiprocess.cc

Issue 640383002: In tests, use ASSERT_NO_FATAL_FAILURE() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@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 | « util/test/multiprocess.h ('k') | util/test/multiprocess_exec.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 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 : info_(NULL), 56 : info_(NULL),
57 code_(EXIT_SUCCESS), 57 code_(EXIT_SUCCESS),
58 reason_(kTerminationNormal) { 58 reason_(kTerminationNormal) {
59 } 59 }
60 60
61 void Multiprocess::Run() { 61 void Multiprocess::Run() {
62 ASSERT_EQ(NULL, info_); 62 ASSERT_EQ(NULL, info_);
63 scoped_ptr<internal::MultiprocessInfo> info(new internal::MultiprocessInfo); 63 scoped_ptr<internal::MultiprocessInfo> info(new internal::MultiprocessInfo);
64 base::AutoReset<internal::MultiprocessInfo*> reset_info(&info_, info.get()); 64 base::AutoReset<internal::MultiprocessInfo*> reset_info(&info_, info.get());
65 65
66 PreFork(); 66 ASSERT_NO_FATAL_FAILURE(PreFork());
67 if (testing::Test::HasFatalFailure()) {
68 return;
69 }
70 67
71 pid_t pid = fork(); 68 pid_t pid = fork();
72 ASSERT_GE(pid, 0) << ErrnoMessage("fork"); 69 ASSERT_GE(pid, 0) << ErrnoMessage("fork");
73 70
74 if (pid > 0) { 71 if (pid > 0) {
75 info_->child_pid = pid; 72 info_->child_pid = pid;
76 73
77 RunParent(); 74 RunParent();
78 75
79 // Waiting for the child happens here instead of in RunParent() because even 76 // Waiting for the child happens here instead of in RunParent() because even
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 if (testing::Test::HasFailure()) { 209 if (testing::Test::HasFailure()) {
213 // Trigger the ScopedForbidReturn destructor. 210 // Trigger the ScopedForbidReturn destructor.
214 return; 211 return;
215 } 212 }
216 213
217 exit(0); 214 exit(0);
218 } 215 }
219 216
220 } // namespace test 217 } // namespace test
221 } // namespace crashpad 218 } // namespace crashpad
OLDNEW
« no previous file with comments | « util/test/multiprocess.h ('k') | util/test/multiprocess_exec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698