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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 DISALLOW_COPY_AND_ASSIGN(ScopedUnsetCrashpadInfoOptions); | 68 DISALLOW_COPY_AND_ASSIGN(ScopedUnsetCrashpadInfoOptions); |
69 }; | 69 }; |
70 | 70 |
71 TEST(CrashpadInfoClientOptions, OneModule) { | 71 TEST(CrashpadInfoClientOptions, OneModule) { |
72 // Make sure that the initial state has all values unset. | 72 // Make sure that the initial state has all values unset. |
73 #if defined(OS_MACOSX) | 73 #if defined(OS_MACOSX) |
74 ProcessSnapshotMac process_snapshot; | 74 ProcessSnapshotMac process_snapshot; |
75 ASSERT_TRUE(process_snapshot.Initialize(mach_task_self())); | 75 ASSERT_TRUE(process_snapshot.Initialize(mach_task_self())); |
76 #elif defined(OS_WIN) | 76 #elif defined(OS_WIN) |
77 ProcessSnapshotWin process_snapshot; | 77 ProcessSnapshotWin process_snapshot; |
78 ASSERT_TRUE(process_snapshot.Initialize(GetCurrentProcess())); | 78 ASSERT_TRUE(process_snapshot.Initialize(GetCurrentProcess(), |
| 79 ProcessSuspensionState::kRunning)); |
79 #else | 80 #else |
80 #error Port. | 81 #error Port. |
81 #endif // OS_MACOSX | 82 #endif // OS_MACOSX |
82 | 83 |
83 CrashpadInfoClientOptions options; | 84 CrashpadInfoClientOptions options; |
84 process_snapshot.GetCrashpadOptions(&options); | 85 process_snapshot.GetCrashpadOptions(&options); |
85 | 86 |
86 EXPECT_EQ(TriState::kUnset, options.crashpad_handler_behavior); | 87 EXPECT_EQ(TriState::kUnset, options.crashpad_handler_behavior); |
87 EXPECT_EQ(TriState::kUnset, options.system_crash_reporter_forwarding); | 88 EXPECT_EQ(TriState::kUnset, options.system_crash_reporter_forwarding); |
88 | 89 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 CrashpadInfo* (*TestModule_GetCrashpadInfo)() = | 182 CrashpadInfo* (*TestModule_GetCrashpadInfo)() = |
182 dl_handle.LookUpSymbol<CrashpadInfo* (*)()>("TestModule_GetCrashpadInfo"); | 183 dl_handle.LookUpSymbol<CrashpadInfo* (*)()>("TestModule_GetCrashpadInfo"); |
183 ASSERT_TRUE(TestModule_GetCrashpadInfo); | 184 ASSERT_TRUE(TestModule_GetCrashpadInfo); |
184 | 185 |
185 // Make sure that the initial state has all values unset. | 186 // Make sure that the initial state has all values unset. |
186 #if defined(OS_MACOSX) | 187 #if defined(OS_MACOSX) |
187 ProcessSnapshotMac process_snapshot; | 188 ProcessSnapshotMac process_snapshot; |
188 ASSERT_TRUE(process_snapshot.Initialize(mach_task_self())); | 189 ASSERT_TRUE(process_snapshot.Initialize(mach_task_self())); |
189 #elif defined(OS_WIN) | 190 #elif defined(OS_WIN) |
190 ProcessSnapshotWin process_snapshot; | 191 ProcessSnapshotWin process_snapshot; |
191 ASSERT_TRUE(process_snapshot.Initialize(GetCurrentProcess())); | 192 ASSERT_TRUE(process_snapshot.Initialize(GetCurrentProcess(), |
| 193 ProcessSuspensionState::kRunning)); |
192 #else | 194 #else |
193 #error Port. | 195 #error Port. |
194 #endif // OS_MACOSX | 196 #endif // OS_MACOSX |
195 | 197 |
196 CrashpadInfoClientOptions options; | 198 CrashpadInfoClientOptions options; |
197 process_snapshot.GetCrashpadOptions(&options); | 199 process_snapshot.GetCrashpadOptions(&options); |
198 | 200 |
199 EXPECT_EQ(TriState::kUnset, options.crashpad_handler_behavior); | 201 EXPECT_EQ(TriState::kUnset, options.crashpad_handler_behavior); |
200 EXPECT_EQ(TriState::kUnset, options.system_crash_reporter_forwarding); | 202 EXPECT_EQ(TriState::kUnset, options.system_crash_reporter_forwarding); |
201 | 203 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 249 |
248 process_snapshot.GetCrashpadOptions(&options); | 250 process_snapshot.GetCrashpadOptions(&options); |
249 EXPECT_EQ(TriState::kUnset, options.crashpad_handler_behavior); | 251 EXPECT_EQ(TriState::kUnset, options.crashpad_handler_behavior); |
250 EXPECT_EQ(TriState::kEnabled, options.system_crash_reporter_forwarding); | 252 EXPECT_EQ(TriState::kEnabled, options.system_crash_reporter_forwarding); |
251 } | 253 } |
252 } | 254 } |
253 | 255 |
254 } // namespace | 256 } // namespace |
255 } // namespace test | 257 } // namespace test |
256 } // namespace crashpad | 258 } // namespace crashpad |
OLD | NEW |