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

Side by Side Diff: snapshot/win/exception_snapshot_win_test.cc

Issue 1428803006: win: Implement CrashpadClient::StartHandler() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback; add a test Created 5 years, 1 month 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/end_to_end_test.py ('k') | test/multiprocess_exec_win.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 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 }; 121 };
122 122
123 void TestCrashingChild(const base::string16& directory_modification) { 123 void TestCrashingChild(const base::string16& directory_modification) {
124 // Set up the registration server on a background thread. 124 // Set up the registration server on a background thread.
125 std::string pipe_name = "\\\\.\\pipe\\handler_test_pipe_" + 125 std::string pipe_name = "\\\\.\\pipe\\handler_test_pipe_" +
126 base::StringPrintf("%08x", GetCurrentProcessId()); 126 base::StringPrintf("%08x", GetCurrentProcessId());
127 ScopedKernelHANDLE server_ready(CreateEvent(nullptr, false, false, nullptr)); 127 ScopedKernelHANDLE server_ready(CreateEvent(nullptr, false, false, nullptr));
128 ScopedKernelHANDLE completed(CreateEvent(nullptr, false, false, nullptr)); 128 ScopedKernelHANDLE completed(CreateEvent(nullptr, false, false, nullptr));
129 CrashingDelegate delegate(server_ready.get(), completed.get()); 129 CrashingDelegate delegate(server_ready.get(), completed.get());
130 130
131 ExceptionHandlerServer exception_handler_server(pipe_name); 131 ExceptionHandlerServer exception_handler_server(pipe_name, true);
132 RunServerThread server_thread(&exception_handler_server, &delegate); 132 RunServerThread server_thread(&exception_handler_server, &delegate);
133 server_thread.Start(); 133 server_thread.Start();
134 ScopedStopServerAndJoinThread scoped_stop_server_and_join_thread( 134 ScopedStopServerAndJoinThread scoped_stop_server_and_join_thread(
135 &exception_handler_server, &server_thread); 135 &exception_handler_server, &server_thread);
136 136
137 WaitForSingleObject(server_ready.get(), INFINITE); 137 WaitForSingleObject(server_ready.get(), INFINITE);
138 138
139 // Spawn a child process, passing it the pipe name to connect to. 139 // Spawn a child process, passing it the pipe name to connect to.
140 base::FilePath test_executable = Paths::Executable(); 140 base::FilePath test_executable = Paths::Executable();
141 std::wstring child_test_executable = 141 std::wstring child_test_executable =
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 void TestDumpWithoutCrashingChild( 224 void TestDumpWithoutCrashingChild(
225 const base::string16& directory_modification) { 225 const base::string16& directory_modification) {
226 // Set up the registration server on a background thread. 226 // Set up the registration server on a background thread.
227 std::string pipe_name = "\\\\.\\pipe\\handler_test_pipe_" + 227 std::string pipe_name = "\\\\.\\pipe\\handler_test_pipe_" +
228 base::StringPrintf("%08x", GetCurrentProcessId()); 228 base::StringPrintf("%08x", GetCurrentProcessId());
229 ScopedKernelHANDLE server_ready(CreateEvent(nullptr, false, false, nullptr)); 229 ScopedKernelHANDLE server_ready(CreateEvent(nullptr, false, false, nullptr));
230 ScopedKernelHANDLE completed(CreateEvent(nullptr, false, false, nullptr)); 230 ScopedKernelHANDLE completed(CreateEvent(nullptr, false, false, nullptr));
231 SimulateDelegate delegate(server_ready.get(), completed.get()); 231 SimulateDelegate delegate(server_ready.get(), completed.get());
232 232
233 ExceptionHandlerServer exception_handler_server(pipe_name); 233 ExceptionHandlerServer exception_handler_server(pipe_name, true);
234 RunServerThread server_thread(&exception_handler_server, &delegate); 234 RunServerThread server_thread(&exception_handler_server, &delegate);
235 server_thread.Start(); 235 server_thread.Start();
236 ScopedStopServerAndJoinThread scoped_stop_server_and_join_thread( 236 ScopedStopServerAndJoinThread scoped_stop_server_and_join_thread(
237 &exception_handler_server, &server_thread); 237 &exception_handler_server, &server_thread);
238 238
239 WaitForSingleObject(server_ready.get(), INFINITE); 239 WaitForSingleObject(server_ready.get(), INFINITE);
240 240
241 // Spawn a child process, passing it the pipe name to connect to. 241 // Spawn a child process, passing it the pipe name to connect to.
242 base::FilePath test_executable = Paths::Executable(); 242 base::FilePath test_executable = Paths::Executable();
243 std::wstring child_test_executable = 243 std::wstring child_test_executable =
(...skipping 26 matching lines...) Expand all
270 TestDumpWithoutCrashingChild(FILE_PATH_LITERAL("..\\..\\out\\Debug")); 270 TestDumpWithoutCrashingChild(FILE_PATH_LITERAL("..\\..\\out\\Debug"));
271 #else 271 #else
272 TestDumpWithoutCrashingChild(FILE_PATH_LITERAL("..\\..\\out\\Release")); 272 TestDumpWithoutCrashingChild(FILE_PATH_LITERAL("..\\..\\out\\Release"));
273 #endif 273 #endif
274 } 274 }
275 #endif // ARCH_CPU_64_BITS 275 #endif // ARCH_CPU_64_BITS
276 276
277 } // namespace 277 } // namespace
278 } // namespace test 278 } // namespace test
279 } // namespace crashpad 279 } // namespace crashpad
OLDNEW
« no previous file with comments | « snapshot/win/end_to_end_test.py ('k') | test/multiprocess_exec_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698