| 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, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. | 13 // limitations under the License. |
| 14 | 14 |
| 15 #include "util/mach/exc_server_variants.h" | 15 #include "util/mach/exc_server_variants.h" |
| 16 | 16 |
| 17 #include <mach/mach.h> | 17 #include <mach/mach.h> |
| 18 #include <signal.h> | 18 #include <signal.h> |
| 19 #include <string.h> | 19 #include <string.h> |
| 20 | 20 |
| 21 #include "base/basictypes.h" | 21 #include "base/basictypes.h" |
| 22 #include "base/strings/stringprintf.h" | 22 #include "base/strings/stringprintf.h" |
| 23 #include "gmock/gmock.h" | 23 #include "gmock/gmock.h" |
| 24 #include "gtest/gtest.h" | 24 #include "gtest/gtest.h" |
| 25 #include "util/mach/exception_behaviors.h" | 25 #include "util/mach/exception_behaviors.h" |
| 26 #include "util/mach/mach_extensions.h" | 26 #include "util/mach/mach_extensions.h" |
| 27 #include "util/test/mac/mach_errors.h" | 27 #include "util/test/mac/mach_errors.h" |
| 28 #include "util/test/mac/mach_multiprocess.h" | 28 #include "util/test/mac/mach_multiprocess.h" |
| 29 | 29 |
| 30 namespace crashpad { |
| 31 namespace test { |
| 30 namespace { | 32 namespace { |
| 31 | 33 |
| 32 using namespace crashpad; | 34 using testing::DefaultValue; |
| 33 using namespace crashpad::test; | 35 using testing::Eq; |
| 34 using namespace testing; | 36 using testing::Pointee; |
| 37 using testing::Return; |
| 35 | 38 |
| 36 // Fake Mach ports. These aren’t used as ports in these tests, they’re just used | 39 // Fake Mach ports. These aren’t used as ports in these tests, they’re just used |
| 37 // as cookies to make sure that the correct values get passed to the correct | 40 // as cookies to make sure that the correct values get passed to the correct |
| 38 // places. | 41 // places. |
| 39 const mach_port_t kClientRemotePort = 0x01010101; | 42 const mach_port_t kClientRemotePort = 0x01010101; |
| 40 const mach_port_t kServerLocalPort = 0x02020202; | 43 const mach_port_t kServerLocalPort = 0x02020202; |
| 41 const thread_t kExceptionThreadPort = 0x03030303; | 44 const thread_t kExceptionThreadPort = 0x03030303; |
| 42 const task_t kExceptionTaskPort = 0x04040404; | 45 const task_t kExceptionTaskPort = 0x04040404; |
| 43 | 46 |
| 44 // Other fake exception values. | 47 // Other fake exception values. |
| (...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1162 test_data.behavior, | 1165 test_data.behavior, |
| 1163 test_data.set_thread_state ? "true" : "false")); | 1166 test_data.set_thread_state ? "true" : "false")); |
| 1164 | 1167 |
| 1165 EXPECT_EQ(test_data.kr, | 1168 EXPECT_EQ(test_data.kr, |
| 1166 ExcServerSuccessfulReturnValue(test_data.behavior, | 1169 ExcServerSuccessfulReturnValue(test_data.behavior, |
| 1167 test_data.set_thread_state)); | 1170 test_data.set_thread_state)); |
| 1168 } | 1171 } |
| 1169 } | 1172 } |
| 1170 | 1173 |
| 1171 } // namespace | 1174 } // namespace |
| 1175 } // namespace test |
| 1176 } // namespace crashpad |
| OLD | NEW |