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

Unified Diff: ios/chrome/browser/crash_loop_detection_util.mm

Issue 2592173002: Fix ios_chrome_unittests to crash on DCHECK failure. (Closed)
Patch Set: Address comments Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/crash_loop_detection_util.mm
diff --git a/ios/chrome/browser/crash_loop_detection_util.mm b/ios/chrome/browser/crash_loop_detection_util.mm
index 2eb1913a59098e684fb53d01931759728096c5cf..0de92d6c2b1d2e615c3b6d55fc4d54c9d11d3284 100644
--- a/ios/chrome/browser/crash_loop_detection_util.mm
+++ b/ios/chrome/browser/crash_loop_detection_util.mm
@@ -11,13 +11,13 @@
#endif
namespace {
+static int startup_attempt_count = -1;
NSString* const kAppStartupFailureCountKey = @"AppStartupFailureCount";
}
namespace crash_util {
int GetFailedStartupAttemptCount() {
- static int startup_attempt_count = -1;
if (startup_attempt_count == -1) {
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
startup_attempt_count = [defaults integerForKey:kAppStartupFailureCountKey];
@@ -42,4 +42,9 @@ void ResetFailedStartupAttemptCount() {
}
}
+void ResetFailedStartupAttemptCountForTests() {
+ ResetFailedStartupAttemptCount();
+ startup_attempt_count = -1;
+}
+
} // namespace crash_util
« no previous file with comments | « ios/chrome/browser/crash_loop_detection_util.h ('k') | ios/chrome/browser/crash_loop_detection_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698