Commit 244a80c9 authored by Eugene But's avatar Eugene But Committed by Chromium LUCI CQ

[ios] Add crashed_after_app_will_terminate synthetic crash reports flag

According to Stability.iOS.UTE.MobileSessionAppWillTerminateWasReceived
UMA it's not uncommon to have a UTE after appWillTerminate callback.

Bug: None
Change-Id: I20b9e581b8dadb11d2b3e8b7f1c770f5ae1df650
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627049
Auto-Submit: Eugene But <eugenebut@chromium.org>
Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843072}
parent de8ade07
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
@property(nonatomic, assign) NSInteger memoryFootprint; @property(nonatomic, assign) NSInteger memoryFootprint;
@property(nonatomic, assign) NSInteger tabCount; @property(nonatomic, assign) NSInteger tabCount;
@property(nonatomic, assign) NSInteger OTRTabCount; @property(nonatomic, assign) NSInteger OTRTabCount;
@property(nonatomic, assign) BOOL applicationWillTerminateWasReceived;
+ (void)resetSharedInstanceForTesting; + (void)resetSharedInstanceForTesting;
......
...@@ -131,6 +131,11 @@ void CreateSyntheticCrashReportForUte( ...@@ -131,6 +131,11 @@ void CreateSyntheticCrashReportForUte(
base::NumberToString(previous_session.memoryFootprint)); base::NumberToString(previous_session.memoryFootprint));
} }
if (previous_session.applicationWillTerminateWasReceived) {
AppendConfigWithBreakpadServerParam(
config, "crashed_after_app_will_terminate", "yes");
}
// Write empty minidump file, as Breakpad can't upload config without the // Write empty minidump file, as Breakpad can't upload config without the
// minidump. // minidump.
base::File minidump_file( base::File minidump_file(
......
...@@ -40,6 +40,7 @@ TEST_F(SyntheticCrashReportUtilTest, CreateSyntheticCrashReportForUte) { ...@@ -40,6 +40,7 @@ TEST_F(SyntheticCrashReportUtilTest, CreateSyntheticCrashReportForUte) {
NSString* const kOSVersion = @"OSVersion"; NSString* const kOSVersion = @"OSVersion";
previous_session.OSVersion = kOSVersion; previous_session.OSVersion = kOSVersion;
previous_session.terminatedDuringSessionRestoration = YES; previous_session.terminatedDuringSessionRestoration = YES;
previous_session.applicationWillTerminateWasReceived = YES;
NSString* const kURL = @"URL"; NSString* const kURL = @"URL";
previous_session.reportParameters = @{@"url" : kURL}; previous_session.reportParameters = @{@"url" : kURL};
previous_session.sessionStartTime = [NSDate date]; previous_session.sessionStartTime = [NSDate date];
...@@ -109,7 +110,7 @@ TEST_F(SyntheticCrashReportUtilTest, CreateSyntheticCrashReportForUte) { ...@@ -109,7 +110,7 @@ TEST_F(SyntheticCrashReportUtilTest, CreateSyntheticCrashReportForUte) {
// Verify config file content. Config file has the following format: // Verify config file content. Config file has the following format:
// <Key1>\n<Value1Length>\n<Value1>\n...<KeyN>\n<ValueNLength>\n<ValueN> // <Key1>\n<Value1Length>\n<Value1>\n...<KeyN>\n<ValueNLength>\n<ValueN>
ASSERT_EQ(58U, config_lines.size()) ASSERT_EQ(61U, config_lines.size())
<< "<content>" << config_content << "</content>"; << "<content>" << config_content << "</content>";
EXPECT_EQ("MinidumpDir", config_lines[0]); EXPECT_EQ("MinidumpDir", config_lines[0]);
...@@ -203,6 +204,11 @@ TEST_F(SyntheticCrashReportUtilTest, CreateSyntheticCrashReportForUte) { ...@@ -203,6 +204,11 @@ TEST_F(SyntheticCrashReportUtilTest, CreateSyntheticCrashReportForUte) {
config_lines[56]); config_lines[56]);
EXPECT_EQ(base::NumberToString(kMemoryFootprint), config_lines[57]); EXPECT_EQ(base::NumberToString(kMemoryFootprint), config_lines[57]);
EXPECT_EQ("BreakpadServerParameterPrefix_crashed_after_app_will_terminate",
config_lines[58]);
EXPECT_EQ(base::NumberToString(strlen(kYesString)), config_lines[59]);
EXPECT_EQ(kYesString, config_lines[60]);
// Read minidump file. It must be empty as there is no stack trace, but // Read minidump file. It must be empty as there is no stack trace, but
// Breakpad will not upload config without minidump file. // Breakpad will not upload config without minidump file.
base::File minidump_file(minidump_file_path, base::File minidump_file(minidump_file_path,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment