| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |