| 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 | 141 |
| 142 // Spawn a child process, passing it the pipe name to connect to. | 142 // Spawn a child process, passing it the pipe name to connect to. |
| 143 base::FilePath test_executable = TestPaths::Executable(); | 143 base::FilePath test_executable = TestPaths::Executable(); |
| 144 std::wstring child_test_executable = | 144 std::wstring child_test_executable = |
| 145 test_executable.DirName() | 145 test_executable.DirName() |
| 146 .Append(directory_modification) | 146 .Append(directory_modification) |
| 147 .Append(test_executable.BaseName().RemoveFinalExtension().value() + | 147 .Append(test_executable.BaseName().RemoveFinalExtension().value() + |
| 148 L"_crashing_child.exe") | 148 L"_crashing_child.exe") |
| 149 .value(); | 149 .value(); |
| 150 ChildLauncher child(child_test_executable, pipe_name); | 150 ChildLauncher child(child_test_executable, pipe_name); |
| 151 child.Start(); | 151 ASSERT_NO_FATAL_FAILURE(child.Start()); |
| 152 | 152 |
| 153 // The child tells us (approximately) where it will crash. | 153 // The child tells us (approximately) where it will crash. |
| 154 WinVMAddress break_near_address; | 154 WinVMAddress break_near_address; |
| 155 LoggingReadFileExactly(child.stdout_read_handle(), | 155 LoggingReadFileExactly(child.stdout_read_handle(), |
| 156 &break_near_address, | 156 &break_near_address, |
| 157 sizeof(break_near_address)); | 157 sizeof(break_near_address)); |
| 158 delegate.set_break_near(break_near_address); | 158 delegate.set_break_near(break_near_address); |
| 159 | 159 |
| 160 // Wait for the child to crash and the exception information to be validated. | 160 // Wait for the child to crash and the exception information to be validated. |
| 161 EXPECT_EQ(WaitForSingleObject(completed.get(), INFINITE), WAIT_OBJECT_0) | 161 EXPECT_EQ(WaitForSingleObject(completed.get(), INFINITE), WAIT_OBJECT_0) |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 249 |
| 250 // Spawn a child process, passing it the pipe name to connect to. | 250 // Spawn a child process, passing it the pipe name to connect to. |
| 251 base::FilePath test_executable = TestPaths::Executable(); | 251 base::FilePath test_executable = TestPaths::Executable(); |
| 252 std::wstring child_test_executable = | 252 std::wstring child_test_executable = |
| 253 test_executable.DirName() | 253 test_executable.DirName() |
| 254 .Append(directory_modification) | 254 .Append(directory_modification) |
| 255 .Append(test_executable.BaseName().RemoveFinalExtension().value() + | 255 .Append(test_executable.BaseName().RemoveFinalExtension().value() + |
| 256 L"_dump_without_crashing.exe") | 256 L"_dump_without_crashing.exe") |
| 257 .value(); | 257 .value(); |
| 258 ChildLauncher child(child_test_executable, pipe_name); | 258 ChildLauncher child(child_test_executable, pipe_name); |
| 259 child.Start(); | 259 ASSERT_NO_FATAL_FAILURE(child.Start()); |
| 260 | 260 |
| 261 // The child tells us (approximately) where it will capture a dump. | 261 // The child tells us (approximately) where it will capture a dump. |
| 262 WinVMAddress dump_near_address; | 262 WinVMAddress dump_near_address; |
| 263 LoggingReadFileExactly(child.stdout_read_handle(), | 263 LoggingReadFileExactly(child.stdout_read_handle(), |
| 264 &dump_near_address, | 264 &dump_near_address, |
| 265 sizeof(dump_near_address)); | 265 sizeof(dump_near_address)); |
| 266 delegate.set_dump_near(dump_near_address); | 266 delegate.set_dump_near(dump_near_address); |
| 267 | 267 |
| 268 // Wait for the child to crash and the exception information to be validated. | 268 // Wait for the child to crash and the exception information to be validated. |
| 269 EXPECT_EQ(WaitForSingleObject(completed.get(), INFINITE), WAIT_OBJECT_0) | 269 EXPECT_EQ(WaitForSingleObject(completed.get(), INFINITE), WAIT_OBJECT_0) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 282 TestDumpWithoutCrashingChild(FILE_PATH_LITERAL("..\\..\\out\\Debug")); | 282 TestDumpWithoutCrashingChild(FILE_PATH_LITERAL("..\\..\\out\\Debug")); |
| 283 #else | 283 #else |
| 284 TestDumpWithoutCrashingChild(FILE_PATH_LITERAL("..\\..\\out\\Release")); | 284 TestDumpWithoutCrashingChild(FILE_PATH_LITERAL("..\\..\\out\\Release")); |
| 285 #endif | 285 #endif |
| 286 } | 286 } |
| 287 #endif // ARCH_CPU_64_BITS | 287 #endif // ARCH_CPU_64_BITS |
| 288 | 288 |
| 289 } // namespace | 289 } // namespace |
| 290 } // namespace test | 290 } // namespace test |
| 291 } // namespace crashpad | 291 } // namespace crashpad |
| OLD | NEW |