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

Side by Side Diff: util/test/multiprocess_exec.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.cc ('k') | util/test/multiprocess_test.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 30 matching lines...) Expand all
41 arguments_ = *arguments; 41 arguments_ = *arguments;
42 } else { 42 } else {
43 arguments_.clear(); 43 arguments_.clear();
44 } 44 }
45 } 45 }
46 46
47 MultiprocessExec::~MultiprocessExec() { 47 MultiprocessExec::~MultiprocessExec() {
48 } 48 }
49 49
50 void MultiprocessExec::PreFork() { 50 void MultiprocessExec::PreFork() {
51 Multiprocess::PreFork(); 51 ASSERT_NO_FATAL_FAILURE(Multiprocess::PreFork());
52 if (testing::Test::HasFatalFailure()) {
53 return;
54 }
55 52
56 ASSERT_FALSE(command_.empty()); 53 ASSERT_FALSE(command_.empty());
57 54
58 // Build up the argv vector. This is done in PreFork() instead of 55 // Build up the argv vector. This is done in PreFork() instead of
59 // MultiprocessChild() because although the result is only needed in the child 56 // MultiprocessChild() because although the result is only needed in the child
60 // process, building it is a hazardous operation in that process. 57 // process, building it is a hazardous operation in that process.
61 ASSERT_TRUE(argv_.empty()); 58 ASSERT_TRUE(argv_.empty());
62 59
63 argv_.push_back(command_.c_str()); 60 argv_.push_back(command_.c_str());
64 for (const std::string& argument : arguments_) { 61 for (const std::string& argument : arguments_) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 IGNORE_EINTR(close(STDOUT_FILENO)); 131 IGNORE_EINTR(close(STDOUT_FILENO));
135 HANDLE_EINTR(dup2(dup_orig_stdout_fd, STDOUT_FILENO)); 132 HANDLE_EINTR(dup2(dup_orig_stdout_fd, STDOUT_FILENO));
136 IGNORE_EINTR(close(dup_orig_stdout_fd)); 133 IGNORE_EINTR(close(dup_orig_stdout_fd));
137 134
138 forbid_return.Disarm(); 135 forbid_return.Disarm();
139 FAIL() << ErrnoMessage("execv") << ": " << argv_[0]; 136 FAIL() << ErrnoMessage("execv") << ": " << argv_[0];
140 } 137 }
141 138
142 } // namespace test 139 } // namespace test
143 } // namespace crashpad 140 } // namespace crashpad
OLDNEW
« no previous file with comments | « util/test/multiprocess.cc ('k') | util/test/multiprocess_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698