| OLD | NEW |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 ASSERT_EQ(0, rv_int); | 237 ASSERT_EQ(0, rv_int); |
| 238 | 238 |
| 239 // Wait for the new thread to be ready. | 239 // Wait for the new thread to be ready. |
| 240 init_semaphore_.Wait(); | 240 init_semaphore_.Wait(); |
| 241 | 241 |
| 242 // Tell the parent process that everything is set up. | 242 // Tell the parent process that everything is set up. |
| 243 char c = '\0'; | 243 char c = '\0'; |
| 244 CheckedWriteFile(test_exception_ports_->WritePipeHandle(), &c, 1); | 244 CheckedWriteFile(test_exception_ports_->WritePipeHandle(), &c, 1); |
| 245 | 245 |
| 246 // Wait for the parent process to say that its end is set up. | 246 // Wait for the parent process to say that its end is set up. |
| 247 CheckedReadFile(test_exception_ports_->ReadPipeHandle(), &c, 1); | 247 CheckedReadFileExactly(test_exception_ports_->ReadPipeHandle(), &c, 1); |
| 248 EXPECT_EQ('\0', c); | 248 EXPECT_EQ('\0', c); |
| 249 | 249 |
| 250 // Regardless of where ExceptionPorts::SetExceptionPort() ran, | 250 // Regardless of where ExceptionPorts::SetExceptionPort() ran, |
| 251 // ExceptionPorts::GetExceptionPorts() can always be tested in-process. | 251 // ExceptionPorts::GetExceptionPorts() can always be tested in-process. |
| 252 { | 252 { |
| 253 SCOPED_TRACE("task"); | 253 SCOPED_TRACE("task"); |
| 254 TestGetExceptionPorts(self_task_ports, remote_port, EXCEPTION_DEFAULT); | 254 TestGetExceptionPorts(self_task_ports, remote_port, EXCEPTION_DEFAULT); |
| 255 } | 255 } |
| 256 | 256 |
| 257 { | 257 { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 345 |
| 346 DISALLOW_COPY_AND_ASSIGN(Child); | 346 DISALLOW_COPY_AND_ASSIGN(Child); |
| 347 }; | 347 }; |
| 348 | 348 |
| 349 // MachMultiprocess: | 349 // MachMultiprocess: |
| 350 | 350 |
| 351 void MachMultiprocessParent() override { | 351 void MachMultiprocessParent() override { |
| 352 // Wait for the child process to be ready. It needs to have all of its | 352 // Wait for the child process to be ready. It needs to have all of its |
| 353 // threads set up before proceeding if in kSetOutOfProcess mode. | 353 // threads set up before proceeding if in kSetOutOfProcess mode. |
| 354 char c; | 354 char c; |
| 355 CheckedReadFile(ReadPipeHandle(), &c, 1); | 355 CheckedReadFileExactly(ReadPipeHandle(), &c, 1); |
| 356 EXPECT_EQ('\0', c); | 356 EXPECT_EQ('\0', c); |
| 357 | 357 |
| 358 mach_port_t local_port = LocalPort(); | 358 mach_port_t local_port = LocalPort(); |
| 359 | 359 |
| 360 // Get an ExceptionPorts object for the task and each of its threads. | 360 // Get an ExceptionPorts object for the task and each of its threads. |
| 361 ExceptionPorts task_ports(ExceptionPorts::kTargetTypeTask, ChildTask()); | 361 ExceptionPorts task_ports(ExceptionPorts::kTargetTypeTask, ChildTask()); |
| 362 EXPECT_STREQ("task", task_ports.TargetTypeName()); | 362 EXPECT_STREQ("task", task_ports.TargetTypeName()); |
| 363 | 363 |
| 364 // Hopefully the threads returned by task_threads() are in order, with the | 364 // Hopefully the threads returned by task_threads() are in order, with the |
| 365 // main thread first and the other thread second. This is currently always | 365 // main thread first and the other thread second. This is currently always |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 rv = | 603 rv = |
| 604 implicit_host_ports.GetExceptionPorts(ExcMaskValid(), &implicit_handlers); | 604 implicit_host_ports.GetExceptionPorts(ExcMaskValid(), &implicit_handlers); |
| 605 EXPECT_EQ(expect_success, rv); | 605 EXPECT_EQ(expect_success, rv); |
| 606 | 606 |
| 607 EXPECT_EQ(explicit_handlers.size(), implicit_handlers.size()); | 607 EXPECT_EQ(explicit_handlers.size(), implicit_handlers.size()); |
| 608 } | 608 } |
| 609 | 609 |
| 610 } // namespace | 610 } // namespace |
| 611 } // namespace test | 611 } // namespace test |
| 612 } // namespace crashpad | 612 } // namespace crashpad |
| OLD | NEW |