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

Side by Side Diff: test/win/win_multiprocess.cc

Issue 1160843006: win: add a child ProcessReader test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 6 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 | « snapshot/win/process_reader_win_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 char c; 161 char c;
162 CheckedReadFile(pipe_c2p_read_.get(), &c, sizeof(c)); 162 CheckedReadFile(pipe_c2p_read_.get(), &c, sizeof(c));
163 ASSERT_EQ(' ', c); 163 ASSERT_EQ(' ', c);
164 164
165 // These have been passed to the child, close our side. 165 // These have been passed to the child, close our side.
166 pipe_c2p_write_.reset(); 166 pipe_c2p_write_.reset();
167 pipe_p2c_read_.reset(); 167 pipe_p2c_read_.reset();
168 168
169 WinMultiprocessParent(); 169 WinMultiprocessParent();
170 170
171 // Close our side of the handles now that we're done. The child can
172 // use this to know when it's safe to complete.
173 pipe_p2c_write_.reset();
174 pipe_c2p_read_.reset();
175
171 // Wait for the child to complete. 176 // Wait for the child to complete.
172 ASSERT_EQ(WAIT_OBJECT_0, 177 ASSERT_EQ(WAIT_OBJECT_0,
173 WaitForSingleObject(child_handle_.get(), INFINITE)); 178 WaitForSingleObject(child_handle_.get(), INFINITE));
174 179
175 DWORD exit_code; 180 DWORD exit_code;
176 ASSERT_TRUE(GetExitCodeProcess(child_handle_.get(), &exit_code)); 181 ASSERT_TRUE(GetExitCodeProcess(child_handle_.get(), &exit_code));
177 ASSERT_EQ(exit_code_, exit_code); 182 ASSERT_EQ(exit_code_, exit_code);
178 } 183 }
179 } 184 }
180 185
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 pipe_c2p_write_.reset(); 218 pipe_c2p_write_.reset();
214 } 219 }
215 220
216 HANDLE WinMultiprocess::ChildProcess() const { 221 HANDLE WinMultiprocess::ChildProcess() const {
217 EXPECT_NE(nullptr, child_handle_.get()); 222 EXPECT_NE(nullptr, child_handle_.get());
218 return child_handle_.get(); 223 return child_handle_.get();
219 } 224 }
220 225
221 } // namespace test 226 } // namespace test
222 } // namespace crashpad 227 } // namespace crashpad
OLDNEW
« no previous file with comments | « snapshot/win/process_reader_win_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698