Commit f6d40844 authored by sczs's avatar sczs Committed by Commit Bot

[ios]RELAND Bookmarks TableVC uses dynamic row height.

Patchset 1 is the original CL. https://crrev.com/c/1205806

The only change on this CL is to disable dynamic height
on non-UI Refresh since the legacy cells don't support it.


======= Original Description =======

This CL changes BookmarksTableVC so it uses dynamic row height.

It also updates some EG tests that started to fail once this change
was made. I suspect this has to do with internal TableView management
of cells when using dynamic height.

The BottomCell test cell was moved to the penultimate position since
we now snap at the top of the top cells instead
of using the offset value of the TableView. This meant that the top
cell was completely visible when re-creating the cache and the
"Bottom Cell" was partially hidden.

Bug: 869671
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: Ic1844c60f88357acabc008acbb6be6b38f9e99b1
Reviewed-on: https://chromium-review.googlesource.com/1210548
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589280}
parent b1874334
......@@ -1887,10 +1887,12 @@ const CGFloat kShadowRadius = 12.0f;
- (CGFloat)tableView:(UITableView*)tableView
heightForRowAtIndexPath:(NSIndexPath*)indexPath {
NSInteger sectionIdentifier = [self.sharedState.tableViewModel
sectionIdentifierForSection:indexPath.section];
if (sectionIdentifier == BookmarkHomeSectionIdentifierBookmarks) {
return kEstimatedRowHeight;
if (!experimental_flags::IsBookmarksUIRebootEnabled()) {
NSInteger sectionIdentifier = [self.sharedState.tableViewModel
sectionIdentifierForSection:indexPath.section];
if (sectionIdentifier == BookmarkHomeSectionIdentifierBookmarks) {
return kEstimatedRowHeight;
}
}
return UITableViewAutomaticDimension;
}
......
......@@ -885,7 +885,8 @@ id<GREYMatcher> TappableBookmarkNodeWithLabel(NSString* label) {
// Ensure the Bottom 1 of Folder 1 is visible. That means both folder and
// scroll position are restored successfully.
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"Bottom 1")]
[[EarlGrey
selectElementWithMatcher:grey_accessibilityLabel(@"Bottom 1, 127.0.0.1")]
assertWithMatcher:grey_sufficientlyVisible()];
}
......@@ -1088,6 +1089,8 @@ id<GREYMatcher> TappableBookmarkNodeWithLabel(NSString* label) {
base::SysNSStringToUTF16(@"Top URL"), dummyURL);
// Add URLs to Folder 1.
bookmark_model->AddURL(folder1, 0, base::SysNSStringToUTF16(dummyTitle),
dummyURL);
bookmark_model->AddURL(folder1, 0, base::SysNSStringToUTF16(@"Bottom 1"),
dummyURL);
for (int i = 0; i < 20; i++) {
......@@ -1603,7 +1606,7 @@ id<GREYMatcher> TappableBookmarkNodeWithLabel(NSString* label) {
// verify the editable textfield is gone.
[[EarlGrey
selectElementWithMatcher:grey_accessibilityID(@"bookmark_editing_text")]
assertWithMatcher:grey_nil()];
assertWithMatcher:grey_notVisible()];
}
+ (void)tapOnContextMenuButton:(int)menuButtonId
......
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