Chromium Code Reviews| Index: client/crash_report_database_test.cc |
| diff --git a/client/crash_report_database_test.cc b/client/crash_report_database_test.cc |
| index 6a04d19cfa802cd8a162c48b2aab8832c115f2b8..22062f8992ece968337fdcd733f8b4daf5965770 100644 |
| --- a/client/crash_report_database_test.cc |
| +++ b/client/crash_report_database_test.cc |
| @@ -526,6 +526,50 @@ TEST_F(CrashReportDatabaseTest, ReportRemoved) { |
| db()->LookUpCrashReport(uuid, &report)); |
| } |
| +TEST_F(CrashReportDatabaseTest, DeleteReport) { |
| + CrashReportDatabase::Report keep_pending; |
| + CrashReportDatabase::Report delete_pending; |
| + CrashReportDatabase::Report keep_completed; |
| + CrashReportDatabase::Report delete_completed; |
| + |
| + CreateCrashReport(&keep_pending); |
| + CreateCrashReport(&delete_pending); |
| + CreateCrashReport(&keep_completed); |
| + CreateCrashReport(&delete_completed); |
| + |
| + EXPECT_TRUE(FileExistsAtPath(keep_pending.file_path)); |
|
Mark Mentovai
2015/10/07 03:54:27
FileExistsAtPath() is going away in https://codere
Robert Sesek
2015/10/07 16:24:34
Done.
|
| + EXPECT_TRUE(FileExistsAtPath(delete_pending.file_path)); |
| + EXPECT_TRUE(FileExistsAtPath(keep_completed.file_path)); |
| + EXPECT_TRUE(FileExistsAtPath(delete_completed.file_path)); |
| + |
| + UploadReport(keep_completed.uuid, true, "1"); |
| + UploadReport(delete_completed.uuid, true, "2"); |
| + |
| + EXPECT_EQ(CrashReportDatabase::kNoError, |
| + db()->LookUpCrashReport(keep_completed.uuid, &keep_completed)); |
| + EXPECT_EQ(CrashReportDatabase::kNoError, |
| + db()->LookUpCrashReport(delete_completed.uuid, &delete_completed)); |
| + |
| + EXPECT_TRUE(FileExistsAtPath(keep_completed.file_path)); |
| + EXPECT_TRUE(FileExistsAtPath(delete_completed.file_path)); |
| + |
| + EXPECT_EQ(CrashReportDatabase::kNoError, |
| + db()->DeleteReport(delete_pending.uuid)); |
| + EXPECT_FALSE(FileExistsAtPath(delete_pending.file_path)); |
| + EXPECT_EQ(CrashReportDatabase::kReportNotFound, |
| + db()->LookUpCrashReport(delete_pending.uuid, &delete_pending)); |
| + EXPECT_EQ(CrashReportDatabase::kReportNotFound, |
| + db()->DeleteReport(delete_pending.uuid)); |
| + |
| + EXPECT_EQ(CrashReportDatabase::kNoError, |
| + db()->DeleteReport(delete_completed.uuid)); |
| + EXPECT_FALSE(FileExistsAtPath(delete_completed.file_path)); |
| + EXPECT_EQ(CrashReportDatabase::kReportNotFound, |
| + db()->LookUpCrashReport(delete_completed.uuid, &delete_completed)); |
| + EXPECT_EQ(CrashReportDatabase::kReportNotFound, |
| + db()->DeleteReport(delete_completed.uuid)); |
| +} |
|
Mark Mentovai
2015/10/07 03:54:27
Make sure the deletes didn’t delete beyond their s
Robert Sesek
2015/10/07 16:24:34
Done.
|
| + |
| } // namespace |
| } // namespace test |
| } // namespace crashpad |