Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: snapshot/crashpad_info_client_options_test.cc

Issue 1392093003: win: Capture some CRITICAL_SECTION debugging data (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(
79 ProcessSuspensionState::kRunning)); 79 GetCurrentProcess(), ProcessSuspensionState::kRunning, 0));
80 #else 80 #else
81 #error Port. 81 #error Port.
82 #endif // OS_MACOSX 82 #endif // OS_MACOSX
83 83
84 CrashpadInfoClientOptions options; 84 CrashpadInfoClientOptions options;
85 process_snapshot.GetCrashpadOptions(&options); 85 process_snapshot.GetCrashpadOptions(&options);
86 86
87 EXPECT_EQ(TriState::kUnset, options.crashpad_handler_behavior); 87 EXPECT_EQ(TriState::kUnset, options.crashpad_handler_behavior);
88 EXPECT_EQ(TriState::kUnset, options.system_crash_reporter_forwarding); 88 EXPECT_EQ(TriState::kUnset, options.system_crash_reporter_forwarding);
89 89
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 CrashpadInfo* (*TestModule_GetCrashpadInfo)() = 182 CrashpadInfo* (*TestModule_GetCrashpadInfo)() =
183 dl_handle.LookUpSymbol<CrashpadInfo* (*)()>("TestModule_GetCrashpadInfo"); 183 dl_handle.LookUpSymbol<CrashpadInfo* (*)()>("TestModule_GetCrashpadInfo");
184 ASSERT_TRUE(TestModule_GetCrashpadInfo); 184 ASSERT_TRUE(TestModule_GetCrashpadInfo);
185 185
186 // Make sure that the initial state has all values unset. 186 // Make sure that the initial state has all values unset.
187 #if defined(OS_MACOSX) 187 #if defined(OS_MACOSX)
188 ProcessSnapshotMac process_snapshot; 188 ProcessSnapshotMac process_snapshot;
189 ASSERT_TRUE(process_snapshot.Initialize(mach_task_self())); 189 ASSERT_TRUE(process_snapshot.Initialize(mach_task_self()));
190 #elif defined(OS_WIN) 190 #elif defined(OS_WIN)
191 ProcessSnapshotWin process_snapshot; 191 ProcessSnapshotWin process_snapshot;
192 ASSERT_TRUE(process_snapshot.Initialize(GetCurrentProcess(), 192 ASSERT_TRUE(process_snapshot.Initialize(
193 ProcessSuspensionState::kRunning)); 193 GetCurrentProcess(), ProcessSuspensionState::kRunning, 0));
194 #else 194 #else
195 #error Port. 195 #error Port.
196 #endif // OS_MACOSX 196 #endif // OS_MACOSX
197 197
198 CrashpadInfoClientOptions options; 198 CrashpadInfoClientOptions options;
199 process_snapshot.GetCrashpadOptions(&options); 199 process_snapshot.GetCrashpadOptions(&options);
200 200
201 EXPECT_EQ(TriState::kUnset, options.crashpad_handler_behavior); 201 EXPECT_EQ(TriState::kUnset, options.crashpad_handler_behavior);
202 EXPECT_EQ(TriState::kUnset, options.system_crash_reporter_forwarding); 202 EXPECT_EQ(TriState::kUnset, options.system_crash_reporter_forwarding);
203 203
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 249
250 process_snapshot.GetCrashpadOptions(&options); 250 process_snapshot.GetCrashpadOptions(&options);
251 EXPECT_EQ(TriState::kUnset, options.crashpad_handler_behavior); 251 EXPECT_EQ(TriState::kUnset, options.crashpad_handler_behavior);
252 EXPECT_EQ(TriState::kEnabled, options.system_crash_reporter_forwarding); 252 EXPECT_EQ(TriState::kEnabled, options.system_crash_reporter_forwarding);
253 } 253 }
254 } 254 }
255 255
256 } // namespace 256 } // namespace
257 } // namespace test 257 } // namespace test
258 } // namespace crashpad 258 } // namespace crashpad
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698