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

Unified Diff: client/crash_report_database_test.cc

Issue 904533002: Add CrashReportDatabase::ErrorWritingCrashReport() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/crash_report_database_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/crash_report_database_test.cc
diff --git a/client/crash_report_database_test.cc b/client/crash_report_database_test.cc
index d2464863fea4e9b5914b98ab9d20347bdf0fb4ac..60bcf43bd0812f0c38bb2adc212420239e627ccb 100644
--- a/client/crash_report_database_test.cc
+++ b/client/crash_report_database_test.cc
@@ -133,6 +133,7 @@ TEST_F(CrashReportDatabaseTest, NewCrashReport) {
CrashReportDatabase::NewReport* new_report;
EXPECT_EQ(CrashReportDatabase::kNoError,
db()->PrepareNewCrashReport(&new_report));
+ EXPECT_TRUE(FileExistsAtPath(new_report->path)) << new_report->path.value();
UUID uuid;
EXPECT_EQ(CrashReportDatabase::kNoError,
db()->FinishedWritingCrashReport(new_report, &uuid));
@@ -154,6 +155,17 @@ TEST_F(CrashReportDatabaseTest, NewCrashReport) {
EXPECT_TRUE(reports.empty());
}
+TEST_F(CrashReportDatabaseTest, ErrorWritingCrashReport) {
+ CrashReportDatabase::NewReport* new_report;
+ EXPECT_EQ(CrashReportDatabase::kNoError,
+ db()->PrepareNewCrashReport(&new_report));
+ base::FilePath new_report_path = new_report->path;
+ EXPECT_TRUE(FileExistsAtPath(new_report_path)) << new_report_path.value();
+ EXPECT_EQ(CrashReportDatabase::kNoError,
+ db()->ErrorWritingCrashReport(new_report));
+ EXPECT_FALSE(FileExistsAtPath(new_report_path)) << new_report_path.value();
+}
+
TEST_F(CrashReportDatabaseTest, LookUpCrashReport) {
UUID uuid;
« no previous file with comments | « client/crash_report_database_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698