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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 test_executable.DirName() | 141 test_executable.DirName() |
142 .Append(directory_modification) | 142 .Append(directory_modification) |
143 .Append(test_executable.BaseName().RemoveFinalExtension().value() + | 143 .Append(test_executable.BaseName().RemoveFinalExtension().value() + |
144 L"_crashing_child.exe") | 144 L"_crashing_child.exe") |
145 .value(); | 145 .value(); |
146 ChildLauncher child(child_test_executable, pipe_name); | 146 ChildLauncher child(child_test_executable, pipe_name); |
147 child.Start(); | 147 child.Start(); |
148 | 148 |
149 // The child tells us (approximately) where it will crash. | 149 // The child tells us (approximately) where it will crash. |
150 WinVMAddress break_near_address; | 150 WinVMAddress break_near_address; |
151 LoggingReadFile(child.stdout_read_handle(), | 151 LoggingReadFileExactly(child.stdout_read_handle(), |
152 &break_near_address, | 152 &break_near_address, |
153 sizeof(break_near_address)); | 153 sizeof(break_near_address)); |
154 delegate.set_break_near(break_near_address); | 154 delegate.set_break_near(break_near_address); |
155 | 155 |
156 // Wait for the child to crash and the exception information to be validated. | 156 // Wait for the child to crash and the exception information to be validated. |
157 WaitForSingleObject(completed.get(), INFINITE); | 157 WaitForSingleObject(completed.get(), INFINITE); |
158 } | 158 } |
159 | 159 |
160 TEST(ExceptionSnapshotWinTest, ChildCrash) { | 160 TEST(ExceptionSnapshotWinTest, ChildCrash) { |
161 TestCrashingChild(FILE_PATH_LITERAL(".")); | 161 TestCrashingChild(FILE_PATH_LITERAL(".")); |
162 } | 162 } |
163 | 163 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 test_executable.DirName() | 243 test_executable.DirName() |
244 .Append(directory_modification) | 244 .Append(directory_modification) |
245 .Append(test_executable.BaseName().RemoveFinalExtension().value() + | 245 .Append(test_executable.BaseName().RemoveFinalExtension().value() + |
246 L"_dump_without_crashing.exe") | 246 L"_dump_without_crashing.exe") |
247 .value(); | 247 .value(); |
248 ChildLauncher child(child_test_executable, pipe_name); | 248 ChildLauncher child(child_test_executable, pipe_name); |
249 child.Start(); | 249 child.Start(); |
250 | 250 |
251 // The child tells us (approximately) where it will capture a dump. | 251 // The child tells us (approximately) where it will capture a dump. |
252 WinVMAddress dump_near_address; | 252 WinVMAddress dump_near_address; |
253 LoggingReadFile(child.stdout_read_handle(), | 253 LoggingReadFileExactly(child.stdout_read_handle(), |
254 &dump_near_address, | 254 &dump_near_address, |
255 sizeof(dump_near_address)); | 255 sizeof(dump_near_address)); |
256 delegate.set_dump_near(dump_near_address); | 256 delegate.set_dump_near(dump_near_address); |
257 | 257 |
258 // Wait for the child to crash and the exception information to be validated. | 258 // Wait for the child to crash and the exception information to be validated. |
259 WaitForSingleObject(completed.get(), INFINITE); | 259 WaitForSingleObject(completed.get(), INFINITE); |
260 } | 260 } |
261 | 261 |
262 TEST(SimulateCrash, ChildDumpWithoutCrashing) { | 262 TEST(SimulateCrash, ChildDumpWithoutCrashing) { |
263 TestDumpWithoutCrashingChild(FILE_PATH_LITERAL(".")); | 263 TestDumpWithoutCrashingChild(FILE_PATH_LITERAL(".")); |
264 } | 264 } |
265 | 265 |
266 #if defined(ARCH_CPU_64_BITS) | 266 #if defined(ARCH_CPU_64_BITS) |
267 TEST(SimulateCrash, ChildDumpWithoutCrashingWOW64) { | 267 TEST(SimulateCrash, ChildDumpWithoutCrashingWOW64) { |
268 #ifndef NDEBUG | 268 #ifndef NDEBUG |
269 TestDumpWithoutCrashingChild(FILE_PATH_LITERAL("..\\..\\out\\Debug")); | 269 TestDumpWithoutCrashingChild(FILE_PATH_LITERAL("..\\..\\out\\Debug")); |
270 #else | 270 #else |
271 TestDumpWithoutCrashingChild(FILE_PATH_LITERAL("..\\..\\out\\Release")); | 271 TestDumpWithoutCrashingChild(FILE_PATH_LITERAL("..\\..\\out\\Release")); |
272 #endif | 272 #endif |
273 } | 273 } |
274 #endif // ARCH_CPU_64_BITS | 274 #endif // ARCH_CPU_64_BITS |
275 | 275 |
276 } // namespace | 276 } // namespace |
277 } // namespace test | 277 } // namespace test |
278 } // namespace crashpad | 278 } // namespace crashpad |
OLD | NEW |