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

Unified Diff: ios/chrome/browser/ui/reading_list/reading_list_egtest.mm

Issue 2750623006: Do not reload UI if the Reading List entry does not exist (Closed)
Patch Set: Add test Created 3 years, 9 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
Index: ios/chrome/browser/ui/reading_list/reading_list_egtest.mm
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm b/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm
index 02f700d9d3e6d136150dc8433bb5c0fee8711539..46eb0e49579827976f32476f02c7dc945b6543cb 100644
--- a/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm
+++ b/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm
@@ -13,6 +13,7 @@
#import "ios/chrome/browser/ui/commands/generic_chrome_command.h"
#include "ios/chrome/browser/ui/commands/ios_command_ids.h"
#import "ios/chrome/browser/ui/reading_list/reading_list_collection_view_item.h"
+#import "ios/chrome/browser/ui/reading_list/reading_list_empty_collection_background.h"
#include "ios/chrome/browser/ui/ui_util.h"
#include "ios/chrome/grit/ios_strings.h"
#include "ios/chrome/grit/ios_theme_resources.h"
@@ -195,6 +196,12 @@ size_t ModelReadSize(ReadingListModel* model) {
}
return size;
}
+
+// Returns a match for the Reading List Empty Collection Background.
+id<GREYMatcher> EmptyBackground() {
+ return grey_accessibilityID(
+ [ReadingListEmptyCollectionBackground accessibilityIdentifier]);
+}
} // namespace
// Test class for the Reading List menu.
@@ -528,4 +535,29 @@ size_t ModelReadSize(ReadingListModel* model) {
GetReadingListModel()->unread_size());
}
+// Tests that you can delete multiple read items in the Reading List without
+// creating a crash (crbug.com/701956).
+- (void)testDeleteMultipleItems {
+ // Add entries.
+ ReadingListModel* model = GetReadingListModel();
+ for (int i = 0; i < 11; i++) {
+ std::string increment = std::to_string(i);
+ model->AddEntry(GURL(kReadURL + increment),
+ std::string(kReadTitle + increment),
+ reading_list::ADDED_VIA_CURRENT_APP);
+ model->SetReadStatus(GURL(kReadURL + increment), true);
+ }
+
+ // Delete them from the Reading List view.
+ OpenReadingList();
+ [[EarlGrey selectElementWithMatcher:EmptyBackground()]
+ assertWithMatcher:grey_nil()];
+ TapButtonWithID(IDS_IOS_READING_LIST_EDIT_BUTTON);
+ TapButtonWithID(IDS_IOS_READING_LIST_DELETE_ALL_READ_BUTTON);
+
+ // Verify the background string is displayed.
+ [[EarlGrey selectElementWithMatcher:EmptyBackground()]
+ assertWithMatcher:grey_notNil()];
+}
+
@end

Powered by Google App Engine
This is Rietveld 408576698